Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Voltage divider - reading AC waveform in Microcontroller

Would you use the original schematic?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    0
Status
Not open for further replies.

Yobortsa

Member
Open Energy Monitor promotes a simple way of measuring AC voltage using an AC adapter (9V transformer). Here is an example on a breadboard with an Arduino:

https://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor

If you use their schematic and the microcontroller is NOT powered but the AC adapter IS, the microcontroller would surely end up with an AC current being fed into the Analog input. Schematic shown here:

https://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter

Could this harm the microcontroller? If so, how can you protect the analog input in the case the microcontoller isn't powered but the AC adapter is?

Any comments?

David
 
I don't see this hurting the arduino even if you hooked it up unpowered.. Powered the A0 pin would see about 2.499 volts unpowered it's about 89mV. so it should not hurt the chip
This is powered View attachment 69166
And even with the uno unpowwered the 89mV would all be on the ground based on the simulations.
This is unpowered View attachment 69167
 
Great schematic tool you're using there Burt.

The voltage divider Open Energy Monitor are recommending uses 10k ohm and 100k ohm resisters; from what I see you've drawn 1k ohm and 100k ohm. They quote an output voltage swing of plus/minus 1.15V:

https://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter

"If the arduino is running at 5V the resultant waveform of the circuit has a positive peak of 2.5V + 1.15V = 3.7V and negative peak of 1.3V satisfying the arduino analog input voltage requirements and leaving plenty of room so that there is no risk of over or under voltage."

The second voltage divider lifts the sine wave and centres it at 2.5V, which is fine if the arduino is powered. My concern is that if somebody unplugs the arduino and leaves the AC adapter plugged in, all of a sudden the analog input is surely swinging at AC 60Hz between -1.15V and +1.15V. Is that an issue? Can arduino or PIC microcontrollers handle some AC into an unpowered chip? Or is there something I'm not understanding?

Thanks,

David
 
The two diodes on the port pins will feed the power to the ground and VDD but it's so low that's there no way it could run the chip. And from what i see the most that that could happen is there would be .5 volts feeding the rail at 108 micro-amps which is well inside of spec.

In simulation it's feeding 3uA and @ 168mV
 
Last edited:
No worries, I'll roll with it and see how it goes. Thanks for your help Burt. It will be interesting to see what supply voltage I'm getting and how it varies over time...

Thanks,

David
 
Status
Not open for further replies.

Latest threads

Back
Top