Skip to main content
Code formatting + make the image visible.
Source Link
Edgar Bonet
  • 45.2k
  • 4
  • 42
  • 81

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);

}

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:  hardware setup

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?

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?

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: hardware setup

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?

Source Link
betion
  • 115
  • 2
  • 6

arduino pro mini analog pins read different values

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?