Go Down

Topic: analog in will not read true (Read 7555 times) previous topic - next topic

eatabean

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

AWOL

Don't see code, don't see a schematic.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart

Quote
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  ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

MarkT

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?
[ I won't respond to messages, use the forum please ]

eatabean

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

MarkT

Quote
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?
[ I won't respond to messages, use the forum please ]

retrolefty

Quote
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

robtillaart

Quote
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..
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

eatabean

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  :~

patduino

Hi eatabean,

Quote
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.
There are 10 types of people in the world, those that understand binary, and those that don't.

michinyon

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 ?

Go Up