Clean thread. Multiple AC current and voltage detection

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?


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.

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

The way forward I believe...

Quite possibly! I didn't know those existed. Might be just what you need.

Well just grabbed a couple off AliExpress for $4 each. Downloaded the Arduino library and the examples....

But there is always something. Goddam Arduino's fry my brain and induce rage sometimes.
When I add it to my project code I get:

HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':

(.text+0x0): multiple definition of `__vector_25'

libraries\DMXSerial\DMXSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here

c:/users/steve/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions

HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':

(.text+0x0): multiple definition of `__vector_26'

libraries\DMXSerial\DMXSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Any ideas how to get around that?

I think that's a separate question for someone else to answer. I could split this topic for you but it would require editing to make sense. Please will you post a new question under Programming questions. You could include a link back to this question to maintain continuity.

Thanks Perry. It's because the DMX library prevents you using any serial ports. What use it that!
No way around it from what I can deduce (lots of other people with the same issue).

Only library I can find that doesn't conflict is the TeensyDMX library.
Maybe I will have to move the project over to a Teensy 3.2 (which is annoying).

Ok. I don't know anything about that library. For your project I just have suggestions for the electronics, I leave the software ideas to someone else.

Good luck with your project.

Thanks for all your assistance Perry. I have abandoned the frustrating world of Arduino's for now.
I swapped the entire project over to a Teensy 3.2 last night, as I know there are no serial conflict issues using a Teensy.

Now the PZEM software for those AC monitoring modules fails to load.
Life's too short to mess around with these annoying things...

C:\Users\steve\Documents\Arduino\10 Way controller\10_way_controller_v6_-_Teensy_3.2\10_way_controller_v6_-_Teensy_3.2.ino:24:24: error: invalid conversion from 'int' to 'HardwareSerial*' [-fpermissive]

 PZEM004Tv30 pzem(22, 23);                                                                                                 // Define the software serial pins for the PZEM modules

In file included from C:\Users\steve\Documents\Arduino\10 Way controller\10_way_controller_v6_-_Teensy_3.2\10_way_controller_v6_-_Teensy_3.2.ino:16:0:

C:\Users\steve\Documents\Arduino\libraries\PZEM-004T-v30-master/PZEM004Tv30.h:65:5: note:   initializing argument 1 of 'PZEM004Tv30::PZEM004Tv30(HardwareSerial*, uint8_t)'

     PZEM004Tv30(HardwareSerial port, uint8_t addr=PZEM_DEFAULT_ADDR);

You probably should start a new question in the programming section, I would guess that the people who might know the answer to you programming questions have skipped past this topic because it's about electronics.