Hi everyone,
I'm currently working on a simple setup to count the interference fringes produced by an interferometer. There's a photodiode positioned at the output, and when a bright fringe passes over it, it creates a voltage difference. The signal from the photodiode is passed into a comparator, and the output from this is sent to the A4 pin of an Arduino Nano.
When I measure all of the relevant voltages with a multimeter, it behaves exactly as I expect it should. However, the reading from the A4 pin is completely wrong and unresponsive. The numbers look the same as when I have nothing connected to it at all. When I tested it with a voltage divider, it read the voltages just fine, so it seems like the issue must be with my understanding of the circuit, rather than a hardware problem.
Please let me know if I need to provide any more information to help identify the issue. Thank you in advance for your help!
Code:
void setup() {
pinMode(A4, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A4);
float voltage = sensorValue*(4.8/1023.0); //measured max voltage is slightly below 5v
Serial.println(voltage);
delay(500);
}
