Step 1: What you'll need
- The light source:
- The controller:
- LM741 Op-Amp
- Electret Microhone (3-lead)
- 2.2k resistor
- 100k resisor
- 200k resistor
- 0.47uf electrolytic capacitor
- 0.047uf ceramic capacitor
- 2x 10k resistors
For the 'tap' sensor, you will only need:
- Piezo element (you can salvage this from certain electronic toys, telephones, and many other electronic devices that beep, or you can get it from mouser, radioshack, etc.).
- 1M resistor
...And for the light sensor you'll need:
- CdS cell (LDR), preferably a very large one (more resolution).
- 10K resistor
- 3-pin header & crimped connector wires (optional)
Alternatively, you could use a homebrew development board to support the ATmega168 micro, and use a DIP-style ATmega168 (the long one with the larger leads). I'm not sure how well that would fit but it is certainly worth a try. If you don't own/have the money for a breadboard, you can solder down a regular ATmega168 to a PCB and add the regulator, programming connections, etc.
Step 2: Prep the 'touch light'
First, flip the light over and remove the battery cover and screws. Inside the battery compartment, you'll see the lightbulb fixture. Take it out, and discard it and the lightbulb.
Next, open the casing. Now we need to deal with the power. Remove the piece of metal in the center of the battery compartment as well as the wire that connects it to one of the battery contacts. Solder wires onto the battery contacts as shown. You may also want to label them if you don't have differently colored wire.
We also are going to make this mood light operable via a wall outlet transformer. Drill a hole using a drill bit about the same size as the diameter of the DC power jack. Then screw it in until it is flush with the casing.
The last modification we need to make here is to add the piezo tap sensor. It is best to mount it on the plastic 'rim' for better sensitivity. I have it pictured later in this instructable mounted elsewhere, but that's only because I have had to open and close the casing during testing so much that the wires started to break. Simply hot glue it to the plastic, but make sure it does not hinder the mechanical movement on the movabke dome! (i.e. do not let it stick out too much).
Step 3: Add power circuit protection
NOTE: If you don't make this circuit, you will NOT be able to keep the batteries in the battery compartment at the same time you have the mood light plugged in to the wall transformer, otherwise it will damage it.
Step 4: Add the breadboard, arduino, and BlinkM
Now glue down (I used hot glue) the breadboard on top of the battery compartment. Luckily for us, it happens to fit perfectly.
Now plug in the positive (+) and negative (-) wires from step 2 into one of the breadboard's positive and negative power strips.
Now we can connect the arduino and the blinkm together. Here's the pin connections:
- A5 - Clock (labeled 'c' on the BlinkM)
- A4 - Data (labeled 'd' on the BlinkM)
Step 5: The sensors - sound, tap, and light
The sound sensor is a little bit harder, but not ridiculously complex. PLEASE NOTE: I have not shown a voltage divider circuit here. The 2.5V in the schematic has to be provided via something called a 'voltage divider'. It is a very, very simple circuit consisting of multiple fixed resistors, or a pot (potentiometer). Use a 50K pot for this circuit. Google 'voltage divider' and look at the wikipedia entry for help on constructing one.
EDIT 9/27/08: I ditched this sound circuit and instead used one salvaged from a sound-activated light-up pendant. The circuit here doesn't work to well; I'm not sure why, but the design is flawed ;something is not quite right. I noticed the circuit from the pendant uses an SMD LM386 op-amp. I just soldered before the resistors going to the LEDs, VCC, and GND. Then all I had to do was manipulate the values in the software a little, and presto! better working sound-responsive mood light.
At the current time, the video of the light pulsating to music is when the original circuit was used. Maybe I'll upload another showing the improved design (it looks more like it's responding to the music due to the new circuit).
I was unsure how to solder the piezo element, so I guessed and soldered it as shown. It works, though. The polarity of the piezo does not matter. The resistor is on the breadboard (not shown).
Another IMPORTANT NOTE: The values for these circuits WILL differ from yours, so you WILL need to do some tweaking in the code. If you have any questions on these values, feel free to let me know.
Step 6: Find space for the sensors, and connect it all
All the connections are:
- Pin A6: Sound sensor - NOTE: for non arduino nano users, other arduino's don't have a 7th analog pin. You will have to change this in the code.
- Pin A3: Piezo sensor (tap sensor)
- Pin A0: Light sensor
Step 7: Test it
NOTE: I know that the picture doesn't show the light sensor; I just took it before I added that part.
Step 8: Program it, close it up, & use it
If you want to view the code but don't have the arduino software, you can open it with a word processing program (aka wordpad for windows users).
Ideas for new functions are welcome. Please feel free to post them; I want to make this open-source. The aim of the way I structured the code is so new functions can be added easily. Some of the functions are programmed into the BlinkM by the manufacturer (ThingM), but two of them I have made; 'Sound Light' and 'Mimic Light'. Right now it has the following:
- Mood Light - Slowly fades to random colors
- Candle - Flickers like a candle with oranges and yellows
- Water Reflections - 'Shimmers' with blues, turquoises, and cyan colors
- Seasonal Colors - Turns seasonal colors (I think they are blue, green, purple, and orange)
- Thunderstorm - Flashes occasionally simulating lightning
- Stop Light - Turns from red to yellow to green and back again
- Mimic Light - Records a sequence of up to 50 on/off cycles of light (you can use a flashlight), 'memorizes' the on/off times, and then plays them back in a never ending loop.
- Sound Light - Pulsates to the sound of music
Now comes the hard part. In order to close the mood light enclosure, you have to take a few careful steps.
First, you have to line up the support springs with the small tabs on the plastic dome. Since the DC power jack is on the rim, and the wires go to the breadboard , you have to slip the plastic dome over those wires FIRST, then line up the outer rim's screw columns with the indentations on the plastic dome. Make sure all the tabs line up with the placement of the support springs, which also correspond with the screw columns on the rim, and the srew holes on the base plate. Then, once you're sure everything lines up, snap the outer rim down onto the base plate. Next, make sure no wires are stuck in the springs, or are in a place where they may in the future. This would hinder the movement of the plastic dome. Lastly, replace the screws and enjoy!
Final notes: IMPORTANT: do NOT use batteries and plug in the wall adapter at the same time. I'm not sure what will happen but I'm sure it will destroy everything connected to the power!!
Step 9: EXTRAS
This is of the 6 pre-programmed functions built into the BlinkM:
...This one is the custom sound/music responsive code I added (can you guess what song it is...?:
...And finally, but definitely not least, is the coolest (I think), and hardest function to make of them all; the 'mimic light' function: