Extreme Arduino Newb requests guidance

Good day all, I recently decided to pick up a new hobby and in the spirit of the season will endeavor to create a Christmas lights display unit.

I have found a number of tutorials online that I will use to assist me with everything (adjusting to my liking as I go), but I had an idea of something I'd like to set up that I haven't found completed or even attempted anywhere.

Short background on me:

30 years in the electronics/computers industry.
Started off doing board level repairs on WYSE terminals and PCs.
Minor experience with programming in PHP, batch and vb-script.

My question to you all is basically one of feasibility, as in "is this possible".

Now, on to the idea.....

Looking at building a control unit for Christmas tree lights that will sync with music.
I'd like to set it up with 2 modes of operation, one which will be rather serene using 2 channels of white lights set to "playlist 1". (This would be mode 1)
There will be an external hardware switch that when activated will switch to mode 2, lighting a different series of channels with colored lights and "playlist 2" which would only consist of one song.

Now, the above I'm fairly sure can be done, it's the following piece that I can't figure out how to set up (or even if it can be done).

The external switch would need to "disable" for a set amount of time until the playlist ends.
Lets say playlist 2's song is 2:16 long. Activating the switch opens playlist 2 and activates the light channels, what I want to stop is another activation of the switch in the middle of the song, thereby restarting it again or otherwise fouling it up.

Is there a way to stop monitoring the switch pins for at least 2:16 to allow the song to complete and reset to mode 1 before it can be activated again?

Any ideas will be greatly appreciated, thank you!!

Ken

Yes, it’s feasible. There is a good way and a “bad” way to do it.

Bad way first.

for(i = 0; 1 < ((60 * 2) +16); i++)
{delay(1000); }

better way:

When playlist starts, set variable to the value of millis()

when the Switch is activated, ignore it if millis() isn’t (((2 * 60) +16) * 1000) bigger that it was when the playlist started.

(((2 * 60) +16) * 1000){cough}

Cough? Yeah, it Looks terrible. The Compiler will fix it any way because it’s all constants. (Although, have I really tested if the Arduino Compiler does that? Hmm.)

The OP was talking about 2 minutes 16 seconds and the formula can be related to that. If I had written 136000, would it have been any more obvious?

If I had written 136000, would it have been any more

It looks pretty obvious that it won't work to me - how about you?

Ideas is exactly what I'm looking for. The above gives me something to research and play with at the very least.

Thanks for the input so far, let's see if anything else pops up too.

Ken

AWOL, do you have an idea that may work with this?

I’m looking at anything that anyone can come up with.

Thanks!!

Where's the music coming from? Do you have a music card/shield that the Arduino can control as well as a couple of relays to control the lights being on/off?
MP3 module:

Female header sets available here
www.dipmicro.com
And I offer relay cards, both in a shield format, and trimmed down to just the relay/shift register portion
http://www.crossroadsfencing.com/BobuinoRev17/


Here's one running with AC powered LED light strings, with one wire cut to go thru the relay. Probably safer to have this in a box with wall outlets the relays controlling power to the outlets.

And testing of the standalone cards

Couple views of Relays controlling power to AC outlets:
Relay controlled outlet box.jpgRelayBreakoutBox.jpg

Maybe add a fuse.

.

Wouldn’t hurt. LED light strings usually have a fuse in the plug base. Otherwise a 5A fuse per socket to protect the relay.

The hardware end of things I've got taken care of. (This was the least of the challenges... :slight_smile: )

For the music I was looking into the rMP3 shield you listed. I haven't gotten far enough into it yet, but I believe the rMP3 is the only way this'll work.

Lots more research to do in any case!

CrossRoads:
Where's the music coming from? Do you have a music card/shield that the Arduino can control as well as a couple of relays to control the lights being on/off?
MP3 module:
rMP3 Playback Module – Rogue Robotics
Female header sets available here
www.dipmicro.com
And I offer relay cards, both in a shield format, and trimmed down to just the relay/shift register portion
Cross Roads Electronics


Here's one running with AC powered LED light strings, with one wire cut to go thru the relay. Probably safer to have this in a box with wall outlets the relays controlling power to the outlets.
MVI 2958 - YouTube
And testing of the standalone cards
MVI 3167 - YouTube

Remember to keep your wiring secured - and maintain a 'safe' distance between your low voltage and AC wiring.
A solder blob or wire hair can do a lot of damage!

Oh absolutely!

I pretty much always over calculate my safety margins to near non-sensical levels (my Dad was an engineer, it's in my blood), plus I like my work to look GOOD. :slight_smile:

Thanks!