RFID-enabled RGB LED lamp – Part 2

Posted on March 5, 2010 in Hardware

Parts have been (mostly) acquired and building has begun. Everything is coming together beautifully, its really cool to see this stuff in action. I will probably post more information about the hardware I’m putting together but for now I’ll just give a general outline and talk about the software.

Basically the lamp will consist of three separate modules; a base (containing an Arduino Duemilanove and a 3W RGB LED with necessary driver electronics), an RFID reader module (containing a Parallax RFID reader) and a programming module (containing three slide pots).

The software will continuously run in either one of two modes; normal mode or programming mode. The way it determines which mode to run is by checking to see if a certain pin is HIGH, which will only be HIGH when the programming module is attached.

Normal Mode: RFID reader is polled for input until a tag is passed. Once a tag is passed it will be validated against an on-board array of hard-coded tags; if its valid then a color value should also be associated with it which the Arduino will adjust the RGB LED to.

Programming Mode: RFID reader is polled until a tag is passed. Once a tag is passed it is validated against an on-board array of tag values; if it is valid then the Arduino will wait until the user pushes the Set button on the programming module, at which time the current values of the three slide pots are read and saved (corresponding to R, G and B values for the LED). By this process a saved color value for a tag can be updated or ‘programmed’ dynamically.

For now feel free to download the source code for this project below and mess around. I have used the SoftwareSerial class to implement serial communication with the Parallax RFID reader (thanks Photo-Worx @ Arduino forums for the suggestion) to avoid having to disconnect and reconnect the RX and TX lines on the Arduino during program uploading. I think the code is pretty solid at the moment but there are a couple of things I want to implement before the semester is through, most importantly saving and loading the color data to / from the flash memory of the Arduino using the PROGMEM keyword modifier.

I will have at least one more post on this project as I get the final parts in for the RGB LED driver section and also maybe a final write up of the project.

Download RFID RGB LED source code [Zipped Arduino sketch]