Jump to content

MIDI Light controller

Recommended Posts

I have been thinking about this project for quite some time now and finally I have all my requirements in place.

There are 3 modules that make up the controller: main module (serial input, MCU, power supply, zero crossing detector, and configuration switches,) serial 8 channel power module (595, power-on reset, opto-isolators, snubbers, triacs,) parallel 4 channel power module (like serial but less 595 and POR.)

The MCU of my choice is 2553 (RAM, number of ports, easy UART.)

Initially, I wanted to use RS232 as a serial interface, but then after NatureTM published his MIDI synth, I have realized that MIDI will be the best choice to control the lights (never thought I will go back to MIDI, thanks NatureTM.)

Why MIDI? I figured since most likely lights will be synchronized with the music, why not to use a sequencer to control lights and create music. Each light will be mapped to a note and velocity will control brightness (PWM.)


My schematics and boards are not final yet, still have few decisions to make and I have to convert them from ExpressPCB.

However, here are some details.

1. Main board. Power supply will not be too fancy, simple transformer, bridge, linear regulator, and few caps. Zero crossing detector will use a bridge, resistor, and 6N138. MIDI interface will also use 6N138. There will be few switches connected, 4 of them to set MIDI channel to listen on. There will be 9 outputs, 1 2-wire serial output and 8 individual outputs.

2. Serial board. 74hc595 will be used as shift register, allowing easy daisy chaining of serial modules. I am planning for up to 4 serial boards, but up to 15 can be used. POR will make sure all lights are off on power up. Opto-isolator circuit is designed to be flexible enough to use the couplers with zero crossing detectors and the ones without and includes various configurations of snubbers.

3. Parallel board. Same as serial but w/o 595 or POR.


To be continued...



Link to post
Share on other sites
  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Yes, those were made by Seeed. $24.90 for 10 boards 10cm x 10cm, 1.6mm, registered Air Parcel $8.10, total: $33.00 Shipping prices went up, shipping for 5cm x 5cm boards is now $4.10. Also, they d

After redesigning my board over and over, I have finally settled on the final version. It has 16 channels, uses 28pin 2553, has zero-crossing detector, MIDI, audio spectrum analyzer chip, and a confi

Here's my first light show. Sorry to disappoint you guys, but a) I do not own any Star Wars media, I am so busy at work and with the kids I hardly have any time for my hobbies. I know "It's No Good

Posted Images

You're welcome! I bet using a midi GUI on a computer to create patterns is going to make your life a lot easier. In addition to just programming "notes," it will be really easy to send things like curves and LFO's to your controller using some decent midi software.


Your hardware design seems very expandable. What is the zero crossing detector used for?

Link to post
Share on other sites

Here are the power boards.


WARNING! If you are not comfortable working with electricity, this project is not for you. You will be working with high voltage and you may get injured.


Both are meant to be used in close proximity to the main board (more on that later.)

Since those boards will be used with lights (resistive loads) and because of the triacs I am using, there are no snubbers or gate resistors included.

Lights are connected to the hot side of the triac (Xx-1 output,) Xx-2 output is connected to neutral.

One thing to note is that I am using MOC3023 opto-isolators which are random-phase, but in the diagram they have zero-crossing circuit, courtesy of Eagle library.


The 4 channel parallel board is pretty straight forward, it does not require any power and it is connected to the main board with 5 wires.

The 8 channel serial board requires power from the main board (or it's own power, but more on that later.) It has 2 connectors, in and out, allowing it to be daisy chained. Connector has 5 pins, Vcc, data in/out, clock, lock, GND. C1, D1, and R25 provide simple POR functionality.

If the distance between the main board and the serial board is more than 10ft, then I would suggest using dedicated power supply per board and current loop connection between boards, same way MIDI devices are connected (buffered output and opto-coupled input, 6N138 is a good choice.) This way the distance can be increased to about 50ft. And don't forget to use twisted pair cables :)




Link to post
Share on other sites

I'm looking forward to seeing a video of this working. Sounds very cool.


Concerning the light bulbs, will you be using incandescent or CFL's?

CFL's may give you a hassle.


But please tell me that you won't be building this on a bread board.

Link to post
Share on other sites

MIDI part is mostly ready.

The video below shows how lights will be controlled using notes on the track. Velocity will be used to control brightness.





Now on to zero crossing detector...

@zeke, what's wrong with bread boards? That's how you catch your design mistakes. I think I will use proto boards for now and then to PCBs once I am done with the design.

Link to post
Share on other sites

Design and code are 95% done, the only thing left is zero crossing detector and channel selection switches.

Well, I will need to do boards too, but that's not a big deal.

Some values in the code will need to be tweaked because of the zero crossing detector.

@SouLSLayeR, you were complaining that my ADC code was poorly commented, I made sure this one is full of comments :D


Here are two videos of how it is working so far with parallel outputs. No triacs, just LEDs, but hopefully you can see brightness changes (that's why I am slamming on the keyboard so hard :) )

You can also use controllers instead of notes, just like in the second video near the end.

Any comments? Suggestions?


Link to post
Share on other sites

I will try to draw up a circuit -


But you can use a bridge rectifier and a opto coupler to get your timing for firing the TRIAC to control the voltage to the lights.


The Bridge will create two pulses from one cycle giving you a reference for firing the TRIAC at the up and down phase of the cycle.


The Opto coupler could be read from the ADC on a port, but not sure it would be fast enough. Or use a schmitt trigger or comparator circuit to trigger the start of the timing count inside the MSP. This one reference would be used for all of your TRIAC's.


From there just adjust timing to control brightness.


Not tried it but maybe PMW the TRIAC's would also work, given the filaments need time to go to full brightness.

Link to post
Share on other sites

I actually have few designs on the plate right now. Couple are with the bridge, resistor, optional RC filter, optional zener, and opto-coupler (6N138, chosen for it's low on current.) Couple are post transformer with transistors. The problem is choosing the one with the smallest pulse but also the smallest power usage. I wish germanium transistors were still available :)


I will not be using ADC, just port interrupt.

Link to post
Share on other sites
  • 3 weeks later...

Slowly but surely, I am very close to finishing this one.

Here's my zero crossing detector.




And here's how it is working hooked up to my LaunchPad. The pulse width is only ~70us, which is 0.84% of the half cycle, not too bad (those numbers might be little off since I am relying on my scope's scale.)



Link to post
Share on other sites
  • 2 weeks later...

Hardware is done! Smoke test passed.

The reason for this wire mess is because my "real" board didn't make it on time so I am using my proto boards here.

Now all it's left to do is to adopt my code to this unit, create some MIDI tracks, and ready to rock 'n roll.

Oh, did I mentioned that my MIDI track is from Star Wars?



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...