The original BlinkM was the first in a series of I2C controlled RGB LEDs from ThingM. It’s easy to integrate into projects and control with anything that supports I2C. At its base level it is an ATtiny45 and a Piranha RGB LED. For anyone who wants a simple, elegantly packaged component I would highly recommend that you buy one of these. I am more of a do it yourselfer so I decided to build my own out of parts I had laying around.
Here are materials I used in my project:
- ATtiny chip (I’ll be using the ATtiny85 but an ATtiny45 will work too)
- RGB LED with a Common Cathode
- 3 resistors
- Jumper cables
This project is very tolerant to variation and you can really do it however you see fit. If you don’t have an RGB LED and want to use individual LEDs that will work. If you have a common anode LED instead of a common cathode LED you will need to use a different firmware package but it’ll work as well. The point is to have fun and learn.
The firmware for the BlinkM is currently closed source. The reason for this is that the patent for controlling RGB LEDs over I2C is owned by Phillips/NXP. ThingM has licensed these patents to produce their line of BlinkM products. You’ll notice that the license for the BlinkM firmware states that it is for personal use only, not for internal business purposes or for commercial gain. Keep this in mind if you would like to produce a product using this technology.
Because this is closed source it led to the development of an open source alternative: CyzRgb. This firmware is fairly similar to the BlinkM firmware with some additions (like a logarithmic curve for more accurate colors) and some subtractions (it only has 1 script as opposed to the 18 BlinkM has). Some people have noted it’s buggier but if you want to make something that is physically different from the BlinkM (like using a common Anode LED) you will need to use it.
ThingM offers a simple way to upload the firmware through which is called the ReflashBlinkM. This program can be used with the ArduinoISP and can be used to load raw ATtiny chips with their firmware. To do this you’ll need to setup the Arduino ISP wiring as described in the Run Arduino Code on an ATtiny article. Once it’s all connected then start the ReflashBlinkM program:
- Select the BlinkM firmware to use (if you are using CyzRgb, select custom and pick the .HEX file from their binary zip file)
- Click ArduinoISP on Arduino
- Select the port your Arduino is currently on
- Click Reflash
It will show the progress in the text at the bottom. When it says “Reflashing Done!” you now are ready to use your ATTiny as a BlinkM.
NOTE: This worked for me when using my UNO but not with my Leonardo.
Now that you have an ATtiny programed with the BlinkM (or CyzRgb) firmware it’s time to build the rest of the circuit around it. It’s important to make sure the correct colors are attached to each pin. This circuit can run on 5v or 3.3v.
Now that it’s all hooked up it’s time to test it out. When you first power up a newly flashed BlinkM it will run a default script which flashes through white, red, green, blue and off then starts again.
ThingM offers a package of example code which includes a handful of sketches for controlling it with Arduino. I found it easier to just extract the whole zip file to my Arduino Sketch folder. The all-in-one sketch for controlling everything the BlinkM does is BlinkMTester. With it you can use the serial monitor in ArduinoIDE to view a menu of options. If you are using ArduinoIDE 1.0.2 this will not work, it functions properly on version 1.0.3. If you are using a Leonardo you need to send “?” to get the menu to show up.
This is an easy component to work with on its own or to integrate into existing products. I created mine as an exploration of the product but I foresee it having functionality in future projects where a diagnostic light is needed. In addition, since it works over I2C it’s compatible with a variety of development boards including the Raspberry Pi.