Introduction: Contactless AC Detector
This instructable idea was like a technical challenge : try to detect the presence of a AC live wire, without contact and without current flowing. The beauty of it is that you'll only need a MCU (arduino nano here), a wire, two resistors and a LED. My plan is to use this design to improve a simple switch with a remote capability without any contact with the cables.
I did not have the original ideas, but I made improvements that gives you much better detection and a signal level indicator which has a physical meaning.
Step 1: How Does It Work ?
Any AC live wire will have an oscillating voltage, 50 Hz for example. Even if it's not very efficient, those wires are antennas and generate an electromagnetic radiation that can be detected (people dealing with "real life electronics" know what a plague this can be...).
The idea is to use an arduino and put a big resistor between an antenna wire and a voltage reference. The big resistor is used to have "high input impedance", which in simple words make it easy to detect a low voltage (what you measure is not modified too much by the circuit), you just link the antenna/resistor output to an analog input of the arduino and you have a decent way to measure the EM field. This idea comes from the following website : http://www.aaronalai.com/emf-detector.
I made one improvement linked with my method of detection : instead of linking the antenna to ground I put it on 3.3 V so that you can actually measure both positive and negative voltage difference. This way you get more signal and you can actually check with an oscilloscope that your analogue input has a beautiful oscillating voltage (not clipped as it would be if you were using a ground reference).
The other improvement is just a basic signal detection method, let's just say you can have a much better detection when you use your knowledge of the signal you're trying to detect : a 50 Hz (or 60 Hz) oscillating voltage. It works a bit like a numerical radio actually !
Step 2: The Circuit
To build the receiver, I used :
- an arduino nano
- a power source (9v battery, 5V USB battery, ...), I used a 5V USB battery
- a small piece of wire (like 10 cm), insulated,
- a 1 Mohms resistor
- a 390 ohms resistor (for the LED)
- a LED (red for me).
Just one warning : Don't get close to unprotected live wires, be careful. This system is not made for that and that is a dangerous idea if you don't know why it's unsafe.
Step 3: The Software
The code is quite simple, it measures the A6 input voltage and makes an estimate of the amplitude of the AC voltage with the signal detection algorithm.
This estimated amplitude is used to modulate the brightness of the LED in a proportional way : no light when there is nothing, full brightness when there is something big enough (less than 0.1V is already a lot).
New : An improved version has been added using a LCD display and a better detection algorithm (the "V4" version).
Step 4: The Results
Well, it's quite nice, it worked for me more than 30 cm (1 foot) away and is indeed more and more bright when you get close to a switch or a live wire. You might be surprised by the difficulty to find a place without live wire close enough, except if you live in a cave and don't have the internet (how are you reading this ?). I added a scope screen copy to show you that indeed there is a real signal with a 50 Hz frequency !
You will maybe get some improvement if you link the ground of the circuit to the earth of your mains, but that's a bit clumsy and you have to be really sure than there is no direct link between your power supply output and your mains (else you will fry something...). If you have an isolated power supply, it will work by linking the negative output to the earth (never do that if the supply is not isolated again).
One last thought : This system only measures the oscillating voltage, you might actually get interesting results with the DC component which is also calculated (but not used).
We have a be nice policy.
Please be positive and constructive.