Pages: [1]   Go Down
Author Topic: Arduino measuring its own power supply  (Read 1369 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a protected lipo to power an arduino, I'd like to monitor its own power supply. The only way I can think of doing this is with a voltage divider circuit.



Is this safe to do? Is there a better way?
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the LiPo voltage? If it's not >6V you can't plug it in to the Vin input and get a 5V output (it will always be less than the input voltage).

You can use the voltage divider circuit to measure the battery if you do have a battery >6V into the Vin pin.

--
The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the LiPo voltage? If it's not >6V you can't plug it in to the Vin input and get a 5V output (it will always be less than the input voltage).

You can use the voltage divider circuit to measure the battery if you do have a battery >6V into the Vin pin.

--
The Flexible MIDI Shield: MIDI IN/OUT, stacking headers, your choice of I/O pins


I'm using a 3s lipo (9v - 12.6v). My main concern is that this would possibly fry the a0 pin via overcurrent.
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope, it will be fine as long as you choose your resistors right. For a 12.6V maximum voltage, you want to divide that down to 5V so you need a voltage divider ratio of 5/12.6 = 0.4. You can use r1=3.3k ohms and r2=5.1k for a pretty good approximation to that.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope, it will be fine as long as you choose your resistors right. For a 12.6V maximum voltage, you want to divide that down to 5V so you need a voltage divider ratio of 5/12.6 = 0.4. You can use r1=3.3k ohms and r2=5.1k for a pretty good approximation to that.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons


Awesome. Thank you very much for your help.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How can I measure current in the same circuit?
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1655
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.sparkfun.com/products/8882
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12179
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope, it will be fine as long as you choose your resistors right. For a 12.6V maximum voltage, you want to divide that down to 5V so you need a voltage divider ratio of 5/12.6 = 0.4. You can use r1=3.3k ohms and r2=5.1k for a pretty good approximation to that.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons


If you use 15k and 22k then there's less risk of overloading the input protection diodes if the voltage should stray higher and you'll save about 1mA of supply current.  You can use even higher value resistors but then you'll possibly have to call anaogRead() twice in a row to allow sufficient settling time (if you are measuring other analog pins in the meantime).
Logged

[ I won't respond to messages, use the forum please ]

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Use a 10K trim pot for the 5K resistor, that way you can fine tune the circuit to get exactly the voltage you want.
Logged

Pages: [1]   Go Up
Jump to: