# DIY BMS/Voltage Monitor



## alexcrouse (Mar 16, 2009)

Hey crew,

I plan on building my own battery monitor, which may evolve into BMS. At this point, its going to be 6 volt meters on one LCD. The LCD is pulled from a goodwill sourced electronic toy, and has a LED backlight. Batteries are 6x12volt MAXX29's.

I plan on using the PIC18F4550 microcontroller as i have some background with it. 

I am an electrical engineering student, so i am pretty adept at electronics, but i have hit a snag. I was going to use simple voltage dividers to the 12channel ADC on this chip to measure my voltages, then i realizes... *the ADC's have a common ground*. That's BAD!

*Any body have an idea of how to isolate the grounds? *I might just end up used a multiplexor style and measure one battery at a time, like once a second, but i rather have live updates!


Bolded for the TL;DR group.

Thanks in advance, guys!

-Alex Crouse


----------



## ddmcse (Oct 9, 2008)

here is what I built 
each gauge cost around $7 
it went up in smoke in this video . i rushed connecting a few wires and one connecting to the plus of one battery arched and blew up a gauge or two .
http://www.youtube.com/watch?v=SXq_N1-6lyI&feature=related


----------



## alexcrouse (Mar 16, 2009)

Looks great, and i considered that design. I would rather have an LCD display tho, mainly personal preference. And i also intend to wirelessly transmit battery information to my watch/wrist computer. Yes, i AM crazy.


----------



## rwaudio (May 22, 2008)

alexcrouse said:


> Looks great, and i considered that design. I would rather have an LCD display tho, mainly personal preference. And i also intend to wirelessly transmit battery information to my watch/wrist computer. Yes, i AM crazy.


A simple opto-coupler can get you there, or any other isolator. Cool idea, I'd like to see where this goes.


----------



## alexcrouse (Mar 16, 2009)

I was under the impression that optocouplers were intended for digital signals, and wern't capable of a gain of 1 on an analog signal. Will they pass a voltage predictably??


----------



## rwaudio (May 22, 2008)

alexcrouse said:


> I was under the impression that optocouplers were intended for digital signals, and wern't capable of a gain of 1 on an analog signal. Will they pass a voltage predictably??


They don't pass it in a perfect linear way, however they do pass signal in a predictable (repeatable) way. You can correct it on the pic side with analog signal processing or in software in the pic. Especially since you will only need a narrow band to be fairly accurate, IE if you are using 12v LA batteries you only need 9-14v to be accurate. I was just starting to tweak the Arduino (instead of pic) signals to represent the input voltage closely. Mine was for LiFePO4 though, so 2.75-3.5v needs to be accurate and outside that range just needs to represent closely. The main thing is that each cell would be represented exactly the same even if absolute accuracy is off what you really need to know is relative voltage between the cells. '

A multiplexer won't work because even though you may not be reading all channels at once they are electrically connected to the pack, and I doubt you are going to find a chip with high enough voltage range, or non common ground, it'll be just like the pic.

Not all opto-couplers are the same, some will work better than others for analog signals.


----------



## alexcrouse (Mar 16, 2009)

rwaudio said:


> They don't pass it in a perfect linear way, however they do pass signal in a predictable (repeatable) way. You can correct it on the pic side with analog signal processing or in software in the pic. Especially since you will only need a narrow band to be fairly accurate, IE if you are using 12v LA batteries you only need 9-14v to be accurate. I was just starting to tweak the Arduino (instead of pic) signals to represent the input voltage closely. Mine was for LiFePO4 though, so 2.75-3.5v needs to be accurate and outside that range just needs to represent closely. The main thing is that each cell would be represented exactly the same even if absolute accuracy is off what you really need to know is relative voltage between the cells. '
> 
> A multiplexer won't work because even though you may not be reading all channels at once they are electrically connected to the pack, and I doubt you are going to find a chip with high enough voltage range, or non common ground, it'll be just like the pic.
> 
> Not all opto-couplers are the same, some will work better than others for analog signals.



Thanks! I discovered the Ardrino about a week after buying a bunch of PIC stuff. Kinda kicking myself. They are not nearly as popular as i was told. lol.


----------



## rwaudio (May 22, 2008)

alexcrouse said:


> Thanks! I discovered the Ardrino about a week after buying a bunch of PIC stuff. Kinda kicking myself. They are not nearly as popular as i was told. lol.


PIC is just as powerful, but Arduino has kind of caught on as the platform of choice. There a lot of existing PIC experts/programs/knowledge out there already. I've actually gone to a PIC12 as an interface between a voltage signal and digital pot. Arduino could do it, but PIC has done it and the chip is much smaller/cheaper and has internal clock etc.

If you have the programming skills then either system will work just fine for you, if you need to rely on the community to help you along with a new design then Arduino might be easier.

The other option could be very cheap ADC's that are powered by the cell they are measuring then send the digital signal through an opto-coupler to the PIC. There are a lot of ways to solve the problem it just depends on your angle and what you are more comfortable with, hardware/software, digital/analog.


----------

