Shop OBEX P1 Docs P2 Docs Learn Events
Computer Controlled Christmas Lights using the BS2 — Parallax Forums

Computer Controlled Christmas Lights using the BS2

ke4pjwke4pjw Posts: 1,155
edited 2012-12-07 04:32 in Robotics
In November I did a project for Computer Controlled Christmas lights. The Basic Stamp 2 is the heart of the controller. I call it the Griswold Board, a la Christmas Vacation. It is not a dimming controller, only on and off. It reads a 9600 baud data stream from a PC. Based on what data is sent, it will turn off and on up to 15 Solid State Relays. Each SSR is capable of carrying 12 amps of current @ 120 volts AC. (Though the traces on the circuit board cannot support that amount of current) I had the board for the light controller etched by http://expresspcb.com . The board is housed in a small circuit breaker panel from Homedepot. The AC connections into the board are made from the cheapest extension cords I could find. [noparse]:)[/noparse]

The software is a Windows .NET application that uses a Windows Media Player "wrapper" as its core. The "wrapper" exposes a microsecond accurate timecode property of the given song that is being played. That property is used to sync changes of the lights with the song. Building this software was the trickiest bit for me. Took about 30 hours of my time to get it to a point where the shows could be edited and played.

Videos

default.jpg Christmas Vacation
default.jpg Carol of The Bells
default.jpg Christmas in Hollis

12136_1288490459316_1441831958_30817990_485968_n.jpg
12136_1288492579369_1441831958_30817993_3153878_n.jpg

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-- Terry

Post Edited (ke4pjw) : 3/27/2010 5:30:08 AM GMT

Comments

  • Tony B.Tony B. Posts: 356
    edited 2010-03-27 14:32
    Terry,

    Thanks for the post. My son, who is ten, is very interested in learning everything I know about exterior illumination and we hope to have many twinkling lights on the house and in the yard this year. I will have time tomorrow to review all that you have uploaded and learn from your work. We have been planning on using the EFK-TEK RC-4 board with SSRs, but I wouldn't mind building it myself.

    Tony
  • mikedivmikediv Posts: 825
    edited 2010-03-28 13:46
    ke4pjw That's pretty darn neat .. How did you get the music to synchronize with the lights.
  • ke4pjwke4pjw Posts: 1,155
    edited 2010-03-28 15:22
    Thanks guys! Mikediv, the .NET application running on the PC does the synchronization. The light sequence was entered and recorded by the application. When the app plays it back it sends a data stream at 9600bps telling the BS2 what SSRs to turn on or off.

    Tony B., this board isn't the most cost effective one. It is a bit over built on the SSR current capability but dirt simple in design. MY dad taught me everything I know about exterior illumination as well [noparse];)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -- Terry
  • mikedivmikediv Posts: 825
    edited 2010-03-28 17:20
    Thanks Terry,, I can't tell you how impressed I am with your project ,, Do you broadcast the music outside and if yes what do your neighbors think?
  • ke4pjwke4pjw Posts: 1,155
    edited 2010-03-29 18:20
    Thanks again Mike. Yes, the music is transmitted using a Ramsey FM-25b. Not sure what the neighbors thought, LOL. They seemed to enjoy it. We had lots of visitors checking it out. I did write a scheduler into the software so that on the nights I was not home it wouldn't run all night.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -- Terry
  • KMyersKMyers Posts: 433
    edited 2010-12-04 09:22
    Very cool project!

    73's
  • gdyrdavegdyrdave Posts: 7
    edited 2010-12-13 20:38
    ke4pjw wrote: »
    Thanks again Mike. Yes, the music is transmitted using a Ramsey FM-25b. Not sure what the neighbors thought, LOL. They seemed to enjoy it. We had lots of visitors checking it out. I did write a scheduler into the software so that on the nights I was not home it wouldn't run all night.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -- Terry

    ke4pjw
    Loved what you did. want to try the same thing. How does the wraparound/interface installed. also loved the videos.
    Dave
    N8KVD
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2010-12-14 06:47
    Terry--

    Those videos made me grin from ear to ear! :):):)

    Merry Christmas!

    --Bill
  • gdyrdavegdyrdave Posts: 7
    edited 2010-12-14 11:26
    How do I open the .bin file? Is the .net app in there? How does this interface with WMP? Sorry about so many questions. Just getting back into the Stamp and Pic processors.
    Thanks
    N8KVD
  • maldridgemaldridge Posts: 37
    edited 2010-12-23 06:57
    this looks like a very promising board. I applaud your efforts to write your own program, but have you thought about writing a plugin for Vixen? Vixen replaced a program called Comet which is basically what you have written here. Great job on the hardware, I think I'll add this to my existing display. I could use more channels.
  • ke4pjwke4pjw Posts: 1,155
    edited 2010-12-23 11:10
    gdyrdave wrote: »
    How do I open the .bin file? Is the .net app in there? How does this interface with WMP? Sorry about so many questions. Just getting back into the Stamp and Pic processors.
    Thanks
    N8KVD

    The forum would not allow me to upload a .zip file at the time. Just remove the .bin extension and you should be able to open it.
    The application uses the Interop.WMPlib.dll to expose the winamp controls.

    The only annoying big bug I found with it was that if you used a variable bit rate music source, it would shift the timecode around enough to cause issues with the synchronization. I would just transcode the music to a fixed bit rate mp3 to solve the problem before building the sequence.

    Merry Christmas and Enjoy,
    Terry
  • ke4pjwke4pjw Posts: 1,155
    edited 2010-12-23 11:26
    maldridge wrote: »
    this looks like a very promising board. I applaud your efforts to write your own program, but have you thought about writing a plugin for Vixen? Vixen replaced a program called Comet which is basically what you have written here. Great job on the hardware, I think I'll add this to my existing display. I could use more channels.

    Thanks for the comments maldridge. At the time I did not know about Vixen. I just wanted to build a soup to nuts solution. To me this was more about the challenge of creating the whole thing than just buying a box that works.

    This year, I designed a new board based on the Propeller that uses discrete TRIACs and opto-isolators. It is a board that can dim the lights and uses DMX-512 as the communications protocol. It is a much less expensive board so I have 96 channels this year :D I also built a DMX-512 encoder based on the propeller that interfaces with Vixen via a plugin that I wrote.

    I will try and share the details of the new boards when I have some free time. Here is a video of this year's setup, 100% Propeller powered.
  • maldridgemaldridge Posts: 37
    edited 2010-12-24 21:02
    I am looking at building a propelling based software DMX console. When you have a chance I would be very interested in how well the proppellor is able to keep up with DMX signals.

    Merry Christmas!
  • gdyrdavegdyrdave Posts: 7
    edited 2010-12-25 05:38
    Got the software to work somewhat. How do you change the com port. What is the default? so far so good. Merry Christmas to you too.
  • gdyrdavegdyrdave Posts: 7
    edited 2010-12-25 14:03
    Ok. Defaulted the com port for the usb adapter to com 1. Seem to do something. If i turn record off, it randomly lights. May be the usb/com thing. However cant save the sequences. It saves them, but when I try to play back ,nothing. If I record then play its ok except for the randomness. I put a diagnosic message outputted to a serial display to see what was going on. It showed the random codes coming in, but was responding. With a little help, I think I can get this going. With your help, I would like to put in commands to ramp up/down using th pwm command. But first things are first. Thanks for everything. Merry XMAS!
    73's
    N8KVD
    Dave
  • gdyrdavegdyrdave Posts: 7
    edited 2010-12-27 06:32
    I got the random lights to stop. I inputed 3 bytes the compared the first byte as a CR. Then proceeded to enable the lights. Worked like a champ. Did you write the app in Visual Studio? All but the saving part works just fine. So far so good.

    N8KVD
  • ke4pjwke4pjw Posts: 1,155
    edited 2010-12-27 08:04
    Yes, it was written in Visual Studio. If you would like, I will investigate a way to have it set the com port in a config file or from a menu option. I am unsure why you can't save a sequence. Does the application die or silently fail? Is the .sho file created?

    Thanks,
    Terry
  • gdyrdavegdyrdave Posts: 7
    edited 2010-12-27 09:56
    A lot of times it dies. Have to use Task Manager to shut it down. Most of the time I load the show and hit play. The status bar shows nothing. I even put the mp3 in the same directory. Not sure I have to name the show the same as the MP3. However downloading Visual studio now. Excited to learn something new. Haven't done this stuff in years. I am an old fortran man.....Its as old as it gets...LOL. I think the data stream was coming in so fast the BS2 couldnt keep up with it. After inputting all 3 bytes, and comparing the first was the key for timing. Bear in mind this is an old bs2 activity board. I am retired so I have a lot of time to play. (and Learn) .Also plan to port over to PicBasic Pro and burn a PIC just for this. Looking ahead adding a 4th byte for the board to react. ie: CR,Board#,Light Byte,Lite Byte. Can add extra lights that way. Sorry I got a big head.

    Thanks for all youre responses. If you would like my email, let me know. This is FUN

    PS, No time for Ham Radio....LOL

    N8KVD
  • ke4pjwke4pjw Posts: 1,155
    edited 2010-12-27 14:34
    I have seen it fall over like that when the com port does not open properly. (Have to kill it through task manager) I think you will find C# and the Visual Studio environment very easy to use. I am a long time, die hard, Linux fan, and I think Microsoft really has done a great job with the .NET development tools.

    I used the BS2 "board of education" for development (Turning on LEDs as tests). It did the job just fine.

    I haven't looked at this code in a year, but I am sure there are some rough edges I can clean up.

    Feel free to PM me or post here if you have any specific questions. I am really glad you are enjoying it. I had a blast last year putting it together. The propeller based one I did this year has been alot of fun too! (And a lot cheaper to build)

    73 DE KE4PJW
    (not much time for me to get on the air either, HIHI)
    --Terry
  • ChambersburgChambersburg Posts: 2
    edited 2010-12-28 17:55
    Greetings from one Christmas-light loving ham to another.
    That's got to be one of the most entertaining uses of the BS2(along with .NET) that I've ssen to date.

    Can't help but wonder what your plans are for next year...
    73
    N3LJP
  • gdyrdavegdyrdave Posts: 7
    edited 2011-01-02 07:56
    I got Visual Studio up and was able to change the com port and the labels on the buttons. Still have a problem with shows and playlist. Can create a show but when I play it back nothing. I load the MP3 using the new show, and it will then play. Whe I loaded the show, I noticed that the property for the filename was really screwy. After I loaded the MP3 it was ok. I looked at the .sho file generated and the URL was correct. Still wont generate playlists. Looked at the section of code in the source file, but not being to versed on C, cant make head nor tails out of it.

    Hope you had good Holidays.

    73's DE N8KVD

    Dave
  • markt40markt40 Posts: 1
    edited 2012-12-07 04:32
    gdyrdave wrote: »
    I got the random lights to stop. I inputed 3 bytes the compared the first byte as a CR. Then proceeded to enable the lights. Worked like a champ. Did you write the app in Visual Studio? All but the saving part works just fine. So far so good.

    N8KVD

    I seem to have the same random problem I have a USB to Serial adapter. Can you show me the code you added to fix the problem?
    I would really like to get this going for a christmas boat parade.

    Thanks,
    Mark
Sign In or Register to comment.