battery monitoring with opto-isolators

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
hybriddriveguy
Posts: 6
Joined: Mon Aug 03, 2009 4:46 am
Contact:

battery monitoring with opto-isolators

Post by hybriddriveguy » Sat Aug 08, 2009 4:36 am

Hello All,
I am new to the group and am a self-taught electronics hobbiest.
I am wanting to build an interface for my computer that would allow me to monitor and record my 12 batteries in my Electric Vehicle individually.
I want to be able to see each battery's voltage as well as full pack voltage (144vdc) and amps in and out.
I have read a bit about using opto-isolators for this purpose, but am looking for some guidance on component selection and layout. I also have another battery bank that is 288vdc that I will be taking on if the first interface works out ok.
Thanks, and forgive me if my first post is on the wrong forum.
David

User avatar
jwax
Posts: 2196
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

Re: battery monitoring with opto-isolators

Post by jwax » Sat Aug 08, 2009 4:57 am

Welcome hybriddriveguy, and this is a perfect place for your inquiry!
Perhaps somebody here could explain the use of opto's for your needs, but I don't see it.
MrAl- could you expand your 4-channel battery monitor to 12 channels? (Or simple use 3 of them, and multiplex?)
I would think current could be measured by the voltage drop across a known length of your high current wiring. Or, does your motor controller have an option for measuring its current output?
Is this a stock hybrid, or homemade? I'd love to build/buy an all electric since my car needs are mostly local.
John


hybriddriveguy
Posts: 6
Joined: Mon Aug 03, 2009 4:46 am
Contact:

Re: battery monitoring with opto-isolators

Post by hybriddriveguy » Sun Aug 09, 2009 4:19 am

Thanks for the tips and the websites.
This is a homebrew hybrid. You can see it @ http://www.re-involt.com
I have a shunt I can connect to for reading amps, but my thing is that I need to isolate these signals from my laptop safely so I don't let the magic smoke out. :smile:

User avatar
reloadron
Posts: 519
Joined: Sat Jun 28, 2008 8:57 am
Location: Cleveland, Ohio
Contact:

Re: battery monitoring with opto-isolators

Post by reloadron » Sun Aug 09, 2009 5:56 am

You don't mention a budget however there are several ways to approach this. The first link from dobrien has some good information and gets into some of the problems you face. Personally I would look at an A to D approach using an A / D converter. The first problem is channels where if you want to monitor all 12 battery voltages plus current you need 13 channels or in reality a 16 channel unit. Because the batteries are in a series configuration you are looking at channels that need to be isolated or differential input cahnnels. Since most of the channels will be looking at 12 Volts no problem, however the shunt will output milli-Volts which adds a problem unless the A / D features programmable gain. The merit is a system like this could be set up to monitor and record all twelve batteries at once with the current. The recorded data would show exactly how each battery behaved on a timeline. I only add that as you mentioned record. The more features you want, the more the cost.

I could make some suggestions as to USB serial A / D units if I knew your budget.

Ron

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: battery monitoring with opto-isolators

Post by MrAl » Sun Aug 09, 2009 6:22 am

Hi,


John:
There might be some way to use say 3 chips to monitor all 12 batteries. I'd have to draw up
a circuit i guess. Another chip for the current.

hybriddriveguy:
There is a little more to it then using optocouplers, as those devices tend to drift with
temperature and with age. The temperature drift is about 20 percent and aging depends
on the average drive current over time. Not that it can't be done, but it just takes a little
more thinking. For example, using one extra opto with a known bias of 12v (or whatever)
to produce say 6ma, then monitoring the output of that and using that output to calibrate
the other 12 opto's. That might work pretty well.
They do make better opto's that are made for measurements, but they are more expensive.
For the opto i found in that one link the output is roughly linear over a certain range, so that
we would get an output voltage:
Vout=(12-Vin)*0.325+1.400
and we could calculate the battery voltage with:
Vbatt=12-(Vout-1.4)/0.325
That's with a 1.9k collector resistor and about 1.9k input resistor too.

What you could do is set one or two of these up and connect to one or two batteries
and monitor the output with a meter while they charge. That would tell you what
to expect at the ADC input and you might get an idea how the reading changes
with temperature by heating a unit up a little. You could also experiment with
the extra opto for calibration feedback too that way.

Another way to do it is to make 12 microcontrollers that can each read one battery, powered
from that battery too, and have the digital RS232 outputs opto isolated. This would be a
much more accurate system. One master uC would read all 12 opto's, then send the
complete data to the computer via RS232 port.
This wouldnt be terribly hard to do either, and would mean the readings would no longer
be dependent on the opto characteristics so no calibration required either.

And yes, to measure current you are talking another uC chip, with shunt and amplifier,
and another opto to isolate the digital output. You might want this one to be bipolar,
so that it can read both charging and discharging currents.
LEDs vs Bulbs, LEDs are winning.

hybriddriveguy
Posts: 6
Joined: Mon Aug 03, 2009 4:46 am
Contact:

Re: battery monitoring with opto-isolators

Post by hybriddriveguy » Sun Aug 09, 2009 12:46 pm

I have a budget of about $500. I would spend a little more to make it durable and accurate.
Although this is something I have read a little about, I have no idea where to start. I would need help with the layout and parts needed. When risking only inexpensive components, I am more eager to get started with a project, but this is putting my laptop at risk and I want to be sure about everything. Thanks

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: battery monitoring with opto-isolators

Post by MrAl » Sun Aug 09, 2009 1:57 pm

Hi again,

Have you worked with micro controllers yet?
You could start there, by reading one battery alone and sending the signal through the RS232 to
the computer and read that one, that will be the model for the rest of them more or less.
LEDs vs Bulbs, LEDs are winning.

hybriddriveguy
Posts: 6
Joined: Mon Aug 03, 2009 4:46 am
Contact:

Re: battery monitoring with opto-isolators

Post by hybriddriveguy » Sun Aug 09, 2009 2:24 pm

No, I have not worked with micro controllers, but would like to get into it. Will this allow me to eventually get to the place of displaying all meters on my laptop screen at once?
If you have some suggestions of micro controllers I should consider and some reading material on working with them, I will get started.
Thanks

Hi again,

Have you worked with micro controllers yet?
You could start there, by reading one battery alone and sending the signal through the RS232 to
the computer and read that one, that will be the model for the rest of them more or less.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: battery monitoring with opto-isolators

Post by MrAl » Mon Aug 10, 2009 3:01 am

Hi,


Well if not a micro controller then how would you read all the battery voltages and also
be able to send this info to the computer?

There is lots on the MicroChip web site about their uC's, and there is also a forum just
for their PIC chips and related. You could start there i guess.

I have made a chip in the past i was selling for $5 that reads 4 inputs and sends that
voltage data to the computer RS232, but im not sure if this would be good enough for what
you want to do. You need 12 channels plus another for current, and it seems the best
way to do that would be to use 12 individual chips one to read the voltage for each
battery and one more to read current, then send that data to a master chip to read
all 13 inputs and send that to the computer. Of course you also need software for
the computer too, to display all the voltages and the current.

The PIC chips are not that hard to use really, but do require some reading first so
you know what all the registers are used for. What i would suggest is that you pick
a chip that already has RS232 built in, and these are about $2.50 each, so that would
be 13 of them, plus one more for master, that's 14, and 13 optos. Optos fast enough
for this can sometimes be had at 0.50 cents each, so that's a total of about 42 dollars
for the main parts. Of course then some resistors, a few caps, etc., then a box,
so i would say this should be able to be done for under 100 dollars.

Now i guess i should ask, just how much of this project do you want to do yourself?
The pieces:
1. PIC algorithm programing, master/slaves.
2. Some simple electronic calculations for resistors, etc.
3. Windows (assuming you run that) display software.

If you do use the PIC chips i can help you the most there as i have used those in the
past and never needed anything else so i stuck with them.
You can do your own programming after you read up on them, and the calculations
are basically just resistive divider type networks so that's just multiplication and
division :-) The Windows programming im not sure if you have done that either,
if you have that's good, if not i might be able to throw something together or
if you prefer i can point you to free software you can use to write your own
Windows interface...you'd have to learn a programming language.

So of the three, what do you want to do yourself, and what is your time frame
for this in how fast do you need it built?
LEDs vs Bulbs, LEDs are winning.

User avatar
reloadron
Posts: 519
Joined: Sat Jun 28, 2008 8:57 am
Location: Cleveland, Ohio
Contact:

Re: battery monitoring with opto-isolators

Post by reloadron » Mon Aug 10, 2009 6:00 am

Out of my own curiosity under full load conditions what sort of current is drawn? Just wondering what the maximum currenmt would be.

Something else to consider is the interface between device(s) and computer. Many newer laptops do not include a RS232 port and rely on USB 2 for their serial communications. I have used a few assorted dongles to get from USB to RS232 with mixed results. Just something to be aware of.

As to the GUI (Graphical User Interface) that is a matter of how your software is written to read from the device(s) doing the measuring. I could show you a few examples and a few features that could be incorporated into the software if you would like to see them?

Something else you may want to consider. You are looking at 13 channels for 12 batteries and a current shunt. Would it be wise to add a channel for the barttery compartment temperature?

Ron

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: battery monitoring with opto-isolators

Post by MrAl » Mon Aug 10, 2009 9:05 am

Hi,


Some good points. I like the temperature reading too, might as well.

As to the USB to RS232, the main difference between different units is the compliance to
the RS232 spec as to the min and max voltage levels. The spec i think is plus and minus
3 volts, but with many cheapie USB to RS232 adapters it only works with 0 to +5v, but
that's not a problem when working with microcontrollers when they put out 5v on any pin.
Of course there is the speed, but that's usually up over 100kbps anyway, which is good
enough for this project too. This means even the 5 dollar Hong Kong specials will work
(chuckle).
LEDs vs Bulbs, LEDs are winning.

hybriddriveguy
Posts: 6
Joined: Mon Aug 03, 2009 4:46 am
Contact:

Re: battery monitoring with opto-isolators

Post by hybriddriveguy » Thu Aug 13, 2009 8:09 am

This circuit will be less than 5 amps in or out.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: battery monitoring with opto-isolators

Post by MrAl » Thu Aug 13, 2009 5:31 pm

Hi again,


Did you start on this yet? Just wondering if you tried any circuits yet.
Or, any reading about the PIC chips yet?
LEDs vs Bulbs, LEDs are winning.

hybriddriveguy
Posts: 6
Joined: Mon Aug 03, 2009 4:46 am
Contact:

Re: battery monitoring with opto-isolators

Post by hybriddriveguy » Thu Aug 13, 2009 6:00 pm

I have been reading some about the PIC chips today. I am just getting started but have not built anything yet.
Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests