Another voltmeter. Help needed.

I read some posts here about making a voltmeter to read ac voltage from mains ac.
Most answers for obvious reasons are about safety concern. Not even direct related to the question.
Some people just say to use a step down transformer. Or rectifies and use a voltage divider I simple don’t want to make this way.

I dig a little in some of my old electronics books, and found a schematic similar to the one attached.

Q1) This ground in Multisim is a real ground ?

Q2) If I build this exact circuit, power the arduino with the battery in the circuit, use an isolated case, this will work ?

Q3) What is the way to make it right ?

Q4) The negative of a battery can be used as ground (-) ?

The circuit is working flawless, in theory, but I don’t know if it will really work.



That is hair raising stuff.

The "ground" marked on the mains supply is AC neutral not AC Earth. If you use a 2 pin mains plug for your voltage divider side, the "Ground" on the Arduino side could be at mains potential, depending on the orientation of the plug !

If you do choose to isolate your Arduino, for example in a plastic box, you can't use the USB cable to connect to the serial monitor or expose any metal parts.

What are you measuring ? peak voltage or RMS voltage and/or frequency and how are you going to display it ?

But really, consider using this instead which claims to be fully isolated: https://www.ebay.com/itm/Active-single-phase-voltage-transformer-module-AC-output-voltage-sensor-ZMPT101B/223492691495

The ADC on an Arduino is designed for source impedance of less than 10KOhms. The circuit won't work.

Use the recommended transformer approach.

Thank you for the answer.

6v6gt: That is hair raising stuff.

For sure it is.As general rule, I do things first and think about later. NOT IN THIS PARTICULAR CASE. :)

The "ground" marked on the mains supply is AC neutral not AC Earth. If you use a 2 pin mains plug for your voltage divider side, the "Ground" on the Arduino side could be at mains potential, depending on the orientation of the plug !

That is one of my points, and FEAR. Assuming that the gnd of arduino is the battery negative, and that the entire board is isolated from any path to real ground (earth) ( special trough the human body lol), connect the live wire to arduino gnd, will do harm to the board in this particular circuit ?

If you do choose to isolate your Arduino, for example in a plastic box, you can't use the USB cable to connect to the serial monitor or expose any metal parts.

Yup, I don't intend to use it on computer, at least while Im measuring high voltage, because of gnd in arduino is connect to a real gnd of the computer. In that case, if i connect the arduino gnd to live wire, some thing for sure will blow.

What are you measuring ? peak voltage or RMS voltage and/or frequency and how are you going to display it ?

I wish to make a kind of do it all, and use a display to show the information, frequency, wave form, peak voltage, rms voltage... Because of that some solutions are not accepted. Like a FULL BRIDGE RECTIFIER. (Any one got the reference, huh ?)

But really, consider using this instead which claims to be fully isolated: https://www.ebay.com/itm/Active-single-phase-voltage-transformer-module-AC-output-voltage-sensor-ZMPT101B/223492691495

The problem is I want to build it myself, (Even if I only do it in simulations) and learn some things in the path. For instance, I had no idea that this second voltage divider (the one on the right) could pull up the negative part of sine wave to a positive range. When I saw it working on Multisim I believed I was doing some sort of witch craft...

There is another simple solution, that is a 3 resistors voltage divider, where I get the voltage potential on the middle resistor, and pass that trough 2 diodes. This way I think does not matter where the probe with the live wire goes. The problem with that is for small signals. What you think about use it, and for low voltages I use a different circuit ?

Also, there is any kind of circuit, maybe port logic with transistor, where I can make the live wire always go to to the same part of circuit ? Or at least don't go to gnd ?

Q2)use an isolated case, this will work ?

Q4) The negative of a battery can be used as ground (-) ?

Yes, that can work. "Ground" is just a reference and the Arduino doesn't care if you connect it's ground to the hot side of an AC line.

That's exactly how a battery operated* multimeter works... The black lead on your meter is probably the internal ground reference but it doesn't matter. (The black connections on my meters are labeled "COMMON" or "COM".)

The most dangerous part of a project like this is the development, debugging, and troubleshooting, where the electronics can't be isolated in a box!

You can make it more-safe (but not completely safe) by using a 1:1 AC isolation transformer during testing. With isolated power, you can't accidently get current from the voltage source through your body to earth ground. You can still get shocked or killed, or fry your Arduino or your computer's USB port, but not through earth-ground or the normal power-line ground. ;)

P.S. When I'm "playing around" with untested/unproven line-voltage circuits I'll sometimes test with 12 or 24VAC (from a transformer). After it's fully-debugged I'll put-on the safety glasses and plug-into the AC line...

I've never connected an Arduino to the power line and I'd do "everything possible" to avoid it with a hobby-project. If you are going into production, you might have production-cost limitations that require a direct connection, but as a hobbyist I'd spend more money if necessary, and build a bigger box if necessary to avoid it. And with a hobby-project, one or two fried Arduino's during development would make the overall cost higher. :P

  • AC powered multimeters have an isolated power supply (as do most AC powered devices), plus any USB or other I/O ports are optically isolated from the inputs (which may have high-voltage applied) and isolated from the main internal "meter circuitry".

Earth (or ground) and 0V are often talked about as if they are the same thing. They are not, although, as they are often connected together, they can often be regarded as the same. 0V (zero volts, often incorrectly called “no volts”) is a point in a circuit designated by the circuit designer. 0V is the point to which all other voltages in the circuit are referenced unless otherwise stated. By definition 0V cannot be noisy. 0V is often but not always the most negative point in the circuit. Earth is that muddy stuff outside. There is only one earth, if you are in any doubt, go outside and look around. In electrical terms when people say “earth” they really mean a connection to earth, often through the earth wire in the premises electrical distribution system. An important thing to consider is that, while there is only one earth, there can be different connections to it and they are not all the same. In the UK (I don’t know about other countries) the earth connection in the building electrical distribution cabling is connected to the incoming neutral wire of the feed into the building before any fuse, meter or isolator. The neutral itself will be connected to the earth (the actual muddy stuff) at the distribution transformer. This means that an earth connection made to the building electrical earth might not be at the same voltage as an earth connection made to a metal stake pushed into the earth outside the building. As there is likely to be current flowing in the neutral back to the transformer then there will be a voltage drop across the neutral wire’s resistance. You can measure this voltage by putting a metal stake in the ground and measuring the voltage between the stake and the electrical system’s earth, most of the time this will be a few volts AC at most. However, if the transformer is hit by lighting then there is the possibility that the electrical system earth could be different from the earth outside the building by many tens or hundreds of thousands of volts, at least for a fraction of a second. Some examples: Something powered by batteries but not connected to anything else has a 0V but not an earth. Many electronic devices, including Arduino, run off a power supply (the USB cable for example) that has its negative terminal connected to earth, so 0V and earth are connected and can be considered the same, and the supply is +5V (or whatever). Many plug in mains adaptors do not have an earth connection (the earth pin is made of plastic), so anything running off them does not have an earth unless otherwise provided. In my industry, telecoms, the positive pole of the supply is connected to earth, so the equipment runs on a -50V supply. Analogue audio equipment typically runs off a split supply of -15V, 0V +15V, so it is the middle of the supply that is connected to earth, not the most negative part.

I posted that because in the circuit what is labelled as ground is actually 0V, NOT ground. Once you realise they are not the same it becomes easier to see that this circuit is not safe, for reasons given by others. If you want to connect directly to mains you have to decide how you are going to isolate the mains from any outside connections, the circuit shown does not have any isolation and is not safe under any circumstances.

I have a circuit for measuring mains in one of my projects. It has a PIC directly connected to the mains. It is powered through an isolated DC-DC converter (1000V isolation I think) and the output is serial data fed through an opto isolator. The circuitry is in an earthed metal box with a piece of plastic between the circuit board and the box.

PerryBebbington:
Earth (or ground) and 0V are often talked about as if they are the same thing. They are not, although, as they are often connected together, they can often be regarded as the same.
0V (zero volts, often incorrectly called “no volts”) is a point in a circuit designated by the circuit designer. 0V is the point to which all other voltages in the circuit are referenced unless otherwise stated. By definition 0V cannot be noisy. 0V is often but not always the most negative point in the circuit.
Earth is that muddy stuff outside. There is only one earth, if you are in any doubt, go outside and look around. In electrical terms when people say “earth” they really mean a connection to earth, often through the earth wire in the premises electrical distribution system.
An important thing to consider is that, while there is only one earth, there can be different connections to it and they are not all the same. In the UK (I don’t know about other countries) the earth connection in the building electrical distribution cabling is connected to the incoming neutral wire of the feed into the building before any fuse, meter or isolator. The neutral itself will be connected to the earth (the actual muddy stuff) at the distribution transformer. This means that an earth connection made to the building electrical earth might not be at the same voltage as an earth connection made to a metal stake pushed into the earth outside the building. As there is likely to be current flowing in the neutral back to the transformer then there will be a voltage drop across the neutral wire’s resistance. You can measure this voltage by putting a metal stake in the ground and measuring the voltage between the stake and the electrical system’s earth, most of the time this will be a few volts AC at most. However, if the transformer is hit by lighting then there is the possibility that the electrical system earth could be different from the earth outside the building by many tens or hundreds of thousands of volts, at least for a fraction of a second.
Some examples:
Something powered by batteries but not connected to anything else has a 0V but not an earth.
Many electronic devices, including Arduino, run off a power supply (the USB cable for example) that has its negative terminal connected to earth, so 0V and earth are connected and can be considered the same, and the supply is +5V (or whatever).
Many plug in mains adaptors do not have an earth connection (the earth pin is made of plastic), so anything running off them does not have an earth unless otherwise provided.
In my industry, telecoms, the positive pole of the supply is connected to earth, so the equipment runs on a -50V supply.
Analogue audio equipment typically runs off a split supply of -15V, 0V +15V, so it is the middle of the supply that is connected to earth, not the most negative part.

Even if that is a really simple concept you was been of great help, because in many situation I do miss use the terms. I will use more careful approach when I need to refer to earth, gnd, and 0v to void mistakes. Into a rectifier bridge, what the negative side is named ? 0V ?

DVDdoug: Yes, that can work. "Ground" is just a reference and the Arduino doesn't care if you connect it's ground to the hot side of an AC line.

That's exactly how a battery operated* multimeter works... The black lead on your meter is probably the internal ground reference but it doesn't matter. (The black connections on my meters are labeled "COMMON" or "COM".)

That is what I think. For now I only have one arduino board, because of that I should not test it right now. One friend of mine told me that it may damage the mcu, if probes are connected wrong the voltage in the GND of the board may exceed the mcu limit of safety operation.

chicao: Even if that is a really simple concept you was been of great help, because in many situation I do miss use the terms. I will use more careful approach when I need to refer to earth, gnd, and 0v to void mistakes. Into a rectifier bridge, what the negative side is named ? 0V ?

What is called 0V is down to the circuit designer. Often the negative of a bridge rectifier will be 0V, but as I mentioned, 0V can be the positive of the supply, or the middle of the supply. 0V is 0V by definition, as in, whoever designs the circuit defines some point in the circuit as 0V, then that is 0V. It might or might not be the negative of a bridge rectifier.

PerryBebbington: I posted that because in the circuit what is labelled as ground is actually 0V, NOT ground. Once you realise they are not the same it becomes easier to see that this circuit is not safe, for reasons given by others. If you want to connect directly to mains you have to decide how you are going to isolate the mains from any outside connections, the circuit shown does not have any isolation and is not safe under any circumstances.

I have a circuit for measuring mains in one of my projects. It has a PIC directly connected to the mains. It is powered through an isolated DC-DC converter (1000V isolation I think) and the output is serial data fed through an opto isolator. The circuitry is in an earthed metal box with a piece of plastic between the circuit board and the box.

Is it free, can you share the schematic ?

Is it free, can you share the schematic ?

I could, not sure. It uses a PIC, this is an Arduino forum. I don't want to share my code, which is in any case no use unless you know what to do with a PIC.

. One friend of mine told me that it may damage the mcu, if probes are connected wrong the voltage in the GND of the board may exceed the mcu limit of safety operation.

Yes. Of course the Arduino can be fried with too much voltage across it, or with reversed voltage or with too much voltage (or reversed voltage) on an inpu pin, relative to it's ground.

This is dangerous stuff and it's potentially dangerous to you, your Arduino, your computer, and even your house if you generate enough heat to start a fire!

For example, you can apply +1000V (relative to earth ground) to the Arduino's ground and +1005V to the 5V terminal and the Arduino will be perfectly happy because it's only "seeing" the 5V difference. (But in the real world you are likely to burn-up an Arduino or two playing around with something like that, or something worse could happen.)

A bird can sit on a high-voltage transmission line and no current flows because there is no return-path or reverence... There is zero-voltage across the bird, so as far as the bird is concerned there is no voltage.

Multimeters always have some kind of [u]over voltage protection[/u] that works up-to some limit. One of my meters is rated to 600VAC. You can have your meter set to a low-voltage range and connect it to the power line and nothing bad will happen... You'll just get some kind of over-range indication. (You can blow the fuse in your meter if you do something wrong when measuring current).

chicao: Is it free, can you share the schematic ?

Right, sorry, no.

The schematic is hand drawn with enough detail for my own use, but is incomplete and would need some work before I would be willing to publish it.

It's a PIC project, this is not a PIC forum.

It's useless without the code, the code is PIC and this is not a PIC forum. In any case, even if I did share the code I'd probably then have to explain it, which I don't want to do.

The electronics part is simple, it is a resistive divider between mains live and neutral, feeding into an A2D input pin. There is a 0μ1 capacitor to remove noise.

If you need someone to provide you with a schematic for something directly connected to the mains then I worry that you (or, perhaps more to the point, anyone else reading this) don't know enough to use it safely.

The most important thing about it is not how it works but that it is completely electrically isolated from external circuitry, by the means I have already described. As long as its box is earthed (and I do mean earth, as described) and the lid is on the box, then it is safe (I hope!).

I apologise if that disappoints.

I think if one has to ask if the proposed circuit would work, he shouldn't even consider messing with mains voltages. Unless one has thorough understanding of the earthing system, playing with mains voltages poses serious risks of electrocution and/or fire.

I wont even offer any technical advice. Just stay away!

This does not exactly answer the OP's question but does illustrate how attitudes to mains electricity by hobbyists have changed over time.

This design appears in a 1965 edition of "Fun with Radio" by Gilbert Davy. The high tension for the valves was simply rectified mains voltage.

It came with some cursory safety advice also.

Watcher: I think if one has to ask if the proposed circuit would work, he shouldn't even consider messing with mains voltages. Unless one has thorough understanding of the earthing system, playing with mains voltages poses serious risks of electrocution and/or fire.

Well, this is true.

I wont even offer any technical advice. Just stay away!

Well, nobody is complain or crying about that. Neither nobody will ever force you to do so. But since you comment such useless information, here is mine: If I come across some one that is doing a stupid thing, and I'm able to advise him or teach him the right way execute the task, for sure I will teach him.

6v6gt: This does not exactly answer the OP's question but does illustrate how attitudes to mains electricity by hobbyists have changed over time.

All information have value. Also I think this specific post have some historic value.