EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   Instrumentation (https://ecomodder.com/forum/instrumentation.html)
-   -   USB Voltmeter? (https://ecomodder.com/forum/showthread.php/usb-voltmeter-5958.html)

anton_x 11-11-2008 10:04 PM

USB Voltmeter?
 
Hey,
New to the board, as recommended by a user here. I currently just accepted a project to create a GUI to monitor two things: voltage across twelve batteries of an electric car, and to monitor the overall voltage of an electric car. Ideally, I want to create a Java GUI that reads an input from several voltmeters. Any suggestions?

MetroMPG 11-11-2008 11:00 PM

The Arduino platform can be set up as a multiple battery voltmeter, and it can spit out its data stream via USB. Not sure if that's what you're after though. (There are probably better solutions, but when the only tool you have is a hammer....)

anton_x 11-11-2008 11:50 PM

Can I monitor each battery independently? I need to monitor a minimum of twelve batteries, and the whole circuit (13), and it would be a plus if I could monitor two auxiliary batters. It's for a research project, so money isn't much of a factor. Grants will (hopefully) be paying for it.

Yoshi 11-12-2008 02:06 AM

The Arduino platform has six analog inputs, 0 to 5V range from ground.
You need voltage dividers for above 5V measuring, and three Avrduino's will have up to 18 analog input.

Commercial products look very expensive, such as following for 8 channel.
8 Channel Voltage Data Logger

Ken@Japan

dcb 11-12-2008 05:37 AM

You can also use something like a 4051 to "multiplex" your analog inputs. They can turn one analog pin into 8:
Arduino playground - 4051

They are like $0.47 from mouser. And you have 6 analog pins on the typical arduino. So you will want a couple 4051s.

HCF4051BEY

If your usb can power the voltage monitor, I would say get an iDuino kit for $18. iDuino : Fundamental Logic WebStore, Electronic Kits and Components

so with one *duino and two 4051s (and a bunch of carefully selected resistors) you should be able to build something that can monitor up to 20 voltages
and send a data stream to a laptop, for about $25 all told.

One of the tricks here is that voltage is measured to ground, and you have to select different voltage dividers for each battery connection as you want to limit the voltage to max 5 volts per probe.

I would also suggest using old phone/network cable for the hookup to the batteries.

MazdaMatt 11-12-2008 12:39 PM

Something simple like an iDuino with USB support is a good plan, but i would recommend sourcing an ADC that can handle higher voltage. Voltage dividers = leakage current, and referencing to ground is not really an option, you want to reference across the battery. Granted, you can reference each node of the network of battereis to ground and do the math, but you're better off with two wires per battery leading to an adc that can handle it. They, too would be cheap. Check out Digi-Key Corporation - USA Home Page

dcb 11-12-2008 01:33 PM

Quote:

Originally Posted by MazdaMatt (Post 72087)
but you're better off with two wires per battery leading to an adc that can handle it.

Sorry to bust your chops here matt, but you have not given any specifics (i.e. a chip #). I don't know how one can make an assertion about betterness without discussing the specifics here.

I would agree it is another option, at best, but would probably be more work due to lack of previous arduino examples and lack of specifics from its suggester.

the divider leakage current can be accomodated with large resistors and a common ground under cpu control if sleep mode is desired.

Did you have a specific ADC in mind? What is it's leakage current and how much support circuitry does it need, and do you have to buy one for every battery, and is there prior open source work that the OP can build off of (schematics, code, etc)?

MazdaMatt 11-12-2008 01:47 PM

Wow, i just got seriously chewed out for some suggestions...

OP didn't say he was incapable of working with electronics and he didn't say he wanted an open source option. I work with this stuff every day and that's what I would have said to someone in a meeting room if they asked the same question. If he wants details and likes where i'm going, then he can ask me another question.

No, i did not select specific part numbers for him because I assumed that he was capable of doing so using the very simple parametric search on digi key. I don't know what his system voltage is, what the processor voltage is, what the space constraints and budget are, if he is capable of using SMT, what busses he may have available, etc.

I don't like voltage dividers because of the leakage current as well as the tuning required for every single one due to resistor tolerance, and I like the idea of 2 wires per battery so that he is always reading in the same range of voltage (which allows selection of an ADC best suited to that voltage range). One wire at each battery would mean that he is measuring 12v at the first one, 24 at the second, 36, 48, etc. This requires a variety of ADC's. There MAY also be complications to connecting the pc ground to the car ground, which are avoided with 2-wire. I currently have two projects on the go that are acting little sketchy because the customers are connecting my digital grounds to their pc and analog grounds.

dcb 11-12-2008 02:19 PM

Quote:

Originally Posted by MazdaMatt (Post 72102)
Wow, i just got seriously chewed out for some suggestions...

You were being presumptuous. You said your solution was better but refuse to back it up with a specific example. All you have to do to back it up is cough up a schematic and some part numbers.

My guess is that it will be, and I've been wrong before:
more complicated
more costly
more difficult to implement

and there's no way to tell if it will leak enough less to matter, if indeed it does leak less (need to look at the adc datasheet).

So can you please produce a schematic for my edification?

dcb 11-12-2008 02:22 PM

It is worth noting that if you get a 0 volt battery, then you will get some strange readings from the other batteries if you have to "do the math"

MazdaMatt 11-12-2008 02:25 PM

Uhm, no... because it was JUST A SUGGESTION. The reasons were given in my reply. As well, for the reasons given in my reply, i can't select a part number because i don't know the parameters of his project. I don't understand why you're being so persistant about this?

I suppose that "better" is highly dependant. For some people, a geo metro is better than a Enzo Farrari... but the farrari is definately more complicated, costly and difficult to build. I think in terms of accuracy and reliability. You will get better accuracy if you do not leave it to resistive dividers and instead use ADC's specifically designed for the intended voltage range.

If it is a quick and dirty hack job you are looking for, then by all means use an analog multiplexer and resistive dividers... whoever is paying for it may want better.

dcb 11-12-2008 02:35 PM

anyway, getting back to constructive and non presumptious things:

There may be another option that builds on Matts suggestion, that is both easy to hook up and not terribly expensive, and that is to utilize atmels I2C (or 2 wire) protocol, and make a bunch of attiny devices on that network that monitor the batteries (perhaps one attiny can monitor a pair of batteries or something). So each battery (or pair of batteries) gets a chip and get strung into the i2c network.

The floating grounds might be a problem though, if it were easy to make the attinys autorange in relation to ground, or if Matt has a chip suggesion for a floating ground adc that might prove helpful too.

MazdaMatt 11-12-2008 02:52 PM

er... be very careful about using I2c over range. It really is a bus better (there's that word again) used between chips on a board rather than wired between boards. RS232, CAN, even TTL serial or parallel are better options for that. The reason being the resistance and capacitive limits of I2C are very small.

Finding a good I2C chip is a great idea because you don't need many ports on the processor (it is a 2-wire bus that allows multiple components to connect together and to two pins on the cpu). I still would recommend running a wiring harness to each of the nodes of the battery net and keeping your ADC's all on one board.

Digi-Key Part Search

The link above will get you to the parametric search on the digikey website under the ADC section. You select your bus (I2C, serial, whatever) then select your voltage range, temperature range, your chip package (dirt-sized SMT or big honkin DIP packages) and all the other necesities. It will allow you to find multi-channel adc's and (literally) all the other options out there.

Another caveat with I2C components... some of them (including the I2C ADC that is on a board that I am currently working with) have a fixed adress, so you can't put multiples of the same chip on the same bus or they won't know which one is being adressed. If you can't find a way around this, you will have to use an analog multiplexer to feed into a single adc.

ps - what's an attiny device?

MetroMPG 11-12-2008 10:51 PM

Anton, I may have mistakenly assumed that you were looking to build the whole thing from scratch.

If that's not the case, you may want to look at this:

PakTrakr Multi Battery Monitor Battery Pack Monitor

Can be configured to monitor up to 40 batts.

Quote:

Q: Is there a serial interface for logging data to a PC?

A: Yes, the PakTrakr sends out a CSV data stream every second,
containing all the battery data. By attaching a PC to the PakTrakr
via the optional serial interface, the data may be easily read into a
spreadsheet for analysis.

dcb 11-13-2008 12:42 AM

matt, attiny is just a little microcontroller, like a pic, but if you know an adc that handles floating ground that would be useful, I don't know how to search for it.

Here's a page that provides some more ideas, a basic stamp based battery individual battery monitor. He has plain optos on each battery that draw a continuous 25ma (maybe) so not 100% ideal or easy to disengage in a sleep mode, but still plenty to think about: BATTERY MONITOR
http://genki.home.ionet.net/BattMon/Fig6.jpg

http://genki.home.ionet.net/BattMon/Photo2.jpg


I also have to think that too many chips and a network will add to the "leakage" power consumption just as a voltage divider would. I wonder if you can make an auto-ranger out of a 4051?

NiHaoMike 11-14-2008 03:14 PM

What about measure the voltage of each node with respect to ground? It will take some processing cycles to convert them into voltage per battery, but it should turn out cheaper. Use some MOSFET type optoisolators to switch the data acquisition device from node to node. Add some series resistors to prevent accidental short circuits.


All times are GMT -4. The time now is 08:26 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com