How to measure 60vdc with Uno

I would like to measure the charging voltage from a lawn mower battery charger, with maximum voltage close to 60 vdc. When the charger is running with the battery connected, I measure about 7 vac one each battery lead to earth ground. I was hoping that one of the battery charging leads would be running close to ground, so I could use a simple voltage divider, to get close to 5 vdc output. Since there is so much voltage offset, I am looking at using a PC817 opto isolator. My question becomes: has anyone tried using a Arduino Uno to measure 60 vdc. If so, what technique did you use?

  • How do you think an optoisolator will help you ?

  • If you have access to both ends of the battery bank, a voltage divider should work.

Here's my thinking on why an opto isolator is needed.

  1. The Arduino is powered with a 120 volt to 12 vdc power supply
  2. To me, that means that the ground side of the Arduino is at the same voltage potential
  3. So, wouldn't the ground side of the Arduino input to one of the analog channels also be at ground?
  4. Wouldn't that also mean that when the ground side of let's say A1, is at ground, now it would also have 7 vac running on it.
  5. That voltage potential would then be beyond the 5 volt limitation of the Arduino, causing failure
  6. Using an Opto would isolate the Arduino from this spurious AC voltage

That is my thinking on why an Opto would properly isolate the A1 of the Arduino.

Jim

Are you trying to make beefed silicon? Ok no sorry, there's a special circuit called voltage divider, you could safely lower the voltage from 60 VDC to 5 VDC with some resistances and possibly a potentiometer? then connect the voltage divider output to A0-5 of the Arduino UNO and read the lectures trough the serial plotter

and also: i honestly recommend you to use a multimeter

I understand what you are saying about using a voltage divider, as this would be my first choice for reducing the high voltage from the battery to something that would be safe for the Uno. However, using a voltage divider does not reduce the 7 vac swing on the ground side of the circuit. I am thinking that the 12v power supply causes the Arduino ground to be at the same potential.

Welcome!

If my memory is working properly the PC817 optocoupler was primarily designed for digital signal isolation not analog applications, due to its inherent non linearity and voltage drop variations will make it very difficult to use. For analog signals, consider using a more suitable optocoupler designed for analog applications.

Here is some good reading on opto couplers. https://www.vishay.com/docs/83741/83741.pdf

If you run the Arduino from its own battery or use a wall wart it will isolate the ground. I would recommend you get a cheep multimeter instead, it will help with other Arduino projects.

Yes, using a multimeter would be a very good way to measure the high voltages from the battery.

I should confess that I am trying to measure the high voltage with the Uno, so that when the mower voltage gets to a certain level, the Uno can shut off the charging process to the battery. My intent is keeping the battery voltage to about 80% capacity.

Blockquote
If you run the Arduino from its own battery or use a wall wart it will isolate the ground.

Yes, I was planning on using a PC style power supply. I happen to have an old Dell laptop power supply, and tested it with the voltmeter. Whoops, the ground of the power supply runs at the same level as the wall outlet ground, so that might be problematic. Your suggestion of the Arduino using it's own battery might be a better solution.

INA238 is rated to 80V, IIRC. I think Adafruit has a breakout. As a bonus it can also measure current

cedarlakeinstruments
INA238 is rated to 80V, IIRC. I think Adafruit has a breakout. As a bonus it can also measure current

Thankyou so much, as the INA238 specs are really impressive, and the cost is good too. As I was searching for Opto items, it would have taken me a long time to come across the Adafruit.

It’s probable that the output side of the charger is not referenced to ground ( it doesn’t have one ) or even isolated from the incoming supply . - it might even have the + 60v side connected to supply neutral . It won’t have a 0v ground common to the Arduino , so not surprised you see some AC on it . I can’t really see how to block that AC part with a simple circuit .

  • how are measuring it ? How are you measuring that voltage ?
  • It might have something to do with how the charger operates - not AC mains derived ?

It is likely that the mower has a lithium type battery ( you didn’t say ) and the voltage output off the charger won’t give any useful info on the state of charge of the battery ( could be providing a constant current during charge ? - no idea ) . Without details on how the charger works , you risk damaging something or creating a hazardous situation. 60v DC can be hazardous in damp conditions .

I can’t see why you would want to do this project .

I don't really understand your description, please post a schematic. Hand drawn and photographed is fine.

What does this mean? What are you calling ground? This to me suggests you think ground is some magical point that is universal and the same everywhere in all circuits. Maybe that's just my incorrect interpretation of your words but without a schematic I am struggling to know what you really mean.

The Charger Negative is connected to the Batt Negative , this is your ground / earth reference.

The 7Vac could be the PWM pulses from the charger.
Do you measure 7Vac across the Batt positive and negative terminals?

Does the charger not switch off by itself when the Batt is full?

typically an isolated power supply for both the arduino and the battery circuit have no connection to earth ground, literally a connected to a water pipe, that your house power is connected to

the arduino will measure the voltage on A1 relative to the ground on the arduino. there needs to be 2 connections to the battery to measure the voltage between those 2 points

hence the need for a calibrated divider

don't understand

  • what spurious AC voltages you're referring to?
  • how do you translate a DC voltage you want to measure across an opto-isolator?

Im using two INA238s in a project right now on my own custom board and they work really well. Very accurate and no voltage dividers needed.

Did you test the output for AC ripple? There may be very little filtering in a laptop power block.

As requested, here is a schematic for locations of voltage measurements.

hammy, you are correct, in the charger is for a lithium ion battery. The readings that I got are with the battery plugged into the charger, and with the charger plugged in.

Yes, the battery charger does switch off automatically when the battery is full. However, as you know these batteries are not cheap, and I'm trying to get the longest life from it by cutting short the charge to full. Right now, we have been using a timer to limit the charge, but it would be nice to setup an Arduino to do the same thing.