Turning off and on several arduinos at once

Newbie, of course. First question: I am thinking of using several arduinos in an art installation. A motor here, a relay there and so forth. I would like to have some sort of button/switch that the gallery workers can use to turn all the arduinos off in the evening and on in the morning. Is that possible? if yes, then what happens to where the code is when turned off? I have searched a bit on this and haven't found anything I understand yet.

Any advice much appreciated!

John

The code is stored in flash. When the Arduino is turned off, it is still stored in flash.

When they are switched on, they boot, read the bootloader, wait for a short time just in case someone is trying to upload, then start the main program.

What was in RAM (the changing values of variables) is lost (so if you stored a high score as a variable that would be lost) what isn't lost is the rest.

If you wish to have data remain after power off you can use either an SD card shield or EEPROM (there is some EEPROM on board) however I doubt you will need this.

Thanks, that clears some of my questions up. Remaining question: how and/or where(?) is a physical way of turning arduinos off for the evening and back on in the morning? Just interrupt the power to the unit with a switch? Sorry to be so ignorant! -

John

You can just power off all of them, but it depends also on the position of the motors etc.

Do you wish the "artwork" to go to a defined position or so. If that is the case you should have some shutdown command/switch and code in the arduino to take care of it. Then on the display you can post a message like "you can now safely switch off the system" (or let the Arduino activate a switch off relay :wink:

If you have them all powered by a single system, just turn it off.

Thank you both very much! - John

Doesn't sound like you need much IO - why not just 1 arduino and a set of 3 or 4 conductor wire off to each location to drive the motor, read the switch, control an LED, etc. with power, Gnd, control wire or two as needed for each location?