About 2 years ago I found these amazing little computers. I saw the IO pins and thought how cool is that that I now have a real computer that I can interact directly with the world around me. At the same time I was beginning to get into stage tech (sound and lights), which I still love. and I thought to myself: how crazy would it be if i could control these lights with a Raspberry Pi, really crazy.

Well I fell short of that exact goal but rather took it into a different direction. I thought about my favorite holiday, Christmas, and it hit me that I could make a Christmas lights display that would be "choreographed" and well that's when I began to research and put together what you will see here.

There Is A Lot Of Reading But It Is All Important.

Please read everything so that you don't run into problems and even if you do you wont sound silly when you ask for help.

This Project Uses Electricity

Remember that electricity is dangerous and... (the usual disclaimer nonsense that no one reads).

Step 1: Bringing Together The Pieces

This step can be a little tricky as there are so many ways to do this project; mainly the electrical wiring for the control box.

Essentials to the project

  1. Raspberry Pi (as though I needed to say it
  2. Breakout Ribbon Cable (I suppose not essential unless you enjoy being sane!)
  3. Jumper Cables (both male-to-male and male-to-female)
  4. Prototyping Board
  5. Resistors
  6. Transistors
  7. Sainsmart 16 Channel Relay Board

This list does not include the items needed to make the electrical box that the lights plug into. Mainly because there are so many ways to make it. although I will put pictures and explanations of how it needs to be done.

<p>Could you please explain the software a little more? What do I export the sequence from vixen as? .fseq? .tim? I have edited the main.py file to reflect my file locations but it locks up and I have to reboot as soon as I run it.</p>
<p>Edit: I figured it out. I didn't have the controllers in Vixen set up right. You must set it up as a generic output.</p>
<p>I'm so glad you figured it out. If you have any other questions just ask me.</p><p>I do have to be honest. I recently had to re setup my RPi and I did not realize how tricky the Vixen part of this could be.</p><p>Also some of my gpio pins are, I think, broken and that threw me for quite a loop. So i think an update is in order with a shift register instead of direct access to the gpio ports. This will also mediate the problem with the transistor nastiness. So be on the look out for that.</p><p>I'm also working on something for the iot contest that is shaping up to be challenging and will also have relays, sensors, and the like.</p>
<p>I actually have two more questions. What is the transistor bank for? I am using solid state relays plugged directly into my pi so the fact that they are SSRs could be why I don't need the transistor bank. How many relays are you able to trigger simultaneously? I can only trigger 4 at a time and then when I try to trigger the fifth one they all go out.</p>
<p style="margin-left: 20.0px;">Sorry for the late response... hope I didn't ruin your display with my timing.</p><p style="margin-left: 20.0px;">So the transistor bank is for that kind of problem. The Pi can only sink so much current and each of the SSR sends current to the Pi when you turn it &quot;ON&quot; and the Pi is being over driven. So the idea is to add a layer of isolation/protection from the Pi. Another option, instead of transistors, would be opto gates or a shift register would be even better, though the code would need to be rewritten a bit, as it would take up only 3-4 pins to use it.</p><p style="margin-left: 20.0px;">In essence your pi is being shorted out when you try to turn too many of them on at once and so the operating system fails and all that fun stuff.</p>
<p>That make sense. Thanks for the reply. No worries on the display; I actually made it just for my christmas tree so I do not need too many strands on at once. I just made my vixen files have a maximum of 4 strands on at a time.</p>
Go check out step 7. I am working on being able to use just the vixen filess, but that works for now. I'd love to see some pics of what you are working on.
<p>Could you please put a schematic for the transistor bank?</p>
<p>Yep it's now up in step 3. Enjoy!</p>
<p>Great writeup, thanks for sharing.</p><p>As another software alternative, have you checked out lightshowpi.org? It's great for synchronizing lights to music with a hardware setup like yours.</p>
<p>That is a neat piece of software. I like that it takes in midi files and I also don't: that could be awesome for live performances and save me a lot of time programming songs, but it would also require me to write or try and/or find midi files and be kind of at the mercy of pitch assignments instead of making the display do whatever I want. Pros and cons but thanks for showing me this I might use it for a live performance sometime.</p>
<p>This is a very nice 'ible. I think I might do this one year...</p><p>just a quick question though, I read through the instructable (rather fast) I did not see where/how the Pi was wired in.</p>
<p>Step 6 second paragraph from the bottom it is attached through the transistors to the relay board. Do you think I should have a page just fro connecting the Pi to the rest?</p>
<p>This would be great, along with some pictures. This way we could replicate your work.</p>
<p>Getting pictures of this is really hard to do and would not make much sense. if you will use the BMC I/O pin map to find the first I/O pin, on B+ RPi its pin 3 (its index strangely, and connect this with the pin connected to the first relay on the header of the Sainsmart board. I know this is frustrating to not have pics but they would confuse you even more I promise you.</p>
<p>Just saw your google doc below. that worked for me. thanks.<br><br>For those who might not see it in the comment thread.<br>https://docs.google.com/file/d/0B5-HND9HJkXWSTQtYlFTZ3VyODA/edit</p>
<p>The only problem I can see is the use of relays. They aren't going to last very long in this application (mechanical wear). I would probably have looked for a solid state relay option.</p>
<p>That was a concern of mine when I first put it together. But this display has run for months, non-stop, and still works perfect. The solid state relay would be a better option for several reasons: 1. lifetime, as you pointed out 2. if they were attached to some pwm pins we could now do dimming of the channels, very fun.</p>
I didn't even think about the dimming capability. Cool idea for some fading.
<p>OMG use opto couplers for controller to transistor. One power surge and poof no more anything</p>
<p>Could you identify the make and model of the terminal strip used?</p>
<p>these are just DIN rail terminal blocks and really, smaller ones would do, we are not passing much current through them. but some thing like this (http://www.mouser.com/ProductDetail/Phoenix-Contact/3212064/?qs=sGAEpiMZZMvNM%2fd3q5fCV%252bc01oLearQtVUVBHzw6%252b%252bc%3d) is comparable to what I have used.</p>
Seeing instructable really gets me thinking about make a lighting board to pair (just ditch the S2L because the LD in me just hates it) with this mini &quot;universe&quot; I would like know about the dimming capabilities of this project. Or would it require something with a bit more pwm pins?
<p>you could make a &quot;lighting board&quot; out of it. they would have to be switches, 'on' 'off', no faders on this type of circuit. This is a limitation not only with the pwm switches but the mechanical relays. So if you were to use solid state realys and map them to pwm pins and write some interpreter code for a number to pwm on the pi, probably already exists, then there would be full dimming capabilities. And yes, a lighting board would be really cool to use with this project so attaching DMX would also be needed.</p>
<p>Vixen appears to be only for a Window machine. Do you need both a Windows machine to run Vixen and then your RasPi? If Yes, how do they communicate?</p><p>Thanks!</p>
<p>The design of the display happens in vixen it then has an output text file that is run through the parsing file. The output of the parsing program is then put on the Pi. The vixen instructions are step 7 and the file structure info is in step 6.</p>
<p>Great!! I built this exact same setup a couple of years ago, first with Arduino and then last year with Raspberry Pi.</p><p>Here's the (admittedly ugly) code I used to do song sequencing and drive my &quot;light channels&quot;. https://github.com/nod/griswald</p>
<p>Looks Col, a cheap salution to controlling lights! But there is one thing that I thought of, here is littel peices of metal on each side of an outlet that if you brake off you can use each socket sepretley and that way you would need only 1/2 the outlets</p>
<p>That is definitely an option but it can be handy to have 2 outlets per circuit.</p>
I'm on the same page as pbhoud. I think elaborating on section 3/8 is important. Is there any way you could include some images of the pi and the wiring as you described? Aside from that, this is one of the nicest light/music instructables I've seen. Thank you!
<p>This will give you a good idea of how the transistors are wired between the Pi and the relay board. The relay board in this picture is 5v instead of 12v, so just ignore the voltage references.<br><br>https://docs.google.com/file/d/0B5-HND9HJkXWSTQtYlFTZ3VyODA/edit</p>
<p>That's an interesting way to do it. I'm not quite sure what TP1 and TP2 are but I used an extra power brick to power the Sain Smart board. I did post pictures of the transistor bank (step 3). I know they are not quite in focus and I can take more if you would like me to.</p>
<p>Look at the comment I left pbhound</p>

About This Instructable




More by Jboth:ESP8266 for Beginners RPi Christmas Lights My Dream Room 
Add instructable to: