My xmas-box project consists of an internet controlled Christmas lights and music show. A Christmas song can be requested on-line which is then put in a queue and played in the order it was requested. The music is transmitted on an FM station within a 300 ft radius from my house. 

The xmas-box has 8 Channels  (power outlets) where different light modes can be played: vu meter style, ascending, descending, split, merge, sequence and random. During each song one of these modes is used randomly every 10 seconds (to make the show less monotonous).

I started my research right after Halloween and I came across a couple different options, but I settled with the following combination of hardware : arduino + adafruit wave shield + ioBridge + wifi bridge + solid state relays (SSRs).

The xmas-box is enclosed in a small plastic tool box. I have place it on my deck under a roof ( it is not completely weather proof). The tool box has "3 levels." The bottom is where all the SSRs and AC wiring are located. The middle (the inside tray) contains the wall warts for the arduino (9v), ioBridge (5v) and Wifi Bridge with power. The top level contains the Arduino board, the ioBridge module and the FM transmitter.

This is the first time I lit my house so I was just able to put 3,300 mini lights, 3 spotlights,1 LED Rope, 4 LED (40 led each) branch trees and 1 reindeer. I hope the lights last so I can keep adding each year.

Step 1: BoM - Bill of Materials

Here is the list of materials I used for the xmas-box:

I'm looking to buy those SSRs for this project. What load current should I buy? <br>They come in 10A, 25A ... some in 3-25mA. range.
Hi, I'm a newbie and want to follow this project. I plan to start with a simplified version by just using SSRs &amp; Arduino Uno board.&nbsp;<br> - wire up the SSRs like in here: <a href="http://www.instructables.com/files/deriv/FZ6/9Y65/GGPFB9Y3/FZ69Y65GGPFB9Y3.LARGE.jpg" rel="nofollow">http://www.instructables.com/files/deriv/FZ6/9Y65/GGPFB9Y3/FZ69Y65GGPFB9Y3.LARGE.jpg</a><br> - connect the SSR wiring with the Arduino Uno board (using D2 - D9)<br> - connect the Arduino board with a PC and load the code to test the relay.<br> <br> Would that be enough to allow me to (learn to) program the code to sequence of relays on/off? (in other words, program the light to the music).<br> <br> Thanks
Has anyone ported the xmas_box code using the new wave_hc library?
Question about the SSRs. I'm using they Crydom D2410 SSR and have it wired as you have shown above. It is showing about a .3 mA current leakage at the off state. That's enough to light the string of LED lights, although they are dim. Did you experience this problem?
So whats the pint of the io bridge <br>
can i just use a direct ethernet connection instead of a wireless bridge??
How do you serial.print the current track being played to the iobridge serial board? I have never used any of this hardware before, so I'm not sure where to begin.<br><br>Can you provide more detail on how to set up the iobridge web interface, or provide a link that explains how to create widgets? Where are the commands provided above entered? Is this code stored in the iobridge web interface? <br><br>Thanks in advance for any additional info.
When I try to upload the sketch to my Arduino, I get multiple error messages: <br><br>xmas_box.cpp: In function 'void playComplete(char*)':<br>xmas_box:167: error: 'class String' has no member named 'append'<br>xmas_box:196: error: 'class String' has no member named 'append'<br>xmas_box:198: error: 'class String' has no member named 'append'<br>xmas_box:199: error: 'class String' has no member named 'append'<br>xmas_box:200: error: cannot convert 'String' to 'char*' in assignment<br><br>I'm using arduino-0021 which supposedly has string class incorporated in it. Do I need to modify the code? If so, please tell me how.
I'm using arduino 0017, so maybe that is the issue. For the error you get it is related to the String library. I wonder if there is a new lib?<br>Let me see if I found something.
Hi Noel,<br><br>I replaced all the &quot;append&quot; references with &quot;concat&quot; in your code, and that seemed to eliminate the errors: &quot;no member named 'append'&quot;.<br><br>However, I am still getting the following error:<br><br>xmas_box.cpp: In function 'void playComplete(char*)':<br>xmas_box:201: error: cannot convert 'String' to 'char*' in assignment<br><br>The line that the compiler stops at is:<br><br> track = tmpTrack;<br><br>I'm sorry to be posting so many questions, but I really want to get this thing working for my lights this year, and I am clueless as to what this error has to do with the above line of code. Do you have any ideas?<br><br>I feel like I might have bitten off more than I can chew with this project, because my understanding of computer code is almost non existent, which is forcing me to try to fix the code by trial and error. I can't figure out why I would be the only one getting errors. From the other posts, I assume other people have more recently built the xmas box and used the Arduino 0021 compiler, but maybe not. I'm not opposed to using 0017, but even with that compiler I get errors because I can't download the same string library you used.<br><br>If you wouldn't mind replying just to let me know you are reading my posts I would appreciate it, even if you don't know how to help me yet. I will try picking this project up again at a later date if necessary when I have some programming under my belt. I've already invested in all the materials and partially assembled the instructable though, so I'm determined to complete it eventually, even if I have to wait 'til next year to get to use it.<br><br>Thanks in advance.
@phorensyc I think you are almost there...Obviously there is an issue with using Strings or Chars. I havent fired up my code this year... I will upgrade to arduino 0021 and compile it...I will use the x-mas box in my christmas tree this year.<br>Keep up at it...Try the Arduino forums as well...I will let you know if i run in the same issue and how i solve it.<br><br>-Noel
Hi Noel, I fixed the final error. I posted my solution on your instructable. One other question though:<br><br>The instructable says to use pin connection D10 for LCS. It looks like from the picture that D10 should be connected to CCS. Is this correct?
Correct. Its D10 to CCS
I was able to solve the final error. I did a lot of searching, and don't fully understand all the changes that have taken place with the string libraries since you published this instructable, but the issue seemed to be that the variable track was declared as a char, and tmpTrack is a string, and the new string library can only convert a string to a char with the function toCharArray()<br><br>The link for the string library you have in your instructable only takes you to a page that tells you that the TextString library is now obsolete. String libraries are now included natively with the code compiler.<br><br>The instructions for the use of toCharArray() on the Arduino site are limited and some say a bit misleading, so I'll just share what I changed to make the program compile and load with the new string library.<br><br>Okay, I seem to have fixed it, or at least changed it to where the code compiles and loads on the Arduino. I replaced the following line of code:<br><br> track=tmpTrack;<br><br>with this:<br><br> char tracklngth[tmpTrack.length() + 1];<br> tmpTrack.toCharArray(tracklngth, tmpTrack.length() + 1);<br> track = tracklngth;<br><br>Sorry if this is an abomination to all seasoned programmers out there, but it's the best I could come up with. I'm sure it could have been done in one or two lines, but I'm in a hurry to get the xmas_box working.
Is it possible to fade any of the lights? Maybe with an AC dimmer or something. Very cool setup, will try this christmas.
[code]<br> <br> /*<br> DIMMERS 120V 60Hz (8-channel Possibly more)<br> <br> by Gromain59<br> Translated By Mike Deuschle<br> mike.dausch@gmail.com<br> <br> Material part:<br> - Triac driven by a digital output via an optocoupler<br> - AC opto-coupler for detecting the zero crossing of phase<br> <br> Software part:<br> - A hardware interrupt input 2 at the zero crossing of phase<br> - A software interrupt that occurs between 100us and 1400us.<br> &nbsp;&nbsp; &nbsp; =&gt; Interrupt interval is variable to obtain a light curve by linear orders, because of the shape of the sinusoidal signal.<br> we have:<br> 1. Detection of the transition to zero on input 2<br> 2. execution of detection_zero (): processing channel with a setpoint of 0% and 100%<br> 3. deactivating hardware interrupt, enabling the software interrupt on the basis of delay [0]<br> 4. interrupt after delay [c2] ?s (c2 = 0)<br> 5. execution of controle_canaux ()<br> &nbsp;&nbsp; &nbsp; =&gt; Index increment c2<br> &nbsp;&nbsp; &nbsp; and if c2 is greater than 49, then this is the last cycle<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; Turn OFF of all channels<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; Activate the hardware interrupt<br> &nbsp;&nbsp; &nbsp; otherwise:<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; Activation of output channels with 98% to record (either a 469?s delay) or if<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; Interrupt reconfiguration of time with another delay, delay [c2]<br> <br> To change the setpoint of a channel, you must send via the serial monitor a frame of the form:<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot; D/0/45/F&quot;<br> &nbsp;&nbsp; &nbsp; =&gt; Space<br> &nbsp;&nbsp; &nbsp; =&gt; &quot;D&quot; to indicate the start of the frame<br> &nbsp;&nbsp; &nbsp; =&gt; &quot;/&quot; As separator<br> &nbsp;&nbsp; &nbsp; =&gt; The affected channel (0 to 7 here)<br> &nbsp;&nbsp; &nbsp; =&gt; &quot;/&quot; As separator<br> &nbsp;&nbsp; &nbsp; =&gt; The desired level (from 0% to 100%)<br> &nbsp;&nbsp; &nbsp; =&gt; &quot;/&quot; As separator<br> &nbsp;&nbsp; &nbsp; =&gt; &quot;F&quot; to indicate the end of the frame<br> <br> &nbsp;&nbsp; &nbsp; Once the frame received, the function sscanf is responsible for retrieving data.<br> &nbsp;&nbsp; &nbsp; It converts the received record levels (0 to 50 levels)<br> <br> Resources:<br> http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230333861/30 for first test<br> http://www.hoelscher-hi.de/hendrik/english/dimmer.htm for electronics<br> http://www.abcelectronique.com/bigonoff/domocan.php?par=3efd4 for electronics and soft (PIC)<br> arduino forum<br> <br> */<br> <br> #include &lt;TimerOne.h&gt; // for the interruption time http://www.arduino.cc/playground/Code/Timer1<br> #include &lt;stdio.h&gt; // for the treatment of the frame containing the change orders<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // timeout value for the reception of the frame<br> int tps_max_lecture = 200; // reading code, counter max between all the characters of a code<br> int tps_max_carte = 1000; // max meter between reception of a character<br> <br> <br> long curve[] = {<br> 1469 , // 98 % 1 225,3V retard / z&eacute;ro = 1469 ms<br> 287 , // 96 % 2 222,7V retard / z&eacute;ro = 1867 ms<br> 234 , // 94 % 3 220,6V retard / z&eacute;ro = 2154 ms<br> 201 , // 92 % 4 218,2V retard / z&eacute;ro = 2388 ms<br> 180 , // 90 % 5 215,4V retard / z&eacute;ro = 2589 ms<br> 164 , // 88 % 6 213,3V retard / z&eacute;ro = 2769 ms<br> 152 , // 86 % 7 210,8V retard / z&eacute;ro = 2933 ms<br> 143 , // 84 % 8 208V retard / z&eacute;ro = 3085 ms<br> 135 , // 82 % 9 205,7V retard / z&eacute;ro = 3228 ms<br> 129 , // 80 % 10 202,8V retard / z&eacute;ro = 3363 ms<br> 124 , // 78 % 11 200,5V retard / z&eacute;ro = 3492 ms<br> 120 , // 76 % 12 197,6V retard / z&eacute;ro = 3616 ms<br> 116 , // 74 % 13 195,2V retard / z&eacute;ro = 3736 ms<br> 112 , // 72 % 14 192,4V retard / z&eacute;ro = 3852 ms<br> 110 , // 70 % 15 189,6V retard / z&eacute;ro = 3964 ms<br> 108 , // 68 % 16 186,8V retard / z&eacute;ro = 4074 ms<br> 106 , // 66 % 17 184V retard / z&eacute;ro = 4182 ms<br> 105 , // 64 % 18 180,9V retard / z&eacute;ro = 4288 ms<br> 103 , // 62 % 19 178,1V retard / z&eacute;ro = 4393 ms<br> 102 , // 60 % 20 175,1V retard / z&eacute;ro = 4496 ms<br> 101 , // 58 % 21 172,1V retard / z&eacute;ro = 4598 ms<br> 101 , // 56 % 22 168,9V retard / z&eacute;ro = 4699 ms<br> 100 , // 54 % 23 166,2V retard / z&eacute;ro = 4800 ms<br> 100 , // 52 % 24 162,6V retard / z&eacute;ro = 4900 ms<br> 100 , // 50 % 25 159,3V retard / z&eacute;ro = 5000 ms<br> 101 , // 48 % 26 155,8V retard / z&eacute;ro = 5100 ms<br> 100 , // 46 % 27 152,6V retard / z&eacute;ro = 5201 ms<br> 101 , // 44 % 28 149,1V retard / z&eacute;ro = 5301 ms<br> 102 , // 42 % 29 145,3V retard / z&eacute;ro = 5402 ms<br> 103 , // 40 % 30 141,8V retard / z&eacute;ro = 5504 ms<br> 105 , // 38 % 31 138V retard / z&eacute;ro = 5607 ms<br> 106 , // 36 % 32 133,8V retard / z&eacute;ro = 5712 ms<br> 108 , // 34 % 33 130V retard / z&eacute;ro = 5818 ms<br> 110 , // 32 % 34 126V retard / z&eacute;ro = 5926 ms<br> 112 , // 30 % 35 121,7V retard / z&eacute;ro = 6036 ms<br> 116 , // 28 % 36 117,1V retard / z&eacute;ro = 6148 ms<br> 120 , // 26 % 37 112,6V retard / z&eacute;ro = 6264 ms<br> 124 , // 24 % 38 107,7V retard / z&eacute;ro = 6384 ms<br> 129 , // 22 % 39 102,4V retard / z&eacute;ro = 6508 ms<br> 135 , // 20 % 40 97,2V retard / z&eacute;ro = 6637 ms<br> 143 , // 18 % 41 92V retard / z&eacute;ro = 6772 ms<br> 152 , // 16 % 42 85,7V retard / z&eacute;ro = 6915 ms<br> 164 , // 14 % 43 79,4V retard / z&eacute;ro = 7067 ms<br> 180 , // 12 % 44 72,8V retard / z&eacute;ro = 7231 ms<br> 201 , // 10 % 45 64,8V retard / z&eacute;ro = 7411 ms<br> 234 , // 8 % 46 56,4V retard / z&eacute;ro = 7612 ms<br> 286 , // 6 % 47 46V retard / z&eacute;ro = 7846 ms<br> 399 , // 4 % 48 32,4V retard / z&eacute;ro = 8132 ms<br> 500 , //<br> 1469 // 2 % 49 0V retard / z&eacute;ro = 8531 ms<br> };<br> <br> int set[] = { // set channel level (0 = 100%, 50 = 0%)<br> 0, // Output 0<br> 0, // output 1<br> 0, // output 2<br> 0, // output 3<br> 0, // output 4<br> 0, // output 5<br> 0, // output 6<br> 0, // output 7<br> };<br> <br> int output [] = { // assign a pin for each channel.<br> 4, // Output 0<br> 3, // output 1<br> 5, // output 2<br> 0, // output 3<br> 0, // output 4<br> 0, // output 5<br> 0, // output 6<br> 0, // output 7<br> };<br> <br> volatile int c1 = 0; // index c1 for reading data from each channel (No pin, luggage)<br> volatile int c2 = 0; // c2 index number passing through the loop control phase delay (49 passages)<br> <br> // Definition of macros to drive the output<br> #define lightON(index) (digitalWrite(output[index], HIGH))<br> #define lightOFF(index) (digitalWrite(output[index], LOW))<br> <br> <br> void setup () {// Start of setup<br> <br> // Initialize the serial<br> Serial.begin (9600);<br> <br> // Initialize the channel outputs (triacs)<br> &nbsp;&nbsp; &nbsp; for (c1 = 0; c1 &lt;= 7; c1++) {// we traverse the 8 channels to configure<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pinMode(output[c1], OUTPUT); // we associate each channel has a pin, which sets the output digital<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lightOFF(output[c1]); // and we switch off the output<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp;&nbsp; &nbsp; Serial.println( &quot;Gromain 8-CHANNEL DIMMER v0.2&quot;);<br> &nbsp;&nbsp; &nbsp; Serial.println( &quot;FRAME EXPECTED: &lt;space&gt; 'D' / 'Output Port' / 'Value of DIM' / 'F'&quot;);<br> <br> <br> // Initialize the interruption time Timer1<br> &nbsp;&nbsp; &nbsp; Timer1.initialize(); // Initialize TimerOne library for the freq we need<br> <br> <br> // Attach the interrupt 0 to pin 2 for the detection of zero crossing (Zero Cross Detection)<br> &nbsp;&nbsp; &nbsp; attachInterrupt(0, detection_zero, FALLING); // Attach an Interrupt to Pin 2 (Interrupt 0) for Zero Cross Detection<br> <br> } // End of setup<br> <br> void detection_zero() {// function associated with the interrupt 0<br> <br> &nbsp;&nbsp; &nbsp; detachInterrupt(0); // disables the interrupt on zero crossing<br> <br> &nbsp;&nbsp; &nbsp; c2 = 0;<br> <br> &nbsp;&nbsp; &nbsp; for (c1 = 0; c1 &lt;= 7; c1++) {// we scan the 8 outputs to check their orders<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (set[c1] &gt;= 49 ) {// if set 0%<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lightOFF(c1); // then we switch off<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (set[c1]&lt;= 0){// if set 100%<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lightON(c1); // then we light<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp;&nbsp; &nbsp; }<br> <br> &nbsp;&nbsp; &nbsp; Timer1.attachInterrupt(controle_canaux, curve[c2]); // we attach the interruption time<br> <br> } // End of detection_zero<br> <br> void controle_canaux() {// here we verified whether the triac must be initiated<br> <br> &nbsp;&nbsp; &nbsp;c2=c2++;<br> <br> &nbsp;&nbsp; &nbsp; attachInterrupt(0, detection_zero, FALLING); // we attach an interrupt on pin 2 (interrupt 0)<br> &nbsp;&nbsp; &nbsp; Timer1.detachInterrupt(); // we detach the interruption time<br> <br> &nbsp;&nbsp; &nbsp; if (c2 &gt;= 41) {// If last cycle then (best at 41 for 60Hz)<br> <br> &nbsp;&nbsp; &nbsp; for (c1 = 0; c1 &lt;= 7; c1++) {// we scan the 8 outputs<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lightOFF(c1); // and we put out the channel for the next cycle<br> &nbsp;&nbsp; &nbsp; }<br> <br> <br> &nbsp;&nbsp; &nbsp; }<br> else { // else<br> <br> &nbsp;&nbsp; &nbsp; Timer1.attachInterrupt(controle_canaux, curve[c2]); // we attach a break time<br> <br> &nbsp;&nbsp; &nbsp; for (c1 = 0; c1 &lt;= 7; c1++) { // we scan the 8 outputs to check their orders<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (set[c1] == c2) // if is set equal to the processed (no change in the loop)<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {lightON(c1);} // then we light the channel<br> &nbsp;&nbsp; &nbsp; }<br> <br> } // End function controle_canaux<br> <br> }<br> void loop() {// Main Loop<br> <br> &nbsp;&nbsp; &nbsp; int n = 0;<br> <br> &nbsp;&nbsp; &nbsp; if (Serial.available ()&gt; 0) {<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n = lecture();<br> &nbsp;&nbsp; &nbsp; }<br> <br> }<br> <br> int lecture() {// read a frame type: &quot;D / aaa / bbb / F<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Or &quot;D&quot; starting character frame<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Or &quot;yyyy&quot; No output which is set to modify<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Or &quot;bbbb&quot; new set of output (between 0 and 100%)<br> <br> <br> <br> &nbsp;&nbsp; &nbsp; char buf[15] = &quot; &quot;;<br> &nbsp;&nbsp; &nbsp; int timeout = 0;<br> &nbsp;&nbsp; &nbsp; int i = 0;<br> &nbsp;&nbsp; &nbsp; int n1 = 0;<br> &nbsp;&nbsp; &nbsp; int n2 = 0;<br> &nbsp;&nbsp; &nbsp; char c1, c2;<br> <br> &nbsp;&nbsp; &nbsp; while (Serial.available() &gt; 0) {<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(i!=14){<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; buf[i] = Serial.read ();<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i++;<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> <br> &nbsp;&nbsp; &nbsp; timeout++;<br> <br> &nbsp;&nbsp; &nbsp; if (timeout&gt;tps_max_lecture)<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {Serial.println(&quot;T1&quot;);<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp;&nbsp; &nbsp; if (timeout&gt; tps_max_lecture)<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {Serial.println(&quot;T2&quot;);<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -2;<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp;&nbsp; &nbsp; &nbsp; }<br> &nbsp;&nbsp; &nbsp; sscanf(buf, &quot;%c/%d/%d/%c&quot;, &amp;c1, &amp;n1, &amp;n2, &amp;c2); // decoding frame<br> <br> &nbsp;&nbsp; &nbsp; if (c1 == 'D' &amp;&amp; c2 == 'F') {// Check if the plot starts out by D and ending in F<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int nouv_cons = n2; // we store the new value for the work then<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nouv_cons = constrain(nouv_cons, 0, 100); // on the new terminal value between 0 and 100%<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.print(&quot;Output &quot;);<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.print(n1);<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.print(&quot; , new value of: &quot;);<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.print(nouv_cons);<br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.print(&quot; % index, delay: &quot;);<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set[n1] = (50 - (nouv_cons / 2)); // it converts the value 0-100% in no phase delay<br> <br> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.println (set[n1]);<br> &nbsp;&nbsp; &nbsp; }<br> &nbsp;&nbsp; &nbsp; else // if character from the beginning or end of frame not recognized<br> &nbsp;&nbsp; &nbsp; {Serial.println(&quot;Code Unknown&quot;);}<br> <br> &nbsp;&nbsp; &nbsp; return i;<br> <br> }
Sorry this is to control and dim 8 channels...Sorry for the length of the post. http://www.instructables.com/id/Christmas-Lights-to-Music-Using-Arduino/ here on how to build one using triac and an octupocoupler (basically an SSR).
Haven't had a chance to run the code because I'm still starting to build my setup. Is my quick sketch a good representation of whats going on, please excuse its crudeness just did it in paint really quickly.
Yeah. This is it! That's the beauty of Solid State Relay!
Kinda of confused by some of the pictures. Is the white and green wire connected together? Do you have a schematic that may help.
I was confused at first myself, but there is no cross connection between the green and white. Additionally, keep in mind that the author split the two sides. Half of the relays are connected to one outlet, and half are connected to another so you end up plugging two plugs into the wall instead of one. A good idea because there's no way you'd be able to connect 8 - 12 gauge wires with one wire cap. It's just too much.<br><br>By the way, seeing as how you're just starting this project yourself, have you uploaded the code to the arduino yet? If so, did you experience any error messages?
what do u connect the first three channel wires up to?
<br> This is a really neat Instructable. Good to see that you are using <a href="http://www.elightspot.com/ledchristmaslights.aspx">LED Christmas lights</a> as well!
I recently completed an instructable http://www.instructables.com/id/Christmas-Lights-to-Music-Using-Arduino/ and they recommend using your code (xmas_box.pde). I was wondering if there was a way to actually have the music controll the lights instead of the 7 modes in the code?
If you see in the code, I'm using the OpAmp from the Ardiuno WAVE shield to get a sort of VU meter control, this is as close as I can get to &quot;control&quot; the lights with music. If you are tethered to a pc you can use processing and wherr there are some music sync scripts.
Thanks for replying so fast, as you can probably tell i really dont know how to write in code but i was wondering is there a way to adapt the code so when i push a normally open momentary switch it will change to the next song on the SD card. Also what &quot;processing&quot; are you referring to and how would i get that idea working. Sorry for asking so many dumb questions but i am not very smart in these matters and i believe you to be an expert in these things, thank you.
I love this instructable. I&nbsp;am actually using it as reference for my relay control box. It is very well documented and the pictures are all very well done.<br /> <br /> But one thing I&nbsp;wanted to ask you is if you coded your own website?<br /> If so could you point me in the direction to making my own song queuing system maybe using php.<br />
&nbsp;Have you figure out a way to do your music queue? I used Oracle Application Express which is a rapid web development environment. But as I mentioned this can be replicated in any other platforms (RR, .net, PHP).<br /> <br /> Is just a matter of creating 2 tables. One to hold the request (queue) and one to hold the songs...then a couple REST calls to update the queue from the mcu and one to retrieve what is currently playing.<br />
Any chance you can upload a schematic so we can get a better feel for how each component interacts?&nbsp; Thanks.
&nbsp;Yes...As soon as I can figure out Eagle!! Do you have another&nbsp;software&nbsp;recommendation&nbsp;to do schematics? &nbsp;
Eagle was a pain to learn, but not too bad.&nbsp; The tricky part is finding things in the library.<br /> <br /> I've heard good things about gEDA (http://www.gpleda.org/) on Linux, but I've not tried it yet myself.<br /> <br /> There are also some schematic/PCB editors made by PCB companies that you can possible export an image from after creating the schematic.<br /> <br /> I hope that helps.<br />
congratulations its amazing and thank u for sharing keep it up<br />
wow this is great i have been wanting to do something like this for some time this looks easy enough for me to tackle !!! cant wait to see how you work in the online video into your webpage <br /> <br /> i am deff going to do this!!<br /> <br /> thanks<br /> <br /> keep up the great work!!<br />
&nbsp;Very clever use of the API. Thanks for sharing the details of your project. It's great!

About This Instructable