Hi
it is already established that noise is present for analogue inputs but the question is how much? Just for me to check my setup....what average/min/max noise do you get on your mega 2560 unconnected pins?
Thanks
Hi
it is already established that noise is present for analogue inputs but the question is how much? Just for me to check my setup....what average/min/max noise do you get on your mega 2560 unconnected pins?
Thanks
For accurate applications you need an accurate reference voltage.
I connected Aref externally with a REF02 (5V reference voltage IC).
you can use a cheap stepup-converter (USD 1.47) to supply this reference IC (no extra power source necessary)..
At several input voltages the spread in the returned values (0..1023) is in my case only 1 bit.
For sure you can take several samples and calculate the averaged value.
Unconnected pins ? You mean that nothing is connected to an analog input ? Any measured value of an open analog input makes no sense, since the impedance of an analog input is so high (very very very high) that an open input can be anything.
P.S.: That is three times "very".
Thanks to both.
I'll try using an external reference voltage.
peter_n - So how can I tell if there is a voltage present? My simple experiment is that of creating a voltmeter ranging 0-20v using resisters to lower down this voltage to 0-5v range. Nontheless, when I supply a voltage it goes all over the place, even without the resisters.
If I understand correctly for the AREF all I need to do is supply a regulated 5v source (which can already be supplied by the Mega, to AREF, right?
thanks
Chris
Do not connect a voltage to AREF. I mean: not before you know that you could damage the microcontroller.
When nothing is connected to AREF, then you can select the internal reference voltages of 5V or 2.56V or 1.1V.
(Read the warning on that page about applying an external voltage to AREF).
Connecting 5V to AREF has no use, since the internal 5V is default connected to AREF.
You have a voltage divider with two resistors for an analog input ? That should work. Do you have a multimeter to measure the voltage at the analog input ?
Here is a schematic : http://www.groverfamily.org/solar-powered-basement/solar-panel-monitoring-system/
Without the resistors, the analog value is all over the place. That is good, since it is an open input. With the resistors you should read a stable good voltage. Do you read the wrong analog input perhaps ? Or something is not connected very well ? What are the values of the resistors ?
When you apply DC voltage to your voltage divider, the reading should reflect that voltage. Applying AC may damage the Arduino due to negative peak values, not only cause somewhat random readings.
And remember that always two lines are required for any external signal connection, where one line carries the signal, and the other one carries a reference voltage (typically connected to Gnd). More lines may be used to power or enable an external module, as required.
Ok so if I understand well I was doing it right. The aref is used for reference only as 0-5v and I was right in referring to the default internal voltage. Yes I am using resistors for voltage reduction.
I tried connecting a resistor and led between the gnd and an analogue input which resulted in a reduced noise from 0 to about 150 or so.
how can I tell if the voltage is switched off if the input uses the wire as aerial and produces so much noise rather than a zero?
If you connect a resistor 0 to 10k to GND and an analog input, then the analogRead() should return 0 or maybe sometimes a 1, certainly not 150. Could you try a wire to short an analog input to GND ? or a resistor, but without the led.
Did you know that a led has a reverse capacitance and a led can be a solar cell, it generate current when light shines on the led. When the capacitance and the current generating are combined, a led can be a light sensor.
Peter_n,
With all respect to you, I will advice you to study about inaccuracies and to study the scheme of your processor board.
In normal cases the internal reference is connected tot the supply voltage. When you supply your board via USB, it can happen that the "5V supply" is only 4.67 V (as in my case). This supply voltage is unsuitable to do accurate analog measurements.
FOR ACCURATE MEASUREMENTS YOU NEED AN ACCURATE EXTERNAL VOLTAGE REFERENCE.
I should have written: Connecting the (inaccurate) 5V from the 5V pin to AREF has no use. That is default internally already the reference
The internal 1.1V is more accurate, but it depends on the voltage and temperature. A good voltage reference chip is of course more accurate.
I think it is not allowed to apply a 5V reference to AREF, when the 5V power is 4.67V.
Sometimes in the Adafruit tutorials, the 3.3V is connected to AREF. If the 5V changes because the USB power is not very accurate, then the 3.3V is still 3.3V.
The 10k resister solved the noise.
I was using the 5v reference but I'll try the 3.3v.