ADC1_0 reported random value even no input

spidernet
Posts: 2
Joined: Wed Apr 10, 2019 12:19 pm

ADC1_0 reported random value even no input

Postby spidernet » Wed Apr 10, 2019 12:27 pm

ADC1_0 reported random value even no input.

Code: Select all

#define Sensor_A0_PIN 36
pinMode(Sensor_A0_PIN, INPUT);
  
// loop
int sensor_A0_R = analogRead(Sensor_A)_PIN);
display.drawString(0, 20, "Sensor A0: " + String(sensor_A0_R)); 
  
The output of sensor_A0_R send to OLED. I see random value such as: 768, 829, 822, 933, 846, and so on.

Why PIN 36 reported random value while nothing put to this PIN? (if I put 3.3V then 4095 is appear, which is correctly).

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: ADC1_0 reported random value even no input

Postby ESP_Sprite » Thu Apr 11, 2019 5:40 am

Because it's high-impedant, picking up whatever EMC is in the air. It effectively works as an antenna.

Who is online

Users browsing this forum: Google [Bot] and 89 guests