With the heartbeat sequence programmed, I could simply have connected the BlinkM to a 9v DC power source and had it run the heartbeat all the time. But I wanted more flexibility.
BlinkMs use the standard I2C serial protocol, which can control multiple devices with two data wires. Up to 127 BlinkMs can be controlled on a single connection (four wires – two power, two serial), which can be helpful for interactive art installations (or crazy complicated Christmas decorations).
I chose to control the BlinkM with an Arduino. I chose to connect them thusly (mostly because the sample Arduino sketch I started with used these connections):
- PWR – -> Gnd
- PWR + -> 5V
- I2C d / SDA -> Analog 4
- I2D c / SCK -> Analog 5
But how to connect the pins of the BlinkM controller to the Arudino’s headers? They don’t line up such that you can just plop the BlinkM on the Arduino. So you have to run jumpers. But we need to connect a pin to a female header, so we can’t just use a piece of wire. This is a problem that comes up when breadboarding as well, when you have a component that has leads that won’t fit in the breadboard holes well.
These are somehow cheaper than buying the connector housings, pins, and wire and making your own. And they come in different lengths.
(I ended up using all 10 of these jumper wires on the project, but more on that later.)
One of the BlinkM example sketches (BlinkMTester) was particularly handy for testing. It provides a serial interface where you can type commands into the Arduino and control the BlinkM. I took this sketch and added a command to the setup() function to start playing my heartbeat sequence as a default. But this default sequence can be stopped by the Arduino so that other behaviors can take place.
I didn’t get around to adding these other behaviors before Christmas. But I can update the Arudino at any point in the future. Using the Arduino, behaviors more complex than the 48 step sequences supported by the BlinkM itself can be implemented.
My original goal was to set up a Twitter account for the robot and use the TweetM code to look for @Mentions and decide what to do based on them. Unfortunately, in August, Twitter removed “Basic Authentication” which the TweetM code relied on. So I (or Todbot/ThingM) will have to figure out how to work with the new method.
After a period of inactivity on the Twitter account, I plan to have the robot go back to a default behavior (probably the heart beat sequence).
So, for now, this is bare minimum functionality, and there is more to come.
However, since the Arduino can receive commands for the BlinkM, it can, in theory, be remote controlled. More about that later.