DC Voltmeter

I've the Arduino Mini Board and want to use it to build some kind of DC Voltmeter. Together with a little LCD it will give permanently the status (like batterie power, debug info etc.) of a little robot I'm working on. Does anybody have an idea (and a schematic) how to build that?

Greg

hi

you just need a couple of things...

  • a scaling circuit to change whatever voltage you're reading to a range of 0-5V
  • code to display the value at an analog input pin on the LCD

You could start by setting up the LCD (see the Playground tutorials page under "LCD"). Then, go to your library and get a copy of the ARRL handbook, as they always have a schematic for a DIY voltmeter in it.

D

hi

  • code to display the value at an analog input pin on the LCD

You could start by setting up the LCD (see the Playground tutorials page under "LCD").

D

found that already, that's not really the problem ..... :slight_smile:

hi

  • a scaling circuit to change whatever voltage you're reading to a range of 0-5V

Then, go to your library and get a copy of the ARRL handbook, as they always have a schematic for a DIY voltmeter in it.

D

That is exactly what I'm looking for :-/

In the meantime I found that ... http://www.circuitcellar.com/avr2004/wabstracts/A3780abstract.pdf

But please do not stop to make some suggestions for doing it better.

:slight_smile:

Greg

hi

what range and type of voltage do you want to measure?

One of the important parts of a voltmeter is that it's high-impedance: it doesn't effect the circuit much, because it draws so little current.

D

I want to measure 0-14V. The base current for my vehicle is 12V.

In the first step I want to monitor the power of the batteries, in the second step my plans are to add a solar power device and monitor this and the charging process as well.

Greg

Hi

that will be easy... do a search for "exapnded scale voltmeter", and you will find lots of schematics for measuring battery terminal voltage, many of which are optimized for reading 10-14V on car batteries.

Expanded scale will give you more precision, as 0-1023 represents 10-14V, but if you just want 0-14V, a simple voltage divider will do it. 15V is 3X 5V, so a divider with 100K on the top leg and 50K on the bottom leg will read 15V as full-scale.

D

Thanks Daniel.

I try this in the next few days. I'll come back with the results.

BTW: found another interesting link for this topic. As far as I understood the schematic and the description, it is exactly the way you described !?!
http://www.qsl.net/zl1bpu/MICRO/DVM/AVRDVM.htm

Greg

hi

yes that is it exactly. The lower-left circuit in this diagram is very close to what you want:

He also has very good advice on how to protect the inputs from overvoltage with two 2 cent diodes.

D

Complete noob here. I haven't made the leap into Arduino tinkering yet, but am considering it.

I wanted to ask 2 questions based on this thread:

  1. Can I log voltmeter data from the Arduino, to record changing voltage over time for later viewing/analysis?

  2. By setting up multiple voltage divider circuits on several inputs, can I read (and log) multiple battery voltages concurrently (or essentially concurrently)? I understand there are 6 analog inputs on the board.

thanks
Darin

  1. Can I log voltmeter data from the Arduino, to record changing voltage over time for later viewing/analysis?

yes. One way is to save it in the 512 bytes of EEPROM available. Another (easier) way is to simply print the dta out on the serial port, and let a host computer log it (as simple as running hyperterminal with logging enabled).

  1. By setting up multiple voltage divider circuits on several inputs, can I read (and log) multiple battery voltages concurrently (or essentially concurrently)? I understand there are 6 analog inputs on the board.

Yes. You can even add analog multiplexers and do more than 6; there are active threads on the forums where folks are doing similar things.

-j

Thanks for the reply, j.

I think I'll dive in. Something to play with on rainy days anyway.

I don't want to indulge in thread necromancy...

But I'm just adding a battery-charge detect to a circuit I'm working on. Is a voltage divider (and another resistor to act as current limiter) and a spare analog input all I really need?

My intent is to probe the battery itself, before the 7805, cut the voltage in half with a pair of 1K resistors, and drop one into an analog input pin. My assumption here is that the impedance of the analog inputs is in the 100 kilohm or better range. Cut the voltage exactly in half, pick some arbitrary number below 7 volts for the trigger, and trigger a blinking "battery low" LED at that point.

Any flaw in this plan I should know about? Add a cap to protect from noise, maybe?

Is a voltage divider (and another resistor to act as current limiter) and a spare analog input all I really need?

Pick your voltage divider resistor values appropriately, and they'll current limit for you as well, so you don't need a current limiter. For example, your 1k divider resistors and a 12V battery would result in 6mA through the divider; change these to 2k and it goes down to 3mA. Of course, if your battery is large or this power consumption is small compared to the rest of the system, you may not want to worry about it too much.

-j

Darin (ForkenSwift) is famous for converting a car from ICE to all electric, using a fork lift truck motor... Most of us in the home built EV world have seen his site and read his story.

I'm in a similar situation and just starting down the road of trying to build a battery monitoring system for my conversion, a pontiac firefly with 11 12v batteries in series.

I need to read the voltage of each, one after the other several times a second, and also sum the total battery pack V after each pass. The input circuit needs to read 10 to 15V and be isolated from the arduino for safety reasons.

I know the arduino only has 6 analogue inputs, but ideally can mpx into just one of those.

Can anyone help me with the components to interface the arduino to my battery pack?

Thanks!

Hi,
Is it possible to control voltage scale using digital potentiometer for example DS1803?

How can i get feedback when voltage overload occur so i can software control scale?

TIA for answer.

Regards,
Maciej

How can i get feedback when voltage overload occur so i can software control scale?

Fairly easy to do. The 0-5v analog input reads 0-1023 internally. If you want to read a range of 0-20v , you simply need a voltage divider circuit that scales 3:1. In order to register an overvoltage when your intended scale is 0-20v, all you need to do is shift the divider slightly so 0-5v on one side corresponds to (say) 0-21v on the other. Figuring out the divider is pretty simple. With 100Kohm as the baseline pulldown:

5 R2
—— = ———
21 R1 + R2

with R2 as 100K, you get 100 = R1 / 3.2, which is 320Kohms. Put the analog port on that divider and whenever the sampled 0-1023 value rises above 975, you trigger an "overvoltage" flag and kick the divider circuit up to the next range.

Don't forget overvoltage protection for the analog pin, because a divider is just a dumb circuit. If it's designed to scale 0-20v down to 0-5v, it will slam the analog input with 25v if it's fed 100v.

I am in the same boat as Colin McCubbin. I want to do pretty much the same thing but intend to use somewhere around 45 3.2V LiFePO4 batteries. I want my measuring range to be somewhere in the range of 2-4V. The multiplexing of the analogue readings shouldn't be hard, but I am a little uncertain as to a good technique for isolating the batteries from the Arduino/multiplexer. Originally I was thinking of building one giant voltage meter to determine the whole pack's voltage, but measuring individual cells should be much more expensive and means I don't have to directly handle the full 144V of the pack, plus I get more options when I write my sketch.

Also, I am hoping to get this to measure current as well, but the car will use very high current (500A+). Any idea on a safe, isolated way to measure that and interface with an Arduino?

For 45 batteries, multiplexing the analog reads of the Arduino:

http://www.arduino.cc/playground/Learning/4051

combined with opto-isolated voltage protection ICs:

I predict many wires in your future :wink: I need to upgrade batteries myself in my EV and need such a solution.

-Todd (http://www.tronbikes.com)