Shop OBEX P1 Docs P2 Docs Learn Events
Christmas Lights!!!! — Parallax Forums

Christmas Lights!!!!

lboucherlboucher Posts: 139
edited 2010-12-23 18:49 in Robotics
Hi All

Thought i would share my christmas project with everyone. I have always wanted to copy those crazy uTube videos of christmas light to music. Well i finally looked into it and found that everyone is generally using Light O Rama. Which is cool, but cost dam near 800 bucks for 32 channels. So i thought i would build it all myself. So i grabbed my BS2 from my Boe Bot, bought 20 1AMP PC board relays off of ebay for 15 bucks, (Spent way to much for transistors, resistors, soldier, diodes·and pcb board from Radio Shack, (Hate that place.) and went to work. Took me about 3 weeks total so (Which is way to long, I made a few stupid mistakes since i don't do this stuff often, and used visual studio C++ for the first time.). Anyways, I made my own relay boards, threw together a very dirty housing for them with 16 outlets, put up all my lights, laid out alot of extension cord and wrote a gui in Visual C++ to controll the lights over serial. At first i tried just programming the BS2, quickly found that to be very limiting, not really surprising. Overall it is working out very well. I did rip off the actual sequences from other people. I was finding that actually writing the sequence manually was taking way way to long. I took a look at Light O Rama software and i must say, it is very nice for writing a sequence. Then i struck gold and found that their Version 2.0 software stores the files as xml. So from that i found a couple sights where people post there LOR files, downloaded some good ones for 16 channels and wrote a parser into my gui. Worked out great. The tricky part is assigning the channels in their sequence to the appropriate thing in my yard. I plan on having a total of 4 songs this year. I have 2 tuned out and working great so far, just a little bit more work and the other 2 will be done. Now i am waiting and hoping the FM transmitter i ordered off of Ebay from hong kong makes it here in time for christmas. That way people will be able to hear the music in their car.

It worked out that I seem to only be able to send the serial commands every 40 milliseconds reliably.
Which is ok I think.
The LOR stuff has twinkle and shimmer effects.
I think i can do that next year by using the pulsout command on the BS2 side of things.

A couple lessons learned, should have used bigger relays. 1 Amp isn't much and doesn't allow me to expand alot. I actually had to build a 17'th circuit because the porch lights were drawing to much current to go thru 1 relay.

I used mechanical relays, and there lifetime at full load is 100,000 cycles no load 5 million.
Running lights like this I do not expect them to last more than 2-3 years. confused.gif

Managed C++ appears to be a big pain in the butt.

Without LOR software i don't think i can easily expand my number off relays much without making things to complicated.

Never assume those transistors in that old parts draw are NPN because they are labeled as such.

My wife has been great, she has let me take alot of time to do this.

Here is the youtube link to my best song so far.
http://www.youtube.com/watch?v=6QhCEZxfU38
Will post more later.

Also here are a couple pics of the setup, will open up the housing and show the relay boards later.

And here is the BS2 code. (I know someone will ask for it.) Simple ehh.

And here is the C++ code and gui.
Please go easy on me when viewing the code.
I know there are some really bad things in there, but it does work and will slowly get cleaned up.
If anyone knows why "delete thread" or thread.Dispose() will not work please please let me know. (See comments in form1.h)
That confused me for a whole night. (I found a way around it, but it would be really nice to be able to kill a thread.)

Also if you have never heard of Holdman, google Holdman Family Christmas and watch his YouTube video.
That dude is amazing.

Post Edited (lboucher) : 12/6/2009 2:26:46 PM GMT
3296 x 2472 - 397K
3296 x 2472 - 410K
3296 x 2472 - 407K
3296 x 2472 - 397K
«1

Comments

  • abbtechabbtech Posts: 2
    edited 2008-12-19 06:09
    Great job,

    Looks like it works very well!
  • NetHogNetHog Posts: 104
    edited 2008-12-19 07:00
    Wow, normally I see people only use Managed C++ as a shim layer to C# / VB, rather than using it to write UI [noparse]:)[/noparse]

    Threads can die, but they should never be killed. Languages/environments that allow you to kill or suspend a thread find themselves dealing with "strange" deadlocks. This is why cancellation is cooperative.

    Analogy:
    "Kill Thread" is like ground control being able to switch off power on a 747. They might typically get it right and do it while the 747 is on the ground, but if they don't know what the 747 is doing, switching off power could cause the 747 to crash.

    "CancelAsync / CancellationPending" on the other hand is like ground control radioing the pilot of the 747 to turn off power. The Pilot could ignore it, but typically the Pilot would honor the request and turn off the engine when it's safe to do so.
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-12-19 10:01
    Great project! I like the youtube movie!
    What made you use C++ instead of going with a straight PBASIC menu driven code?
    humanoido
  • WhitWhit Posts: 4,191
    edited 2008-12-19 12:37
    Very nice project and a fantastic example of geek Christmas spirit! smilewinkgrin.gif

    Merry Christmas!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Cole LoganCole Logan Posts: 196
    edited 2008-12-19 14:12
    That is really cool I have been wanting to do something like this for a while too.
  • NetHogNetHog Posts: 104
    edited 2008-12-19 14:36
    I keep promising myself every year to do this [noparse]:)[/noparse]
  • lboucherlboucher Posts: 139
    edited 2008-12-19 16:03
    Not quite sure what you mean by "menu driven code".

    But i used C++ for several reason. Knowing more C++ will help me in my job, PBASIC would not.

    With a laptop and C++ and can define as many variables as i want. The BS2 can only store so much.

    Easily defined functions.

    Using a C++ gui i can kick off the music in windows media player at the same time the lights start. cannot do that with PBASIC

    ETC ETC...
    humanoido said...
    Great project! I like the youtube movie!
    What made you use C++ instead of going with a straight PBASIC menu driven code?
    humanoido
  • uxoriousuxorious Posts: 126
    edited 2008-12-19 22:07
    This is great. My wife and I were just discussing how my "box of Parallax stuff" could be used to animate Christmas lights. It's on our to-do list for next year. The light control is the cake part. The synchronization is where I am stumped. Thanks for all the info!

    PS I looked into the Light o Rama stuff too. It is expensive if you go for the complete kits. However, you can get the 16 channel deluxe high power unit in kit form for $159. That's why I am uncertain which way to go. I would love to see a Parallax based open source controller get off the ground...........

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ~~ dRu ~~

    Post Edited (dRudRudRu) : 12/19/2008 11:51:06 PM GMT
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-12-19 23:34
    NICE! Congrats on making the front of hackaday.com

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • Cole LoganCole Logan Posts: 196
    edited 2008-12-20 16:14
    Actually because of this post I'm now working on a prop based light sequencer that will play its own music.

    Thanks for the inspiration.
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-12-20 19:51
    Nice. I love doing things like this and helping others also do it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, uOLED-IOC, eProto for SunSPOT, BitScope
    www.tdswieter.com
  • lboucherlboucher Posts: 139
    edited 2008-12-21 03:22
    Wanted to show everyone the gui i use to control the lights.
    Still has a couple bugs, but it is generally working very well.

    Ohh and by the way. I have had my first relay failure, I was working quick to get it up and running and did not notice i had 1 relay running 1.5 amps. (They are only rated for 1.0 amps.) Tested my other strands and found the porch relay was also a bit over amps. So i will be fixing those up tomorrow or monday. Still hoping to get that FM transmitter. My sign with the radio station will be ready to go.

    Merry Christmas
    412 x 249 - 47K
  • bennettdanbennettdan Posts: 614
    edited 2008-12-21 06:23
    lboucher,
    ·· I like your project and I have been working on a simular project but work did not allow me to finish with the hardware design I have some software I wrote in VB2008 that you might like it controls 32 channels over a serial port.

    It saves its sequences in an xml fial also on your C: drive look for the name you created in the software and you can view the file directly and also edit it in notepad.

    Their might be some bugs in the software so let me know.

    All you have to do is have your stamp setup to recieve the serial data and when a channel is on the coresponding 1 is on in the string. Just seperate the string and use if then statement in your stamp code if you need help let me know.

    Also their is a free software called Vixen alot of people use check out their websight they have a plugin for using the Efx hardware parralax stocks at it allows dimming of each circuit. http://www.vixenlights.com/
    good luck

    Attached is the source code for my GUI IN VB2008.... anyone can use the free VB2008 express from Microsoft to veim and modifiy the code.
  • UghaUgha Posts: 543
    edited 2008-12-21 11:34
    Great project and great GUI!

    When you get some of the bugs worked out, do you intend to release the GUI?
  • bennettdanbennettdan Posts: 614
    edited 2008-12-22 03:11
    Ugha,

    ·· I if you are talking to me I might release it but am not sure I might start a sight and make it open source so others can help make it better.

    I did not mean to Highjack the thread and if anyone is more interested in the software I can start a new thread.

    I want to add dimming to the program on each channel next.
  • mazolamazola Posts: 2
    edited 2008-12-23 17:46
    I WANT TO DO THAT!!!! can you sho pictures of inside the boxes and maybe a set of instructions please!?!?!?!?!?
  • lboucherlboucher Posts: 139
    edited 2008-12-24 03:13
    Here is a picture inside. It is really ugly i know.
    Just scrounged it together from parts i had.

    I do not suggest anypne make anything to this low of a standard.

    Anyways here is a link on the circuit.
    http://www.kpsec.freeuk.com/trancirc.htm

    Merry Christmas

    Post Edited (lboucher) : 12/24/2008 4:15:34 AM GMT
    3296 x 2472 - 2M
  • andrewsweet4andrewsweet4 Posts: 1
    edited 2008-12-24 13:28
    Very, very, very nice project! WELL DONE! I have already made the relay board, but when i try to load your GUI, an error message pops up.sad.gif· And guess what! It does not load!cry.gif· Have you got any idea of what the problem is?confused.gif· Can you· PM·me the GUI again? please!smilewinkgrin.gif
  • mazolamazola Posts: 2
    edited 2008-12-24 18:07
    Damn thats a mess. are there pictures a noob like me could look at and know what to do next?

    arial view of the relay?
  • lboucherlboucher Posts: 139
    edited 2008-12-24 19:06
    This link should be enough to figure out the circuit.

    http://www.kpsec.freeuk.com/trancirc.htm

    As for the GUI not loading.
    I ran into that on a work computer also.

    My best suggestion is installing visual studio express 2008. Google it, it is free.
    Then build the project yourself.
    Probably something in the .Net framework not installed on you computer.
    Installing visual studio should fix that.

    You will also need to load up the BS2 with the Serial Communition Fast.bs2 file.
    Look in the zip file attached to my first post

    And you will need to put the attached XML's into the C:/ directory along with the approriate MP3's
    I will let you download those legally or illegally yourself.
    Look in the code for the specific names.
    Then you need to assign the pins to the appriote lights in your yard.

    I know my code is hard to read, i need to clean it up a bit.

    Its not going to be just plug and play, you will at least have to adjust the channel layout in the C++ code for the different songs.
  • lboucherlboucher Posts: 139
    edited 2008-12-24 19:11
    If anyone wants the full project directory just email me [url=mailto:lboucher@vt.edu.]lboucher@vt.edu.[/url]

    Then you can easilly open it up in visual studio express 2008.

    Also i have fixed several bugs since my first post, so you will want the latest code.

    Also this is hardcoded to use COM4, so a user would need to edit that.

    Lucas
  • lboucherlboucher Posts: 139
    edited 2008-12-26 05:17
    Added video of two more songs.

    My lights to Let It Snow
    http://www.youtube.com/watch?v=6nZLGOxQDnA

    My lights to Jingle Bells Techno
    http://www.youtube.com/watch?v=6QhCEZxfU38
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-12-26 13:02
    Iboucher

    Thank You for sharing this web page on how to use Transistors this will help me out a lot


    http://www.kpsec.freeuk.com/trancirc.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • SmiSmilesSmiSmiles Posts: 1
    edited 2008-12-26 20:50
    Wow, thank you, it's inspired me for next year. My wife i know won't be as forgiving about the time it will take as yours was, so I'm spanning it out over an 11 month period.

    Planning on using triacs and optocouplers instead of relays and transistors, already have them ordered from Mouser. They should last a much longer time then the 100,000 cycles for the relays, and give me much more available current for each channel, and cheaper. The only thing I know I'll miss is the clicking of all the relays.
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2008-12-27 06:47
    I am hoping to merge this with the Gemmy Holiday Light Show setups I just picked up from Walmart on clearance for $34. I figure at that price it's worth the weatherproof enclosure, six 1.25A outlets, and Optocoupler/Triac board. It actually works quite well right out of the box. I bought one and as I was unpacking it, thought it would be perfect for a hack. I opened it up and was assured it will be "hackable". So, I went and bought 2 more. For ~$100, I have 18 channels worth of controllable 1.25A outlets. I scored a bunch of LED strands too, so I should be set with either running the box as-is or merge it with this, Vixen, or ???.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    IT / Web / PCB / Audio
  • lboucherlboucher Posts: 139
    edited 2008-12-27 15:37
    Awesome, mind sending over a parts lists and diagram. Already had a few relays fuse closed. So i also need to work on a better solution for next year. Some quick reading looks like this is a good way to go.

    Thanks for putting this solution out there.



    ·
  • lboucherlboucher Posts: 139
    edited 2008-12-27 15:48
    I never head of a Triac before. Was looking up a data sheet. Looks cool.
    Doesn't have any information on lifetime, does anyone know how long these last?

    Thanks
    Lucas
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2008-12-29 05:10
    I actually took a couple quick shots when I had it open. I detailed one with the parts. I made up a quick block diagram in visio too.

    Uses Cosmo 3023 Triac driver Opto-isolators. www.hongjing-tech.com.cn/COSMO/KMOC3023.pdf Fairchild equivalent at Digikey is 73 cents (P/N MOC3023M)

    and the Triacs are SanRex TMG8C6 (marked T8C6). www.sanrex.com/discrete_triac_pdfs/TRIAC/Through%20%20hole%20---%20Standard/TO-220AB/TMG8C60-R.PDF

    The same Triacs are at Jameco for 84 cents as part number 657053. Interestingly, the Triacs are capable of 8 amps. This makes me believe that the 1.25amp max listed is due to the wiring/traces and the fact that all 6 outlets are running from a single 15A outlet.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    IT / Web / PCB / Audio

    Post Edited (WBA Consulting) : 12/29/2008 5:16:42 AM GMT
    1044 x 783 - 618K
    846 x 616 - 150K
    1197 x 1106 - 437K
    768 x 861 - 204K
  • lboucherlboucher Posts: 139
    edited 2008-12-29 18:24
    Nice, thanks for the info man.

    This looks like a really cheap way to proceed, and looks like you have a great hack going there.

    The parts seem real cheap. Looks like a total cost per io of under 5 bucks.

    Did some reading and i think i generally understand the circuit.

    If you wouldn't mind, could you take a look at that board and show me a wiring diagram about how the triac is wired to the opto isolator and the opto isolator to the controll chip.

    I am kinda wondering what the capacitor in the picture is for?

    Also is there a controllable resistor on that board for the diming?

    Not quite sure how that works.



    Thanks
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2008-12-31 00:39
    No problem. As soon as I can get some time to open it back up, I was planning on drawing a schematic for the Triac board. I was also thinking of making a single channel board.

    I also found the "timer only" box at home depot online for $20. I bought two in hopes they have the same Triac boards. Then I'll have 12 more channels in weatherproof extension boxes.

    Gemmy Light Show Timer without Sound Model 19495
    www.homedepot.com/webapp/wcs/stores/servlet/ProductDisplay?storeId=10051&langId=-1&catalogId=10053&productId=100646547

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    IT / Web / PCB / Audio
Sign In or Register to comment.