reading analogue voltages

A shrunk down Leonardo-compatible board, thumb drive sized with native USB support. [Product info]
Post Reply
leo_stuck
Posts: 26
Joined: Sun Jun 16, 2013 11:57 pm

reading analogue voltages

Post by leo_stuck » Thu Oct 03, 2013 12:49 am

Two questions today. First, it sounds simple enough to read voltages upto 5V, but how about reading voltages say upto 15V? am i on the right track if i connect a few resistors in series and then measure the voltge across one of them? Second question, i've been collecting data from the 'stick onto my laptop using both arduino IDE & meguinolink (think i got the name right) but at times the laptop is a bit cumbersome so i was wondering if there is any software available for my tablet(android)??

cef
Freetronics Staff
Freetronics Staff
Posts: 106
Joined: Wed Nov 09, 2011 12:53 am

Re: reading analogue voltages

Post by cef » Thu Oct 03, 2013 3:00 am

For simple DC voltages, you can use a voltage divider made from 2 resistors.

For this, you need a resistor between the voltage you want to measure to the analog input on the Arduino, and then another resistor between the analog input and ground.

For 15V, you can use a 20K resistor (between voltage you want to measure and the analog input) and a 10K resistor (between analog input and ground).

This splits the voltage across the input to 1/3rd of it's original value.

Useful info and tool for calculating voltage dividers: http://hyperphysics.phy-astr.gsu.edu/hb ... oldiv.html

Note: The fields can contain exponents if the value is small, and the field itself is too small to show the full precision - eg: 2.4996666999970375e-7 looks like it's 2.49966669999 - so if things look wrong you're probably not seeing the full value).

If you are worried you could do something wrong, you can also hook up a zener diode (eg: a 4.7 or 5.0V zener) across the analog input (to ground). This should cap the voltage at 4.7 or 5.0V (or close to), so hopefully your Arduino won't get fried. In this case, the Anode goes to ground and the Cathode (the end with the bar) goes to the Analog input. For more on zener diodes: http://www.evilmadscientist.com/2012/ba ... er-diodes/

Note: The load (the Arduino) does have a resistance between the input and the ground. It's usually a fairly high value (around 100Mohm), but it can make a difference in the value you see in the circuit, depending on what resistors you choose for the voltage divider.

LukeW
Posts: 91
Joined: Tue Nov 01, 2011 10:14 am

Re: reading analogue voltages

Post by LukeW » Thu Feb 27, 2014 6:57 am

Cef, if your application specifically demands a 2.4996666999970375e-7 ohm resistor then I think you've got bigger concerns than the accuracy of the code on the website. :)

cef
Freetronics Staff
Freetronics Staff
Posts: 106
Joined: Wed Nov 09, 2011 12:53 am

Re: reading analogue voltages

Post by cef » Fri Feb 28, 2014 7:23 am

Hi Luke,

1. The issue applies to ALL fields (not just resistors, but things like calculating voltages, power loads, etc). Also, the issue applies if the value is very large or very small, so ANY value with an exponent at all may appear as though it doesn't have one.

In the specific value I quoted, that was actually an example from a calculation I did that involved the power in watts flowing through a "load" after the voltage divider (the load wasn't an Arduino btw). In that case, the value of ~2.5W is significantly different from the real value of ~0.25uW.

2. Man, this thread is almost 5 months old. Thread necromancy!

Post Reply