AC Mains contactless detection with DIGITAL out

Because it's a while ago, i just rebuild that circuit. It's amplifing everything around and the LED is just dimming from very low to bright. Far away from a clear on/off - not even close to a reliable information. Good enough for a analog hand detector to locate a main in the wall more or less...

The main problem with this circuit: The LED is "controled" over the current so there is always the full voltage thus nothing to detect for a digital in..

You need the circuitry that's in one of these:
Non contact voltage tester

I believe those things are basically an RC oscillator that stops oscillating when brought near a 50 or 60HZ voltage over 90VAC and switches an LED on.

Did you build the circuit in @GigaNerdTheReckoning 's Jameco link with only 3 transistors?

That circuit isn't designed for use with the arduino like the 4 transistor circuit shown in the second github link.That circuit adds an extra transistor + components for a "charge pump" that allows it to work on 5 volts with a steady state output.

Here is a video to go with the github link that shows how it works: #114 No contact mains detector for Arduino & Pi :pie:(just 10 components)

1 Like

The circuit works also with 5 Volts, that's not the problem. The issue is that the brightness of the LED is controlled with current, not voltage.

That sounds much better... does anybody knows a schema?

Buy one of those cheap
Mains detector pens and use an LDR to detect when the neon lights

Examplr

These circuits as you say are very sensitive to stray RF and also static sensitive.
To be CERTAIN and get a true digital response you need to add two things:
firstly a band pass filter - to reject very slowly (static) or quickly (RF) changing signals;
you can easily do this with a simple op amp circuit

and
second, a device that will recognise the presence of a mains frequency SIGNAL, and give a positive response.
thats an easy job for an arduino.

https://www.princessauto.com/en/70-to-1000v-non-contact-ac-voltage-tester/product/PA0008436727

image

IMHO that's a very similar circuit to the first on on this topic - the brightness of the LED is over current not voltage. Normaly i take a optocoupler between such circuits and the arduino side to be on the save side.
IMHO due to the fact it's done by current and not voltage a band filter will help no further.
Another problem with these high gain amps: When you move the cable or the antenna just a bit results in a wild disco style light show. Ergo: IMHO also not very reliable.

I think these simple types works also analog. I saw a digital one on aliexpress which seems to act digital. There must be a chip somewhere in this wide world...

Good idea. The simple works also analog but i found some in the net with a digital logic. I will order one of those and disassamble. But to find a chip is still the goal...

Thats because they detect an electric FIELD (not current) so they are static sensitive - hence the need for filtering.

You do realise this is an ARDUINO forum?

Exactly- and then amplify this as variable current with the voltage of the supply.

Yes. Call it "Breakout Board" if this fits more - the chip on it is it.

And the "General Electronics" section is the right place to post about the OP's problem, and using an Arduino to detect the mains voltage. What is your problem?

You dont seem to understand this: the electric field they detect is NOT digital. So you need to
"CONDITION" the signal, then set a level that will be registered as a digital 1 or 0.

This is basically a 1 bit ADC.
ANY digital input pin of an arduino IS a 1 bit ADC.

Signal conditioning in this context is managing the bandwidth to exclude unwanted interference; and applying enough gain to match the very weak signal to the range of the ADC.

Here is one way

Do you see any suggestion the OP wants to use an Arduino? Which one?

I do and you are right, maybe my posts were unclear.

Have you already built the scheme you posted? Looks good. Is this your design or do you have a source? I would like to build that and add a optocoppler or a TTL shifter, i need 3v3.

Thank you!

Did you Google non contact voltage tester circuit

Yes. And i built 4 circuits that looked promising on the corresponding videos.

Yes I've built it and it works but my testing is limited as I dont have a 'scope.
However its very complicated for what it does - mainly because of the need for biasing the op amps.

I'm convinced a simple circuit could be built around a single CMOS hex inverter IC.
A bit like this circuit

Many years ago I designed a bat detector circuit that used VERY few components, based around a HEF4069UBP hex inverter; using the fact that a CMOS hex inverter can be a ( very non-linear) simple amplifier by applying negative feedback.
With a gain of 1000 for three stages, you can build your whole detector circuit with just that one chip and a few external components.

https://skillbank.co.uk/bat_detectors/fd2.html

I'll put up a suggested circuit later.