user88944: After several tries, i was successful with reading stable battery voltage using internal voltage reference of 1.1v, now the issue i face is that i cannot read stable sensor voltage, could you please let me know how can i read my sensor voltage? or do i need additional voltage divider (my sensor goes directly to A0 and GND pin).

user40646: To measure the voltage at A0 with an internal reference of 1.1v, the formula is float voltage = 1.1 * analogRed(A0) / 1023;. Your code can be simplified as
float Vref = 1.1;

void setup(){
  Serial.begin(9600);
}

void loop() {
  analogReference (INTERNAL);
  float voltage = Vref * analogRead(A0) / 1023;
  Serial.print (“voltage at A0:”);
  Serial.println(voltage);
  Serial.print (“Solar panel voltage:”);
  Serial.println(voltage * 5.7);
  delay(1000);
}


88944: <p>After several tries, i was successful with reading stable battery voltage using internal voltage reference of 1.1v, now the issue i face is that i cannot read stable sensor voltage, could you please let me know how can i read my sensor voltage? or do i need additional voltage divider (my sensor goes directly to A0 and GND pin).</p>
 40646: <p>To measure the voltage at A0 with an internal reference of 1.1v, the formula is <code>float voltage = 1.1 * analogRed(A0) / 1023;</code>. Your code can be simplified as</p>
<pre><code>float Vref = 1.1;

void setup(){
  Serial.begin(9600);
}

void loop() {
  analogReference (INTERNAL);
  float voltage = Vref * analogRead(A0) / 1023;
  Serial.print (“voltage at A0:”);
  Serial.println(voltage);
  Serial.print (“Solar panel voltage:”);
  Serial.println(voltage * 5.7);
  delay(1000);
}
</code></pre>
