Measuring Voltage at the alternator for NMEA2000 use Q

vas

Well-known member
Joined
21 Jun 2011
Messages
7,958
Location
Volos-Athens
Visit site
hello,

a quick question to the arduino/ pi, electrics/onics ppl.
I want to measure voltage not current at the two alternators and pass it on to arduinos mounted on the engines (one each) which will convert it to NMEA2000 and send it throughout the bus.

Any reason I should not use a simple voltage divider to drop my 24 - max 28+ volts to 0-3V3 before inputting them to the arduino???
I guess not, just wanted to confirm.

And no, not really interested in measuring how much current goes to where, the Victron takes care of that, main worry is to spot a regulator failure before cooking any batteries.

cheers

V.
 

Lon nan Gruagach

Active member
Joined
12 Mar 2015
Messages
7,172
Location
Isle of Eigg
Visit site
hello,

a quick question to the arduino/ pi, electrics/onics ppl.
I want to measure voltage not current at the two alternators and pass it on to arduinos mounted on the engines (one each) which will convert it to NMEA2000 and send it throughout the bus.

Any reason I should not use a simple voltage divider to drop my 24 - max 28+ volts to 0-3V3 before inputting them to the arduino???
I guess not, just wanted to confirm.

And no, not really interested in measuring how much current goes to where, the Victron takes care of that, main worry is to spot a regulator failure before cooking any batteries.

cheers

V.

No reason why not but....
Go a bit under 3v3 (thats the max for arduino?) and... try to make the dividers out of a single value resistor all taken from the same batch. Unless you want to fork out for high precision. 0.1V of 24V can be significant and is less than 1%...
and diode clamp it!
 

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,395
Location
Hopefully somewhere warm
Visit site
hello,

a quick question to the arduino/ pi, electrics/onics ppl.
I want to measure voltage not current at the two alternators and pass it on to arduinos mounted on the engines (one each) which will convert it to NMEA2000 and send it throughout the bus.

Any reason I should not use a simple voltage divider to drop my 24 - max 28+ volts to 0-3V3 before inputting them to the arduino???
I guess not, just wanted to confirm.

And no, not really interested in measuring how much current goes to where, the Victron takes care of that, main worry is to spot a regulator failure before cooking any batteries.

cheers

V.

Should be OK but might be worth splashing out on an ADS1115. Much higher resolution and accuracy plus big benefit is you can measure the differential voltage between the output & local neg without worrying about earth loops. Still need to drop the voltage though.
A few quid on ebay.

https://www.adafruit.com/product/1085
 

vas

Well-known member
Joined
21 Jun 2011
Messages
7,958
Location
Volos-Athens
Visit site
No reason why not but....
Go a bit under 3v3 (thats the max for arduino?) and... try to make the dividers out of a single value resistor all taken from the same batch. Unless you want to fork out for high precision. 0.1V of 24V can be significant and is less than 1%...
and diode clamp it!

since I'm not that much into electronics, could you care explain what the diode would do (and of course how to wire it!)
Got a few more voltage dividers feeding analogue pins on due and teensies with 3V3 max (although they theoretically would tolerate 5V...)

Should be OK but might be worth splashing out on an ADS1115. Much higher resolution and accuracy plus big benefit is you can measure the differential voltage between the output & local neg without worrying about earth loops. Still need to drop the voltage though.
A few quid on ebay.

https://www.adafruit.com/product/1085

thanks for the pointer, but since I'll do one box (with one ESP32 each) for each engine the 4inputs are going to be wasted, just want to report the output of the alternator, so I'll probably go for the voltage divider.

Sir Dougal,

R1 = 4.7kΩ
R2 = 560Ω

should be OK, right?

V.
 
Last edited:

rszemeti

Active member
Joined
17 Jul 2018
Messages
738
Location
Bewdley, Worcs
Visit site
The other way (there is always another way ;) ) would be to consider that the range you are interested in is the 20 to 30V range ... below 20V you really don't care, but you probably want all the precision you can get within the 20 to 30V range no?

So use a 20V Zener to "drop" 20V off the signal, and then drop the remainder into a 3:1(ish) divider. Don't worry about the precision of the resistors or the Zener, just measure the actual result with a multimeter and use suitable values in the conversion routine.

I'd put a series resistor, a 0.1uF cap and pair of clamp diodes on the input, justin case.
 

Mistroma

Well-known member
Joined
22 Feb 2009
Messages
4,909
Location
Greece briefly then Scotland for rest of summer
www.mistroma.com
Something like this would probably do as well if you do change your mind about the ADS1115. Even if you ignored the ADS115 and measured directly from an Arduino pin you might still get around 0.1V resolution. Post above shows a better way for direct measurement as measurements will be confined to a narrower range.

SchematicVoltageMeasurementGeneral.png]
 
Last edited:

Lon nan Gruagach

Active member
Joined
12 Mar 2015
Messages
7,172
Location
Isle of Eigg
Visit site
The other way (there is always another way ;) ) would be to consider that the range you are interested in is the 20 to 30V range ... below 20V you really don't care, but you probably want all the precision you can get within the 20 to 30V range no?

So use a 20V Zener to "drop" 20V off the signal, and then drop the remainder into a 3:1(ish) divider. Don't worry about the precision of the resistors or the Zener, just measure the actual result with a multimeter and use suitable values in the conversion routine.

I'd put a series resistor, a 0.1uF cap and pair of clamp diodes on the input, justin case.

This is good, calibration instead of hoping for component accuracy.

But.. as requested, and sorry I dont got the fancy drawings....
R1 = 4.7kΩ
R2 = 560Ω

should be OK, right?

for the 4k7 use 3 560R in series and from the same batch. Otherwise you will fall foul of the component tolerances (which is why calibration is a great idea)

When resistors are made they set up the process to aim at the desired resistance. Within a batch there is little variation, but the whole batch may be off.... So each one is measured and painted accordingly. This means that a resistor marked as 10% is unlikely to be a 1% since it would have been marked a such.

Lets say that you did use a 4k7 and a 560R, the first being 1% over and the second 1% under... your divider is 2% out already! But stick to the same batch and make up values to suit and you can cheat the system..


edit add:
Sorry, I forgot the diode bit...
Many IC inputs are high impedance, this means that its easy to over cook an input. Good practice to put a diode from the input to the positive supply rail so that it conducts when the input pin would go way high. Often a series resistor wont be enough and can fudge the levels. Imagine if your voltage divider lost its bottom leg... You would ave 24V going into the input... not a great situation.
 
Last edited:

lw395

Well-known member
Joined
16 May 2007
Messages
41,951
Visit site
Two significant things to consider are filtering of AC components and 'ground' errors.
Be clear about what your reference points are, as in yacht systems, significant voltage drops around the various 0V wiring are not uncommon.
Have a clear idea about how accurate you want to be. Depending on the purpose of your measurement, you may need to take a lot of care, or it may not matter.
 
Top