3

Currently trying to read off values from a photodiode through analogread. It's constantly so noisy and I thought it might be something wrong with my low-pass filter, but I decided to just connect a 1.5V battery to an analog pin and had just as much noise (upwards of 10mV oscillations). Is there a way around all of this noise? Because this makes the collected data unusable for my project.

this is how I connected the battery to read of analog values that were still noisy

Code to read off analog values:

int diodePin = A0;
int sensorValue = 0;
int sensorVoltage = 0;

void setup() {
  
  Serial.begin(57600);

}

void loop() {
 
sensorValue = analogRead(diodePin);
sensorVoltage = sensorValue*(5000/1024);
Serial.println(sensorVoltage);
delay(10);

}
8
  • 4
    Without a schematic it'll be impossible to help, although it may be more relevant on the electronics SE. 0.01V out of 3.3V/5V doesn't sound that bad, but it depends on context and hardware. Jun 28 at 16:48
  • are the readings noisy if the sensor is exposed to sunlight only?
    – jsotola
    Jun 29 at 2:54
  • no. noisy readings at all times. as i said, even if I literally just try to read the voltage of a AA battery off of an analog input, it doesn't give me a smooth reading at all.
    – Yousuf
    Jun 29 at 3:51
  • 1
    I need continuous good readings so that I can perform a Fourier transform on the collected data
    – Yousuf
    Jun 29 at 13:50
  • 1
    Just to make sure I understand: you're putting 1.5V into an analog pin (5V reads 1024, so 1.5V would be ~307), it's a 10-bit ADC so ~5mV with the default analog reference. You're seeing values from 306-308. What are you using to power the Arduino? Have you tried using a different reference or a stable AREF input? Have you checked things like [this] (forum.arduino.cc/t/…)? Without a solid reference voltage this still doesn't seem that unusual. Analog had a lot of moving parts. Jun 30 at 14:02
3

I always do two things for when "reading" analog data with an Arduino.

  1. Measuring the voltage supply of the arduino board through its internal reference and calibrating with another 'good" voltmeter ("4 1/2" digits-20000 points or "3 3/4" digits-6000 points). ( Usefull link https://www.instructables.com/Secret-Arduino-Voltmeter/ )

  2. Sampling more analog datas to calculate a "mean" ... This can remove some "noise" and add "some bits". 16 samples would add "4" bits at your "readings". Of course, the global sample rate will be lower.

Don't forget, ground star of wires !!!

2
  • Keep in mind that averaging samples will increase the resolution but might not improve accuracy. Only random noise can be "averaged out"...systemic inaccuracy will remain. Jul 27 at 20:57
  • Right. Only in the case if "linearity" is better than 1/16 LSB min ... which is very "rare". Some cases of 1/4 LSB of very good converters.
    – Antonio51
    Jul 28 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.