Mains AC Relay Module

This mains AC Relay module uses a 5V relays that can run straight off the Arduino and switch 230V, following the circuit on the arduino website here: relays.pdf

Component list

1x 5V Relay

1x 2N2222 transistor

1x 1N4004 diode

1x 10k resistor

Circuit Schematic

 

Software

Arduino Sketch 

 

I'm sort of following in your

I'm sort of following in your footsteps. I have an Arduino measuring my mains usage for the whole house running a small web server using a Wishield. I blatantly stole your code for the code measurement (thanks for your help with this) and am using Pachube to create basic graphs on the web.

My experience with mains power is pretty high here in the US with our split phase 220 and your relay example may give you a bit of trouble. What I've done for an electric water heater is a 5 volt relay switching a 24 volt supply to a 40 Amp contactor. 24 volt contactors are widely available for use on air conditioning and 24 volt transformers are easy to find for this reason as well as some doorbells. The currents you're going to be working with need BIG contacts and high reliability contactors or you'll be surprised by a failure in the middle of the night.

I recommend a 24 VAC transformer and contactor between the mains and your 5 VDC relay. It's simple enough and will protect your circuitry as well as give you the ability to put the Arduino in a reasonable location.

My plan over the next few months is to implement load shedding based on kW usage of power. So if my usage exceeds some preset number, say 4 kW, I'll start shutting stuff off at the mains distribution panel. Since I live in the desert, the air conditioning is a prime candidate.

dave