Offline
Newbie
Karma: 0
Posts: 17
|
 |
« on: December 16, 2012, 03:10:57 pm » |
I am trying to read a voltage(below 1 volt) on A0, using the analog read/serial sketch, but the readout is nowhere what shows on the LCD of my device... and I know too little to understand the problem! I have a delay in the sketch, have changed that (incr and decr), thinking the problem is latency. No better. The readouts are from zero V up to numbers that have no relationship to reality whatsoever. I can read the voltage out with a standard V/Ohm meter, and as I said there is a LCD on the device (Radio Shack Sun and Sky Monitoring Station). Any ideas? thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19006
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: December 16, 2012, 03:13:28 pm » |
Don't see code, don't see a schematic.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #2 on: December 17, 2012, 02:35:44 pm » |
Any ideas? yep, have you read this tutorial - http://arduino.cc/en/Tutorial/AnalogInput - but it could be also some other problem, so please follow AWOL's advice and post all information you have. The more information in the question the better answer 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6597
Arduino rocks
|
 |
« Reply #3 on: December 19, 2012, 07:19:25 pm » |
If you are reading a rapidly varying voltage then analogRead() gives a snapshot of the voltage taken over a few microseconds or so.
A digital multimeter measures a time-averaged value over a substantial fraction of a second. A voltage with a lot of noise will thus read as a steady value on a DMM and apparently highly random using analogRead().
Perhaps you need to bandwidth limit the signal of interest with a low-pass filter?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #4 on: December 26, 2012, 04:16:14 am » |
Got no code, other than the analog in / serial sketch I mentioned. Got no schematic, other than two contact points out of the device marked + and -...
Could I program a way to take several snapshots of the voltage reading and average them? I thought of this, but at this point all the readings seem to be unrelated to one another, and the voltage *should* be a steady reading out, as it is the light reading from a diode, used as a light sensor.
As to the advice about limiting the bandwith of the signal, I will look into that. thank you very much.
My son gave me a MEGA for Christmas... gonna try that, too.
Thanks everyone, and merry christmas/happy holidays! jim
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6597
Arduino rocks
|
 |
« Reply #5 on: December 27, 2012, 09:17:34 am » |
and the voltage *should* be a steady reading out, as it is the light reading from a diode, used as a light sensor. Well there's the obvious issue - what light is falling on the diode? Fluorescent? compact fluorescent? Or is it really a constant light source such as the sun or tungsten filament bulb?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15312
Measurement changes behavior
|
 |
« Reply #6 on: December 27, 2012, 09:31:59 am » |
Got no schematic, other than two contact points out of the device marked + and -... Got a link to the 'device' that has + and - contact points? Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #7 on: December 27, 2012, 10:05:38 am » |
I am trying to read a voltage(below 1 volt) on A0 You can set the analog reference to 1.1 Volt internal to make the ADC more sensitive..
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #8 on: December 28, 2012, 12:34:47 pm » |
I tried setting the ref voltage, but didn't understand how to use the code. I can read a 1.5V battery cleanly, but the readings I need to make are less than 1 V, and I guess the resolution is the problem. Perhaps I can amplify the output with a buffer? I sure wish I knew what I was doing 
|
|
|
|
|
Logged
|
|
|
|
|
Indiana, US
Offline
Full Member
Karma: 12
Posts: 161
|
 |
« Reply #9 on: January 12, 2013, 11:27:55 pm » |
Hi eatabean, I sure wish I knew what I was doing We'd love to help, but without a copy of the sketch and a description of your wiring, we're at a loss too! Copy and paste the sketch in a reply and talk us through the wiring. The project you describe seems pretty straight forward and shouldn't need anything fancy to make work. Pat.
|
|
|
|
|
Logged
|
There are 10 types of people in the world, those that understand binary, and those that don't.
|
|
|
|
Offline
God Member
Karma: 9
Posts: 836
|
 |
« Reply #10 on: January 14, 2013, 09:08:35 pm » |
The analog input will have a voltage input and will return a result between 0 and 1023.
So if your input voltage is 1 volt and your reference voltage is 5V, the result of the analog input read operation would be a number around 200.
If you try reading the voltage of a 1.5V battery, your number in the arduino would be about 300. Is that what you get when you try measuring the voltage of a battery ?
|
|
|
|
|
Logged
|
|
|
|
|
|