On Monday 04 Feb 2013 21:49:18 James Courtier-Dutton wrote:
> Hi,
> 
> I have found lots of web site detailing how to drive a relay from a
> Raspberry PI, for example, turning 240V AC mains devices on and off.
> What I cannot find is how to have the PI detect if 240V is on a wire
> or not. I.e. If a 240 AC wire is powered or not?

> Done anyone know of any sort of "detect 240V AC" adapter for the GPIO
> of the Raspberry PI?

I don't know of any pre-made boards/kits, so it's probably a DIY job.

There are (at least) two ways of doing this. You can either sense voltage, in 
which case you need some form of rectifier, potential divider and buffer 
circuit 
(possibly an optocoupler). There is some info here: 
http://www.edaboard.com/thread206697.html

Alternatively you can sense current, in which case you can use a non-contact 
current sensor (possibly a "current transformer" or hall-effect sensor), and 
some suitable amplification. Some info here: http://talk.jeelabs.net/topic/49

Just be aware that the arduino kit works on 5v DC signal levels, whereas RPI 
works on 3.3v, so although this has been done for Arduino, it will require a 
small tweak for RPI.

There are also a range of mains voltage and current monitoring ICs available 
which will interface nicely with the PI over SPI or I2C, however, these 
require printed circuit boards to be made. Not too difficult, but another thing 
to learn.

Personally, I'd use a current transformer and a suitable interface IC.

Cheers,

Tim B.

-- 
Hampshire Linux User Group Chairman
-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------

Reply via email to