Help with programming Arduino for RELAY and LED Control

I am new to Arduino and am having a tough time figuring out how to write a program for this. Output Shunt Relay. I have attached a pdf sketch to explain.

PIN2 = RELAY1 (Input) N.O.
PIN3 = RELAY2 (Input) N.O.
PIN4 = PUSHBUTTON (Input) N.O.
PIN5 = LED (Output)
PIN6 = RELAY3 (Output) N.O.

When N.O. RELAY1 is closed, LED is illuminated.

When PUSHBUTTON is Pressed LED goes dark and N.O. RELAY3 closes.

When PUSHBUTTON is pressed again LED Lights up and RELAY3 opens.

When N.O RELAY2 is closed, LED is dark.

Any help or suggestions would be greatly appreciated.

contact_CNTRL_bypass_2-7-14.pdf (468 KB)

and am having a tough time figuring out how to write a program for this.

Having a tough time figuring out where and how to post, too. This section of the forum deals with THE Arduino project, not YOUR Arduino project. Feel free to set up your own forum for your project.

What have you tried? What is connected to what?

I don’t think the diagrams in your PDF are appropriate for connecting relays to an Arduino. In general you need to get the Arduino to control a small transistor and for the transistor to control the relay coil current.

As far as the logic of your system is concerned write down what you want to happen with one step of the process on each line.

Then the Thread planning and implementing a program should give you the general idea about how to turn that into a program.

The examples that come with the IDE cover most (or all) of the techniques you will need.

…R