View Full Version : ADC0838 as DVM for Propeller

Branmuffin Industries
05-25-2008, 12:44 AM
Hey all,

I am trying to sense the voltage on a 3.3v lithium battery using an ADC0838 (20 pin DIP) and interfacing that to a propeller using 4 I/O pins.

I wrote a great object that interfaces flawlessly with the device. The serial communication can see the 0-255 resolution and draw it to the screen, when I use a voltage divider like a potentiometer knob to simulate the voltage from 0-5. ( I am using Differential mode, I have tried SGL and DIF modes, and both work with the knob)

but, when I hook up the 3.3v lithium battery, I get some strange behavior. the battery has to "float" so that it does not touch digital ground at either terminal. The battery does not power the board. The battery only gets a charger switched onto it using Relays that the propeller controls through a darlington array.

The ADC keeps frying when i hook a battery up to it. I tried some 110k dropping resistors in line, but that makes the voltage the ADC reads so miniscule that it becomes useless to me. I have tried diodes, resistors, and capacitors and nothing works reliably for me.

My question is: can I find a voltage follower or VoltMeter DIP IC (or even a 0-5v analog optoisolator) that will protect, filter, or otherwise interpret the battery voltage so that it can be read by the ADC safely, or what other methods are there to get a propeller to listen to a voltage from 2.8 volts to 4.2 volts without connecting battery ground to digital ground?

-Ryan Brandys

05-25-2008, 08:41 AM
I don't know, but http://www.mcjournal.com/reviews/rev102/rev102.pdf has an spi interface

Mike Green
05-25-2008, 08:51 AM
An ADC0838 can certainly measure a voltage in that range if it's hooked up correctly. You would need to post a schematic of what you've tried if you want specific help with your circuit. Perhaps there's something about the charger that's causing a problem. It's all guesses without further information.

Paul M
05-25-2008, 05:32 PM
It sounds like there is a large common mode voltage - if large enough it may damage the ADC. Also, according to the datasheet the common mode voltage must be kept below Vcc+0.050VĚ for correct functioning of the device