Clean thread. Multiple AC current and voltage detection

Hello all. This subject got touched upon in a different thread about DMX (solved), so I thought it better to start a clean thread.

I have a project that requires an Arduino to monitor up to 5 different AC mains currents (0-16A) and voltages.

The voltages are 110-230v range.

Jremington very kindly pointed me to this resource which is great:
https://learn.openenergymonitor.org/electricity-monitoring/ac-power-theory/introduction

I am an electrical engineer, and fully aware of the dangers of mains AC voltages. I work on fork lift 3 phase chargers alot.... they really will fry your parts if you are not careful!

As usual, this needs to be compact. I am thinking maybe using the current detection method in the link above using CT coils which are readily available.

If we assume worst case of 5x incoming supplies to monitor, then that is 5x Arduino analogue inputs reading 5x CT coils.

My bigger issue is the voltage. I obviously cannot fit 5x AC/AC adapters inside my enclosure.
My thought was to find a very small footprint transformer and build a dedicated AC PCB that housed 5x transformers. But I just cannot find any very small transformers suitable.
That also still takes up a lot of space.

It occurred to me that do I need 5x transformers? I could probably just use one and switch the supplies into it with a Triac (MOC3041?). The load is negligible.
My problem with this is the potential for a Triac failure and therefore accidental mixing of the AC incoming supplies.

You could use 4x small relays to control 5x AC supplies that use DP contacts to provide a logic system to prevent the AC signals ever meeting each other, but then you have relay coils chattering away constantly as it switches to monitor each signal.

Then there are these:

AC Current and Voltage digital gauges

These are ideal, and if I had the room, it would probably pay to simply add these to the project.
But my monitor already has a TFT screen, so it seems pointless adding separate screens for this data.
I imagine (maybe incorrectly) that these Chinese modules sample the AC voltage and current in a less than acceptable way! I cannot find any circuit diagram for such a unit.

I do have a similar version in the garage that displays volts, amps, KW, phase etc. I had a look inside that and its a very complicated little PCB.

Any thoughts gratefully received.

My solution to monitoring AC mains voltage was to build a monitor circuit using a PIC (I know!) that is directly connected to the mains and powered from an isolated DC-DC converter. The PIC sends serial data out through an opto-isolator and is housed in an earthed metal box. The mains is divided down through a high value resistive divider so at mains peak the voltage presented at the input is a little bit below the A2D reference voltage. You could build 5 such devices and switch one serial in using an analogue switch.

Yes, Perry, that sounds an interesting approach.

Just for clarification of use, I make and run the lighting for a small production company (all for free).
3rd party companies often come in and use our switching equipment which is essentially DMX controlled relays. They tend to have 16A inputs and 16A outputs switched with a 24v coil, 40A relay.
These inputs sometimes come from our supply, but are also occasionally run from individual generators (especially when not in our building).
I would like our bespoke DMX panel which has basic graphics on a TFT screen to show the status of the relay to also show the load and voltage of the inputs.

So....

I have one of these cheap Chinese digital voltmeters in my garage at home.... £2.50. I shall take a hammer to it later

Sounds like an interesting project for an interesting hobby :slight_smile:

Well I just pulled apart the Chinese digital voltmeter. Going to reverse engineer it.
Has an un-named 14 pin chip at it's heart (as expected) and runs SMD leds arranged as 3x 7 segments to provide the display, as opposed to an actual display module.

First guess? Some kind of capacitive dropper circuit.

So, maybe the way forward is a small 8 pin processor for each input mounted on the 230v PCB.
I have a whole pile of ATtiny85's in the garage somewhere. Maybe one of these for each input reading the voltage and current, and outputting through an opto-isolator to the main Arduino?

I also have a pile of 4N35 isolators somewhere. Not sure if they would be suitable for serial comms isolation (not tried that before).

I will continue to dig

The problem with capacitive droppers is they are high pass filters, so noise on the mains gets through a lot more easily than the signal you are interested in. I did consider using one for my project but ruled it out for that reason, not to mention the phase shift.

OK. Using my phone as a magnifying thingy, this is what I can determine....

I am guessing the light blue line to pin 9 is the voltage sense?

I don't particularly understand this type of circuit, so I am stabbing in the dark.

Entirely possible I have missed something somewhere. The Led lines drop through to the other side of the PCB.

Some of the components are named the same (E.G D2). No idea what value the Zener is.
I am not up with Zeners, or how they work... would it simply be classed as a 5v Zener?

Could be drawn out better, but its late and MS Paint....

[Mod edit]
Warning
@phoneystark20201 has indicated that he understands the dangers of working directly with mains. For anyone else please be aware that the circuits shown here are potentially lethal if you do not completely understand the dangers and how t mitigate them.

OK... Time to be ripped apart.

Yes, this will be known as point of origin by the fire brigade, but this is my first fault riddled attempt at a circuit.
My thinking would be to build it in sections... see if I can get an acceptable 5v supply and work and run a ATtiny85 first.

I have no idea about using the opto isolators for the serial out (software serial). That is the least of the issues I imagine.

I read in several places that the supply feeding the monitoring circuit cannot be used to actually sample the voltage, hence the separate supplies.

I have never done this before, so I know it not going to be correct. But only one way to learn.

Yea, I need to go to bed. The more I look at that, the less I wish I'd drawn it.
For starters, surely the 9v Zener feeding the voltage divider is always going to be 9v, whatever the incoming voltage.

I think scrap the voltage sense part at the bottom. What's the top supply to the ATtiny85 looking like?

Nite

OK. Indeed, that volt meter that I reversed engineered is providing a (surprisingly stable) 4.4v across the 330uf capacitor (pins 1 and 14 on the IC).

I think the way forward is to reproduce this supply, hook that up to an ATtiny85, and see if I can read amperage using the CT coil I have here.

Then tackle the voltage.

Any pointers for transferring serial data through an opto-isolator would be welcomed.

Hi,
Why small, this appears to be a bit of equipment you are designing to protect some pretty expensive gear.
I would think functionally should be paramount to size.

Tom.... :grinning: :+1: :coffee: :australia:

Main because the entire unit is already built, and there ain't much space in it!

My other idea was to house a voltmeter and ammeter in an 'in-line' type plug+socket arrangement, but that will just get lost and adds another connection to the system.

I am just tinkering, as I think its a reasonably interesting project

I agree, just you may have to look hard and far to find a solution to your size requirement.

Tom... :grinning: :+1: :coffee: :australia:

I used a TLP2962.

If you need to understand how to transfer serial data please study Serial Input Basics - updated - #3 by Robin2

That's an interesting circuit Perry.
So does that sample voltage up to 400v? What does the 5k adjust?

Brain not functioning 100% this morning

By their nature small signal relays are not mains rated. They are just too small.

5k pot is to calibrate it, I calibrated against my multimeter, accurate enough for my purposes.

I'm in the UK, nominal mains voltage 230VRMS, actual mains voltage where I am typically 240VRMS, giving a peak of about 340V, which is ok with that circuit.

As an aside while working on the design and considering capacitive droppers as an alternative I realised I'd derived that sine and cosine are each others integral, which is quite an achievement for me as I always struggled with calculus.

Yea. This is the issue I have. I am TERRIBLE at the math when it comes to designing this stuff.
I am 53, and still not got my head around it. I tried last year to learn all the math involved with circuit design, but I just could not get it.

It's a terrible method, but I tend to work on backward engineering other peoples kit or commercially available stuff and getting my result that way. I don't sell this stuff, its a hobby.

But, that does make it difficult when you try stuff like this.

My current (no pun intended) plan is to replicate the Chinese digital voltmeter circuit and see where that leads.

Peak for a sine wave is square root of 2 times RMS, or just use 1.414 for simplicity.

That Perry, literally means nothing to me. I am ashamed.
I know what RMS is and understand the principles, but don't really know what I am supposed to do with that information.

I really do wish I could get me head around it