What through yonder window…


My LED light arrived in short order from Amazon.  Overall, I was pleased.  It is fairly sturdily constructed, has a plug on the end of the (very short) cord, and came with an IR remote.  It appears to be a small die with 9 LEDs embedded in it, 3 each of red, green and blue.

photo 2 (3) photo 1 (3)
It’s also quite bright for just 10W, and comes apart easily.   Opening it up reveals a fairly simple dual voltage circuit board consisting of 2 ICs (an EEPROM and an unidentified microcontroller), some large resistors, and transistors so that the Microcontroller could switch the 12V LEDs on and off.  There’s also an IR receiver wired into the MCU for the remote control.

photo 3 (2)
I
 gave some thought to cutting into the board and generating PWM pulses to control each color of the light.   It would give me fine control over it, but at the expense of code complexity that I’d rather avoid.  And I could damage the LEDs if I accidentally overheated them by using too high a duty cycle.  Never mind that it was an inefficient use of the Pi’s GPIO pins and computing cycles (since the Pi doesn’t have hardware support for generating PWM, it would have to be done manually – yuck!).

I was aware of a program called LIRC for encoding and decoding IR signals for Linux.  Sure enough, someone had already done the hard work of making IR transmitters and receivers work with the Pi’s GPIO pins.   What if I made the Pi emulate the IR receiver and sent IR commands to the light via a hard-wired connection?     I could leverage the hard work of others, and use only a single GPIO pin.

This seemed a better and better idea the more I thought about it.

So my next steps seemed to be:

  • Get LIRC working on the Pi with the light’s IR receiver.
  • Determine what codes were used by the supplied remote
  • Be able to send those codes to the light through software.

Simple, right?

 

Next: I see in infared.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s