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
Reading 12 volt DC input via ADC
Moderator: Benj
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
Hi Benj
Thanks for your solution, will build up a resistor chain on my breadboard and play around with the values.
Regards
Ted
Thanks for your solution, will build up a resistor chain on my breadboard and play around with the values.
Regards
Ted
- Steve001
- 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
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
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.