Pages: [1]   Go Down
Author Topic: need to read an analog voltage  (Read 653 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys, I am trying to read a small DC voltage.  The goal would be to show a progress bar on the computer that would represent the value of the incoming DC voltage.  example:  0vdc would show 0% on progress bar.  130mv would show 100% on progress bar.   

The largest voltage I will be reading is 130mV DC, which is pretty small. 

I see that some arduino boards have an analog voltage input.  Can they measure voltages that small?  Is the arduino board the best way to approach this?  I am looking at this board because I need it to interface on the usb port.  Thanks, Victor.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8822
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All Arduino boards have analog inputs, typically six or more of them.

You can measure 1024 steps between 0 and the reference voltage.  The reference voltage can be as low as 1V so that gives roughly millivolt resolution.  That would give you a little over 130 steps in your progress bar.

http://arduino.cc/en/Reference/AnalogRead
http://arduino.cc/en/Reference/AnalogReference
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12631
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino has a ten-bit ADC which gives you a value from 0 .. 1023. By default it covers the range 0 - 5V so the resolution is only 5mV - and it would probably not be wise to rely on the accuracy or consistency of the results when you're that close to the limits of the ADC. However, the Arduino has an analog reference which can be used to configure the ADC to cover a smaller voltage range. I haven't any personal experience of using it, but if I understood it correctly you should be able to configure it to give the resolution you're asking for. One possible issue is that the input voltage must not exceed the analog reference voltage, so if you reduce the analog reference to (say) 200mV you would have to make absolutely sure that the voltage you're reading could never exceed that.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
One possible issue is that the input voltage must not exceed the analog reference voltage, so if you reduce the analog reference to (say) 200mV you would have to make absolutely sure that the voltage you're reading could never exceed that.

Never exceed sounds like a safety warning which does not apply in this case. The analog input pins have an electrical damage safety warning if an applied voltage is higher then Vcc +.5vdc (so call it 5.5vdc) or less then ground -.5vdc. And that is regardless of what reference voltage value you are using, internal or external. What happens if your input voltage is higher then whatever reference voltage is being used the value returned will be 1023 for any voltage higher then the reference voltage. So for example, if you are using the internal 1.1vdc reference voltage then any voltage applied to the pin between 1.1vdc to 5.5vdc will return the same 1023 counts from the analogRead() function.

Lefty
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh...This sounds familiar.

I think that Arduino has a tutorial for that and an example....I think is called AnalogRead. Good luck on your project!! Sounds cool.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12631
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
One possible issue is that the input voltage must not exceed the analog reference voltage, so if you reduce the analog reference to (say) 200mV you would have to make absolutely sure that the voltage you're reading could never exceed that.

Never exceed sounds like a safety warning which does not apply in this case.

I stand corrected.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

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

Victor,
You can increase your voltage by using an op amp like a LM741. You can take your 130mv and change it to 1.30 volts or what every you would like. Just be sure you do not go over 5.00 volts out (op amp) or 5.0 volts into your analog input channels.
john
Mims, Fl.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Victor,
You can increase your voltage by using an op amp like a LM741. You can take your 130mv and change it to 1.30 volts or what every you would like. Just be sure you do not go over 5.00 volts out (op amp) or 5.0 volts into your analog input channels.
john
Mims, Fl.

Well a 741 is a very old and obsolete op amp to be using today. And in this application one would really want to power the op-amp with +5vdc and use a modern 'rail to rail' op-amp to ensure it can get to but can't go over +5vdc output. A 741 can't climb close to its rail voltages at all.

Lefty
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8822
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you reduce the analog reference to (say) 200mV...

The ATmega328P datasheet says the lower limit for Vref(=Aref) is 1.0V.  (See: ADC Characteristics)
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: