Skip to main content

Arduino LED MIDI Controller

It's been a while since I've made a post so I have decided that it was about time I did. This time I'll be talking about my Haunted House I made.

I started with the idea to take a Halloween decoration (small haunted house) and add some LEDs to it and make them blink. What I ended up with was a haunted house with 6 LEDs in it all controlled by MIDI. I used an Arduino to receive MIDI signals from my computer and turn on/off LED lights based on those signals.

Check out the video...

The "MIDI to Arduino Breakout Board" as I call it in the video I designed myself. I used various resources on MIDI around the web and came up with this schematic.

Digikey Part list:

2 x DIN5 - CP-2350-ND
2 x 6N138 - 516-1600-5-ND
1 x diode - 1N914B-ND
2 x 220 ohm resistor
1 x 270 ohm resistor

As you can see it isn't very complicated. The hardest part was finding in DIN5 part numbers at Digikey. The code on the other hand was a bit more complicated. The trick was to decode the MIDI signals without any real debugging tools. The RX/TX ports on the Arduino are being used by the MIDI ports. I had to use blinky LED lights to do the debugging. After fumbling around with it for a while I was able to get it working. The code should easily be expendable to allow for more LED lights. I chose to use the PWM pins on the Arduino so I could adjust the brightness of the LEDs.

I tried to comment the code the best I could. Download it here. Keep in mind that you must disconnect the MIDI breakout board before you program your Arduino or it wont work.

Side Node:

Unfortunately MIDI is meant for instruments and not lights so I wasn't able to really do what I wanted to do. As a future project I would like to implement MIDI show control to allow for more light specific functions. I still have to find a freeware program that supports MIDI show control. I'll keep you posted.


Wayne said…
I've updated the video link to work again and also moved the code to GitHub in case anyone wants to improve it.
EnomYs said…
Hi, works fine but i have a problem. When I play single note from a midi keyboard the LEDS blink in the right way, but when a play a sequence from Logic Pro 9, the LEDS blink random with the same notes I played before on the keyboard. I tried to remove midi filter on Logic but the same... How can I do?
Wayne said…
Good question. I never had that issue when I had set it up. It could be that logic is sending some sort of MIDI command that isn't recognized by the code and causing some odd behavior. I'd been a while since I've looked at this but you could try to connect to the Arduino via a terminal and modify the code to output all the MIDI commands it is receiving.
StayStayLetGo said…
Is there an updated video link?
Wayne said…
Something must have changed. I have updated the link to the video.
StayStayLetGo said…
Thanks for the quick response. I'm having issues understanding what pins my midi signal in is effecting on the OUT side of things. That is to say, I see the board receiving midi, but my LED isn't firing. Any suggestions?
Wayne said…
In the schematic the RX would be MIDI IN, the TX pin would be MIDI OUT.

In the Demo I used a USB to MIDI converter in which I had the MIDI IN plugged into the port labeled MIDI OUT on the DX7 keyboard. The MIDI OUT from the USB to MIDI converter went into the MIDI IN (RX pin) on my MIDI breakout board. The USB end of course was plugged into my laptop. I used Logic Express to record the MIDI signals from the DX7 and play them back to the arduino through the MIDI breakout board. I suppose I should produce a wiring diagram which would simplify the whole thing.
StayStayLetGo said…
Ahh gotcha. See I had used portions of your code some years ago to just nail down the MIDI IN but it was for a direct action of C3 turning a single LED on. In reality it was just triggering a relay which was effectively "stomping" a guitar pedal. But now I can't figure out which pins I was triggering by looking at the code. Or I'm seeing it an just not understanding what I'm seeing. Whomp Whomp.

For context:
The original project mysteriously vanished when I renovated my house last month so now I'm scrambling to put it back together.
Wayne said…
Wow that's an awesome idea. I never thought of using it to control stomp boxes and the like. Seems like a perfect use case for this. You'll just need to figure out which Arduino PIN you want to use for C3. Based on my code it looks like it might be PIN 11 on the arduino but you can configure that here:

The first element in that array should be 'C'.
Wayne said…
Just thinking about some other cool things you could do... you could re-wire your stomp boxes and use digital POTs to control volume/gain/whatever using MIDI. Just throwing an idea out there..

Popular posts from this blog

Ardunio and the SHT15

For my ongoing thermostat project I require some sort of temperature and humidity sensor. Because I'm fairly new to all this I decided to get a 2 in 1 sensor from Robotshop called the SHT15. I went with the SHT15 because it had both a temperature and humidity sensor and uses a "digital 2-wire" interface. When I first purchased it I didn't realize that "digital 2-wire" didn't mean I2C, but that's another story.

In order to get the sensor to communicate with the Arduino I needed to write some custom code that manipulates the data and clock lines by pulling them high and low at the correct times. I haven't had any experience doing this before so it was a learning experience for me.

Connecting the SHT15 to the Arduino is pretty simple. The data and sck lines each goto a digital input/output on the Arduino and the VCC goes to +5V. Pretty simple. Here is a picture of my breadboard.

As you can see I had to solder on some breadboard wires onto th…

Thermostat project

It's that time of year again. Winter has hit full force here. I've been on an Arduino kick lately and came up with an idea for a project to battle the cold weather. A thermostat connected to your home network!! Why would you want to do that you ask? The answer is simple, I want to be able to control the temperature of my house from anywhere! If security is a concern then you could limit control to your local network (but that's another discussion).

First you would start with a gumstix connex 200xm along with a rs232 expansion board and an ethernet expansion board with a microSD interface for more storage. You could also go WiFi if you so desire. You will also need a temperature and humidity sensor with a serial interface.

The software system would be as simple as running a LAMP (Linux, Apache, Mysql, PHP) server. Of course I would have to develop some software to get the temperature readings from from the sensors and for controlling the furnace. …