Spark as middle man between IR receiver and device

I have this LED strip

And it has a packaged PWM dimmer module and remote. What I would like to do (if possible) is cut off the IR receiver and plug it right into a data out pin on my Spark, and then take the IR receiver and reuse it into an input on the Spark. Basically allowing the Spark to be a middle man between the IR receiver and the dimmer module. This way I can use the remote to control the strip or the Spark.
Can I accomplish this just by using the IR library? I know IR is supposed to be PWM converted to IR light, is this correct?
Would I only wire up the spark to the ground reference and data pin, leaving the power pin from the dimmer module alone?

Thanks!

I am looking to do something similar, although I don’t need to retransmit IR light. I wasn’t finding a Spark port of the Arduino IR Library, so I might look into how hard that is to port over to Spark.

I already have a Arduino based version working, I just want to take advantage of the wifi connectivity. My existing project is here if you are interested.

I will let you know if I have any success with receiving IR codes, but in case I forget I will update the post above on the SmartThings forum. I use the TSOP4838 receiver. If I can’t get the Spark directly receiving IR codes, I might have an ATTiny85 interpret them and pass them on via serial.

@dome, it looks like you have found my alter ego. Welcome to the spark forum! I think the smartthings/spark integration could be very powerful

Give this guide/library a try
http://www.blackcj.com/blog/2014/08/10/control-an-ir-device-with-a-spark-core/

-docwisdom

Thanks @scsc_tech , and good to see you over here.

Unfortunately, that library only contains the IR Transmit functions, not the IR Receive ones that I am looking for. I’m either going to have to figure out how to port the rest of the library, or I’ll need to use one of the Tinys for a workaround.

I’ll be following your progress on this. I am considering use the Spark Core to control my AC units. I found the IR sending but nothing yet for receiving. I could get a small IR TX/RX board but that just adds cost and complexity where I am sure the Spark Core can handle both transmit and receive. I did have this working with an Atmel AVR many tears ago using the timers to capture the edges and also used the timers to generate the 38Khz for transmit. I’d need to start again with this for the Spark Core as all of the time stuff is different.

1 Like

@scsc_tech, I am looking at the Arduino IR-Remote library which includes both receive and transmit functions. I may be possible to port using two hardware timers. One to control a PWM output at a chosen frequency for transmitting and the other (using SparkIntervalTimer) to provide a sampling timer for receiving. Stay tuned. :smile:

4 Likes

@peekay123 I would be most grateful if you were able to get it working. The more I look at the libraries, the more I think it’s over my head. :smile:

For anyone looking to port an Arduino IR library to the spark, you may find it better to use the IRLib, which is a more recent re-write of IRremote.

Why?
It is supported by the Author.
Very good documentation
Designed to be much more flexible & configurable etc. (= easier to port)

5 Likes