Photo credit: Windell H. Oskay, www.evilmadscientist.com bridell.com
on creative engineering and new media art

Switching and reversing arduino relay shield

November 14th, 2007

Switching and reversing arduino relay shield (photo)

This is a little thing I made for artist Petra Vargova. It’s a home-made “shield” for the Arduino, i.e. this circuit fits on top of an Arduino board. (Indeed, it is sitting on top of an Arduino in the photo).

It’s not made using an Arduino shield PCB (which would be much more elegant) but just made using a piece of stripboard and some pin connectors. It contains two relays – two omron G6S-2 4.5 VDC relays.

Switching and reversing arduino relay shield (sketch)

It works like this: The lower relay is used for reversing polarity. It’s got plus and minus coming in on its input pins (the second from the right on top and bottom). When the lower relay is off (the control pin labeled reverse is low) the power is just connected straight away to the load. When the “reverse” control pin goes high, the power comes out on the two rightmost pins on the relay, which are connected to the load in reverse.

The top relay is just a switch that switches to positive input on and off.

To control it you just need two digital pins on the Arduino, one for the main on/off and one to reverse polarity.

Switching and reversing relay shield – arduino code