Author Topic: Help with first "high" voltage project  (Read 2183 times)

0 Members and 1 Guest are viewing this topic.

Offline ksovieroTopic starter

  • Contributor
  • Posts: 21
  • Country: us
Help with first "high" voltage project
« on: February 17, 2021, 05:44:53 am »
I'm working on a personal project to monitor the real-time current draw of an appliance that's plugged into it. Similar to some of the smart plugs on the market that allow you to monitor energy usage. However, in my case I'm trying to monitor real-time current usage, rather than the longer-term averages those smart plugs offer. I've never worked with high voltage before (assuming 110VAC counts as "high" voltage around here, I know some of you are working with vacuum tubes, so...)

Now then, I have a few requirements I'm trying to fulfill:

- 15A max current draw
- 110VAC @ 60Hz
- 1 sample per second
- Small amount of power siphoned off for powering MCU

Now, everything from the MCU on (the wifi, API calls, etc.) I can handle no problem, that's smack dab in the center of my wheel house. But everything before that, like the power supply, current sensing, amplification of the current sense resistor values, etc. are way outside of what I have experience with.

First of all, here's the schematic:

https://i.ibb.co/HqVJYjt/Screenshot-from-2021-02-16-23-37-44.png

As you can see, it's broken into two parts. The top part is the current sensing and amplification. The lower part is the 3.3v power supply for the MCU, et al.

So, I have done my best to come up with what I think is the right approach, and I'd love for some feed back and recommendations.
 

Offline bob91343

  • Super Contributor
  • ***
  • Posts: 2675
  • Country: us
Re: Help with first "high" voltage project
« Reply #1 on: February 17, 2021, 06:50:21 am »
It seems overly complex.  But that doesn't mean it won't work.  You don't show the sampling circuit.

Basically you want a recording ammeter.  So what you have produces a signal that is proportional to the current being sensed.  Now what?
 
The following users thanked this post: schmitt trigger

Offline ksovieroTopic starter

  • Contributor
  • Posts: 21
  • Country: us
Re: Help with first "high" voltage project
« Reply #2 on: February 17, 2021, 06:58:16 am »
It seems overly complex.  But that doesn't mean it won't work.  You don't show the sampling circuit.

Basically you want a recording ammeter.  So what you have produces a signal that is proportional to the current being sensed.  Now what?

Well, that's partially because it doesn't exist yet. My current, and terrible, plan is to do it in software. Basically CS_OUT will connect to an ADC input on the MCU and when it needs to get a sample, it will sample repeatedly for 1/60th of a second and store the highest value.
 

Offline uer166

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Help with first "high" voltage project
« Reply #3 on: February 17, 2021, 07:36:14 am »
Is "GND" in your schematic really GND? As in, the one you're standing on? If so, you've shorted the DC link negative to Earth thru the half-wave rectifier D1 and D3. At best, it'll blow the power supply section up, at worst, you'll get a nasty shock. 120VAC is not usually fatal, but it can be.

First step would be to fully isolate the 120V mains from your circuit. Use an off-line fully isolated switching converter. I'd recommend an off-the-shelf module that has AC input and DC output to not fuck around, look for "reinforced isolation" (MeanWell makes some PCB-mount units). The ASC758 is already rated for reinforced isolation, so you're good there. Can't comment on the performance of anything, but step one would be to make everything safe and easy to probe.
 

Offline EEauroro

  • Contributor
  • Posts: 11
  • Country: au
Re: Help with first "high" voltage project
« Reply #4 on: February 17, 2021, 07:54:00 am »
1) I would suggest to include a fuse on your AC input

2) Those capacitors on the AC line has to be X1/X2 rated capacitors

2) Galvanically isolate the AC side to your Logic side (MCU) as this will make things safer and easier. If you do not do that, your MCU side is considered hazardous live and attaching a debugger/ oscilloscope is a dangerous state of affairs. Isolated AC/DC supplies below

https://www.digikey.com/en/products/filter/power-supplies-board-mount/923?s=N4IgjCBcoCwAwFYqgMZQGYEMA2BnApgDQgD2UA2iAMwIBsATAJwDsIxNDjAHG9XU415VaYWiyEjmcekIRda8EAF1iABwAuUEAGV1AJwCWAOwDmIAL7Ew3QdBBpIWPEVIUQcZWs2Qd%2B42fNAoA

3) Also, measuring the AC voltage is useful if you want to monitor the real power consumed (active power vs apparent power). The voltage measuring circuit will need to be galvanically isolated from your MCU as well, things can become complex.

 

Offline richard.cs

  • Super Contributor
  • ***
  • Posts: 1196
  • Country: gb
  • Electronics engineer from Southampton, UK.
    • Random stuff I've built (mostly non-electronic and fairly dated).
Re: Help with first "high" voltage project
« Reply #5 on: February 17, 2021, 09:57:07 am »
The ACS758 is an isolated current sensor, why throw that away with a non-isolated power supply unless you're building some extremely cost-constrained high-volume product?
 

Offline strawberry

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: Help with first "high" voltage project
« Reply #6 on: February 17, 2021, 11:05:05 am »
you need 50A bidirectional ACS758 for 15AC measurement
then need true RMS multiplier IC to get accurate measurement result
 

Offline jonpaul

  • Super Contributor
  • ***
  • Posts: 3591
  • Country: fr
Re: Help with first "high" voltage project
« Reply #7 on: February 17, 2021, 11:10:05 am »
Bravo for your efforts!

But You are in mains voltage 120/240 VAC not "high voltage" usually > 1000V.

You can buy plugin monitors for ! $15, watts, volts, current PF etc.

Beware that pawer analysis needs to account for power factor, as V x A = VA but NOT watts unless a resistive load.

Kind Regards,

Jon
Jean-Paul  the Internet Dinosaur
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3334
  • Country: au
Re: Help with first "high" voltage project
« Reply #8 on: February 17, 2021, 11:16:37 am »
D3 is not strictly necessary but won't hurt.
For D4 and D5 use a 1N5819 40V 1A schottky.
 

Offline larsdenmark

  • Regular Contributor
  • *
  • Posts: 139
  • Country: dk
Re: Help with first "high" voltage project
« Reply #9 on: February 17, 2021, 11:22:00 am »
I would choose an IC with a higher sensitivity (mV/A) since your maximum current is 15 A. If the sensitivity is high enough you may be able to remove the opamp and you can then feed the output directly into the MCU. If the MCU allows you to set the reference voltage to e.g. 1.1 V you can get away with having a lower sensitivity.

If you choose to use the ACS37800 you get simultaneous voltage, current and power measurements and 16-bit AD conversion - and a I2C or SPI interface.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2130
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Help with first "high" voltage project
« Reply #10 on: February 17, 2021, 11:38:12 am »
Buy an IC that does it all. If you just need basic info from your device. CS5463 will do what you want, but there are easier ones to interface to.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 


Offline ksovieroTopic starter

  • Contributor
  • Posts: 21
  • Country: us
Re: Help with first "high" voltage project
« Reply #12 on: February 17, 2021, 04:52:58 pm »
The ACS758 is an isolated current sensor, why throw that away with a non-isolated power supply unless you're building some extremely cost-constrained high-volume product?

Mostly cause I didn't know that was a thing. However, I've since switched it to use one of these: https://www.digikey.com/en/products/detail/mean-well-usa-inc/IRM-02-5/7704628
 

Offline ksovieroTopic starter

  • Contributor
  • Posts: 21
  • Country: us
Re: Help with first "high" voltage project
« Reply #13 on: February 17, 2021, 04:55:30 pm »
3) Also, measuring the AC voltage is useful if you want to monitor the real power consumed (active power vs apparent power). The voltage measuring circuit will need to be galvanically isolated from your MCU as well, things can become complex.

I suppose by your phrasing that my plan of using a diode and a 1/50 voltage divider to measure the AC voltage on an ADC pin is a no-go?
 

Offline ksovieroTopic starter

  • Contributor
  • Posts: 21
  • Country: us
Re: Help with first "high" voltage project
« Reply #14 on: February 17, 2021, 05:07:44 pm »
Bravo for your efforts!

But You are in mains voltage 120/240 VAC not "high voltage" usually > 1000V.

You can buy plugin monitors for ! $15, watts, volts, current PF etc.

Beware that pawer analysis needs to account for power factor, as V x A = VA but NOT watts unless a resistive load.

Kind Regards,

Jon

So, I sorta touched on the reason I can't use one of the $15 off-the-shelf plugin monitors, but basically I want to make this: https://www.digikey.com/en/articles/use-a-current-sensor-to-efficiently-acquire-data

However, I want to make it into a more professional, plugin form factor rather than... what they did. Thus my version ends up being a bit more complex.
 

Offline ksovieroTopic starter

  • Contributor
  • Posts: 21
  • Country: us
Re: Help with first "high" voltage project
« Reply #15 on: February 17, 2021, 05:09:47 pm »
D3 is not strictly necessary but won't hurt.
For D4 and D5 use a 1N5819 40V 1A schottky.

I've since moved to an off-the-shelf PCB mounted power supply (they're amazing, I wish I'd known about them for some of my previous projects.) Having said that, the values were taken directly from the datasheet, and they explicitly recommended a "fast recovery" diode and not a schottky one. I don't know what the difference is, but I figured they knew better than me.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9229
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Help with first "high" voltage project
« Reply #16 on: February 18, 2021, 02:43:05 am »
Do it the simple way by taking the circuit board out of a cheap Bluetooth headset and wiring it to transmit the signal from a shunt rather than the microphone. No isolation needed since you can just package it in a plastic case and your phone or PC safely connects wirelessly.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline uer166

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Help with first "high" voltage project
« Reply #17 on: February 18, 2021, 03:15:33 am »
No isolation needed

Until you need to debug, program, scope some signals, or otherwise do any hands-on work. Just power it from an isolated PSU, it's the persos't first mains project for christssake.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9229
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Help with first "high" voltage project
« Reply #18 on: February 18, 2021, 04:27:14 am »
What is there to "debug" or "program" with a cheap off the shelf Bluetooth headset?
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf