MIDI controlled light bulb fixture using vintage style "edison" light bulbs.

The control box serves a few purposes, but mainly allows you to change modes:

  • CLASSIC - MIDI notes are mapped to bulbs Cn-Bn mapped to bulbs 1-12, intensity of bulbs is fully on, sustain pedal holds notes of same time, clears all bulbs when released.
  • VELOCITY - same as Classic, but intensity of bulb is controlled by the velocity of the note played.
  • SCROLLING (shown in video) - in this mode, bulbs are lit up sequentially as more notes are played, with intensity of the bulb based on velocity of the note. Releasing the sustain pedal clears the bulbs.
  • AUTOMATIC - Slow moving algorithm that creates a changing visual display in random patterns.

I divided the steps up into three parts :

  1. Hardware (1-3) - Light bulbs, sockets, mounting, etc.
  2. Electronics (4-7) - Explanation of circuitry, how to control light bulb intensity (dimming), midi communication
  3. Software (8-10) - Details into the Arduino firmware, using timers, interrupts and PWM to control the light bulb intensity.

Step 1: Hardware : Light Bulbs and Sockets


I chose to use the smaller socket light bulbs (candelabra base, E12 socket) mostly because I had a bunch laying around from another project. However, the smaller base is less of an eye sore in my opinion, and typically is much cheaper than the standard E-26 base light bulb socket (standard light bulb size). I was able to get these sockets on ebay for about 50 cents a piece, which is a lot cheaper than paying $3-4 for a standard light bulb socket.

When soldering the wires to the sockets, you'll notice the solder joint is covered by shrink tubing. That's very important, especially for the live side of the wire so that you can't accidentally shock yourself when it's plugged in. The shrink tubing also provides some mechanical support so that not all of the weight is on the solder joint. I'll talk about it more in the electrical section, but it's very important that the neutral wires are soldered to the outer shell of the socket, not the other way around. This makes it significantly safer for people to be around, in the case that you used exposed metal sockets like I have. The safest solution would be to use insulated sockets, although they will likely be bulkier and more expensive.

Light Bulbs:

The light bulbs come from 1000bulbs.com , although, edison bulbs can be obtained other places as well, including home depot. The important thing is to get a bulb with low wattage. You don't want 12 60 watt bulbs lighting up in your face, even at 25 watts, it can be a little strong sometimes. In addition, the lower wattage makes the electronics and wiring easier because of the lower current requirement.

<p>Would it be possible to use this with a microphone rather than mapped to specific piano? </p>
<p>Felt Like I was In heaven. Beautiful I enjoyed It A lot.</p><p>I'll Also Make This. But I dont Have A midi Piano I have A keyboard ROLAND JUNO-GI Don't Know Weather Itll Work With That Or Not.</p><p>But What You Made Is really Ossum </p>
<p>Awesome Instructable and awesome piano playing!! What is the name of the first tune in your video please?</p>
<p>Thanks! It's called Consolation No.3 by Liszt, but it's just a shortened section of it, the full piece is much better. I didn't really plan out what I was going to play for the video, was a little pressed for time, but glad you liked it!</p>
<p>Very nicely done!</p><p>For the plain English explanation (the oscilloscope explained it fine for me, but not everyone gets those):</p><p>The Triac will only shut down when the power going through it drops below a certain level. Using a Triac to control an A/C source means that it won't shut off until the A/C progresses past zero volts in its normal course. What capricorn1 has done is invert the timing of the PWM so that it doesn't turn ON the A/C source until enough time has gone by, then the rest of the wave goes to zero, the Triac can switch off, and the PWM counter resets. Unlike most PWM systems that follow a basic ON then OFF pattern, the inversion makes it an OFF then ON pattern that is compatible with the Triac and the A/C source.</p><p>Just in case anyone missed the Inverted PWM signal point.</p>
<p>Thanks Alderin! </p><p>I tried to get that across by talking about the PWM polarity, but your explanation is probably better, and the more the better! The real key with this technique is to make sure that the &quot;OFF&quot; happens just before the next zero-cross, so the period of the PWM has to match half the AC period, minus a little bit of time to be safe, and then also, like you mentioned, has to be inverted. Thanks again!</p>
In fact, technically, you don't strictly have to keep the PWM on after the Triac engages, it could be just an enabling pulse. The Triac will remain on regardless of the PWM signal after that, with the possible minor exception of a little bit of the tail end of the drop to zero below the Triac's hold power level.<br><br>Not sure if this fact can be used to improve anything, but it is an interesting thought.<br><br>Thanks for posting your project!
<p>I'm glad you brought that up! I wasn't going to go into that detail, didn't think anyone would care, but what you're describing is the way I originally wrote my code. It wasn't until later that I realized I could use the hardware PWM instead. The problem with sending the enabling pulse, is you still have to keep track of the counter to know when to turn it on, for 12 light bulbs, which requires a ton of overhead code. And the best I could was about 16 steps in between cycles, so 4 bit resolution. (still plenty to be honest for a light bulb). However, by using the hardware PWM, changing the intensity is as simple as writing a byte to the OCRn register, then no more code is necessary, and you get almost 7 bits of resolution! So it's a win-win, even though you're right, the signal doesn't need to be in the form of a full duty cycle, it just makes the code simpler, lighter, and faster. Thanks again!</p>
<p>This is incredible!</p>
<p>Amazing! I'd like to make and give it to my friend playing keyboard =) </p><p>(And your piano is nice too!)</p>
<p>Wow, this is amazing! Beautiful work!!</p>
It's very impress :x
<p>Totally amazing! Every piano needs this! :)</p>
<p>can i use a arduino duemilanove..the wiring is a bit confusing..can you have a pict of what goes where altogether..does it work on any piano..thanks.. </p>
<p>the wiring is defined in the arduino sketch if you're interested, but it's only important if you're using the mega. If you were to use an Uno, or duemilanove, you could choose any 12 output pins (other than you're RX) which will be needed for the MIDI connection, and the external interrupt pin for zero-cross detection. That leaves you with no other pins! Then you'll have to use software PWM on those pins with a similarly modified timing algorithm to synchronize with the AC line. So it's kind of maxing out the capabilities of the Atmega328 chips, but it can be done.</p><p>As for the piano, you can use any ELECTRIC piano that has MIDI OUT.</p><p>Alternatively, if you just want to turn the light bulbs on and off without the intensity control, it's easy to do this on a deumilanove or uno.</p>
<p>Seriously, this is fantastic. Beautiful work.</p>
<p>That is very nice looking.</p>
<p>This is so awesome! Totally trying this project this summer, thanks for sharing!</p>
<p>This is absolutely stunning - very nice work! :D</p>

About This Instructable




More by capricorn1:MIDI Piano Lighting Antique Light Bulb Organ - MIDI/OSC Controlled 
Add instructable to: