Arduino Uno programming help needed - relay controls

Hello All. I am a complete newbie to Arduino programming and hope someone can help. I have a project with the following requirements: 1. Detect first relay contact closure. 2. Start a countdown timer upon relay contact closure 3. When the countdown starts, activate a second relay 4. Continue to monitor state of first relay contacts. 4. At the end of the countdown, de-activate the second relay 5. If the first relay contacts open during the countdown, then stop countdown, reset timer and de-activate second relay 6. Go to step 1.

I would also like to be able to manually activate and deactivate first relay via the web/ethernet. Can anyone help with this? Thanks...Arniep

That's all very feasible.

  1. if(digitalRead())
  2. See http://arduino.cc/en/Tutorial/BlinkWithoutDelay
  3. digitalWrite()
  4. while(digitalRead())
  5. if(digitalRead()) inside the while loop
  6. This happens automatically if your code is in loop()

Ethernet takes your sketch from a quick simple little project to a much longer, much bigger project. You probably want to get the first part working and well-tested before introducing the extra complexity of a web server.

Thank you for your information. That should get me started, at least with the easy part. Stay tuned. Take care...Arniep

Hi Arniep, I need to do a code with like yours!!!
Do you have the code finished?
I’m new in Arduino and programming :~

Best