(FILLED) Gig: Help creating sketch with 8 buttons that will trigger relays for

GIG HAS BEEN FILLED. THANKS FOR THE REPLIES!

Hello: Electronics tech here that's ventured into the automation world. I've had fun creating some of the examples and exploring the wonderful world of debouncing switches (including debouching my head off the table). Ready to see what it would take to have one of you Arduino savants to sketch my idea. Happy to PayPal or donate to a charity you like or Starbucks cards. (Not sure exactly how this works around here.) Just let me know.

The idea: Unit has 4-8 input buttons (8 preferably but not positive I can to that with one ArduinoUNO). Each button controls a separate output to a relay. Pressing one of the (debounced) buttons will close a relay for specific/adjustable amount of time (around .5 to 3 seconds). I've been playing with the "Pause" command but every tutorial says not to use pause. It might be nice to be able to adjust the relay closed time without having to change the sketch and reloading but that's far from required. The relay closed command needs to be independently adjustable for each relay.

Other things that would be nice but not required at all:
A fail-safe to make sure none of the relays can be stuck closed.
Ability to press more than one button at a time. (Or a 2nd button could be pressed before the first relay has opened back up.)
Quickly pressing a button 2 or 3 times would hold the relay closed for 2 or 3 times the programmed relay-closed setting.

Depending on how feasible this is I have some other ideas I'd like to implement into the design. Sure hope you can help. Open to all suggestions!

I don't have any code to upload and my schematic just has 8 switches, an ArduinoUNO and 8 relays so not sure how helpful that would be. So here's a baby Corgi.

What are you switching? 0.5 seconds is quite short for a relay, won't be all too accurate a time due to mechanical reaction time. An electronic switch (mosfet or SSR) would be more accurate.

Fail safe: use the NO contacts of the relay. Whenever there's no signal, the circuit is open. There's not much you can do against mechanically stuck relays (contacts welded together), which if you stay within specifications normally won't happen.

Eight buttons and eight relays is well within the ability of a single Uno. Easy. Read the buttons, activate the relay based on it. For the longer time, I assume with "fast" you mean "while the relay is still engaged", just add time to the engagement time. Multiple buttons/multiple relays at the same time follows quite naturally - it'd take special measures to NOT allow two relays at the same time.

To change the relay time without reloading the sketch, you need some extra form of input - e.g. a Serial interface with a computer. Can be done, adds to the work of course.

For payment, PayPal is preferred. I make my own coffee, much easier and cheaper than going to Starbuck's or so. It even tastes better :slight_smile: