Arduino uno relay shield as timers

Can I use relay shield as timers?and what code can i use?

Hello
Post a schematic to see how we can help.
Have a nice day and enjoy coding in C++.

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.

It will help you get the best out of the forum in the future.

Let's start with "which relay shield"?

Simple 4 relays on a shield board with 4 leds to indicate which relay is on.

What does that actually mean? Do you want the shield to keep track of time? Or what?

It sounds like you mean "use Uno and relay shield as a appliance timer"?

No, you will probably need an RTC also. The Uno's internal clock is not very actuate for switching appliances on/off at specified times of day over weeks, months. Also when the Arduino is not powered, it will forget the time of day, day of week etc and will have to have the date/time set each time you power it up. But an RTC (Real-Time Clock) module will keep highly accurate time for years, even when the Arduino is not powered, because it has a small battery.

The next question is how the user of the appliance timer will set/program the on/off times for the appliances. A display and some buttons will probably be required for this, unless all those times will be set once and be fixed forever (or, at least, can only be changed by re-programing the Uno).

Can you tell us what the appliances will be, their voltage and power consumption? A small relay shield may be ok for lights and other small appliances, but not for high-powered appliances like washing machines for example.

It is for …actuate by a push button(start 30 time down)then pause and a resume button (10 minuets ) and pause beeper to tell (finish operation)with blinking LED.only 2 timers needed.

Well, that's quite ambiguous and confusing. Can you try explaining that again in more detail please?

So far, it does not sound like the relay shield is needed.

I invented a safe sanitizer device for home cleaning of a hospital device .all i need is a 30 minutes timer and pause button and a resume button to start second timer. Then a buzzer and a LED to indicate (finished).I have to use 110 volts to power machine parts.
And a code for arduino uno and relay shield. Can you do that?
The control panel burned up and to replace it, cost $3000.

It sounds plausible although I still can't quite understand your requirements. An Arduino can read a couple of buttons, time ten and thirty minutes and turn relays on and off.

After (resume button) pressed then a second relay counts down(10) minutes,then stops and a buzzer and LED indicate finish

If you invented it, why do you need help to replace the control panel? When you designed it, why did you choose a control panel that costs $3000?

Yes, but I am not for hire. I can help you with the code, as can many forum members here, but you will need to describe what the functions should be more carefully than you have done so far. Find a way to do that. A list. A diagram. Something to make things clearer.

Can times be writing in the program?small relay is what the control panel has,I looked.timing accuracy not an issue.its for sterilization.

Again, confusing and ambiguous. But I think the answer is yes.

Can you post a sharp, clear, bright picture of that relay?

Ok, then I think an RTC will not be needed.

We’re up Arduino,call up sketch ,upload, press start button, 30 minutes count down to zero Arduino rests till another button is pressed (resume) starts the send timer(relay) counts down 10 minutes to zero then activatesLED and buzzer indicates finish.then it goes back to start (waiting to start next day) to repeat program again.I am skilled in electronics ,so I can jerry rig the machine wiring.
I just need a diagram where to put the buttons on Arduino like(A0)and (A1). The other 2 relays are bi passed.
Does this help? I also got the photo from Amazon. Pin on board I don’t know .

  • Relay Shield #1 GND pin is connected to Relay Shield #2 GND pin
  • Relay Shield #1 5V pin is connected to Relay Shield #2 5V pin
  • Relay Shield #1 Digital Pins 8, 9, 10, and 11, are connected to Relay Shield #2 Digital Pins 7, 6, 5, and 4 respectively.

3.Now you can control relays 1, 2, 3, and 4 in Relay Shield #2 using the Arduino’s 8, 9, 10, and 11 digital I/O pins. See sample code below for controlling RELAY1 in Relay Shield #2:

Let's see if I understand the requirement...

  • Wait for start button to be pressed

  • When start is pressed, turn on relay1 and commence 30min countdown

  • After 30m turn relay1 off

  • Wait for resume button to be pressed

  • When resume is pressed, turn on relay2 and commence 10min countdown

  • After 10m turn relay2 off

  • Turn on buzzer and led

  • Back to top

I think that's what you have explained above... assuming that's correct, it's dead simple to code. Could be done with delay() which is usually frowned upon, but seems no reason not to use that approach here.

Couple of questions though:

  • What happens if the resume button never gets pressed

  • What turns the buzzer and the led off

edit... another question came to mind:

  • How does the operator know the system is waiting for either the start or resume button to be pressed?

Of course that always assumes that there need be no other possible action such as aborting either timing schedule.

Something that tends to be missing from the original "description". :grin:

That's exactly what I meant when I said it "seems" to be the case; of course the analyst will work with the client to understand the need fully, before designing the approach and long before any coding is done.