Reading 12 volt DC input via ADC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
TedO
Posts: 79
Joined: Sat Mar 14, 2015 7:52 am
Has thanked: 46 times
Been thanked: 26 times
Contact:

Reading 12 volt DC input via ADC

Post by TedO »

Hi guys,

I would appreciate some help understanding how to read a 12 volt battery level using the ADC inputs. I have experimented with the 5 volt ADC of the variable resistor pot and understand that, but am not sure how to approach the higher voltage input scenario?

Any suggestions would be appreciated.

Thanks
Ted

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Reading 12 volt DC input via ADC

Post by Benj »

Hello Ted,

I would use a simple potential divider resistor circuit to drop the 12V down to something you can read directly.

12V
|
10K
|
|- ADC Pin
|
1K
|
GND

This would give you 1/11th of the voltage to the ADC pin.

VOUT = (12V / 11K) * 1K = 1.09V

Changing the resistor values will give you different voltages so the ideal is to take your maximum possible voltage (maybe 14V for a 12V battery) and choose resistor values to give you 5V to your ADC pin. This way you get 5V / 1024 discreet values = 4.88mV resolution.

TedO
Posts: 79
Joined: Sat Mar 14, 2015 7:52 am
Has thanked: 46 times
Been thanked: 26 times
Contact:

Re: Reading 12 volt DC input via ADC

Post by TedO »

Hi Benj

Thanks for your solution, will build up a resistor chain on my breadboard and play around with the values.

Regards
Ted

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Reading 12 volt DC input via ADC

Post by Steve001 »

HI Ted ,

if you look at martin's post on this thread he posted a 0 - 15 volt voltmeter

http://www.matrixtsl.com/mmforums/viewt ... 99&p=20326

Steve
Success always occurs in private and failure in full view.

TedO
Posts: 79
Joined: Sat Mar 14, 2015 7:52 am
Has thanked: 46 times
Been thanked: 26 times
Contact:

Re: Reading 12 volt DC input via ADC

Post by TedO »

Thank you Steve...much appreciated.

Rgds
Ted

Post Reply