Measuring 0-20 volts

29 Jan 2015

I need to use the LPC1768 to measure battery voltage in an automotive application. I was thinking about setting up a voltage divider and feeding the output in to one of the analog in pins, but not sure if this is "safe" since if the ground gets lost the analog input would be driven to the full voltage. What is the best practice for doing this?

Also, what is the best practice for powering the module in an automotive environment beyond a standard 3 terminal voltage regulator and some filter caps?

thx

so

29 Jan 2015

Hi Sonny,

Load Dumping and bouncing grounds are a big concern in automotive electronics. You have to protect all I/O's and power inputs from huge voltage spikes. To make matters worse, the mbed LPC1768 does have a noisy internal ground, making A:D readings inconsistent.

Filtration and multiple sampling is the key for more consistent A:D conversions. A voltage divider should be ok. ESD and diode protect all I/O pins leaving your box.

For power, I would recommend using an Automotive rated DC:DC converter and input filter components. Don't forget a fuse either.

Automotive components have a greater operating temperature range than your standard parts. Just be aware of that.

30 Jan 2015

Thanks Kevin,

I had run in to the noisy A/D issue in the past, so had planned on taking a running average.

Do you know of any resources or schematics that give good examples of the diode protection for the I/O? and power? The finished product in this case will be in an environment with worse than usual electrical "cleanliness".

30 Jan 2015

FYI,
Following an example on an automotive environment.
http://elm-chan.org/works/glg/report_e.html
http://elm-chan.org/works/glg/glg_sch.png
The voltage divider is shown as R4 and R5.

30 Jan 2015

You can use the INA219, i use it and work well.

there are libraries for it:

http://developer.mbed.org/teams/components/code/INA219/

Datasheet: http://www.ti.com/product/ina219