i need to read a voltage with an arduino pro mini using the analog pins.
I created this simple test code:
int sensorValue;
float voltage;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(A0);
voltage= sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
}
my setup looks like this:
everything works so far. I get about 4,5v as a result. Now i want to port everything to an arduino pro mini. After i did that i only got 2,5v as a result. I also tried it with different pins and with an other arduino pro mini.
So what did i do wrong? Do i need an other pull-up resistor?