Today so show you how to read analog data using NodeMcu8266
Now you have to need some component for experiment
1. NodeMcu8266
2. 10k ohm potentiometer
Now you have to need some component for experiment
1. NodeMcu8266
2. 10k ohm potentiometer
Circuit
Important notes
According to the ESP8266 datasheet, the ADC pin has 10 bit resolution. This means that your analog reading will return a value between 0 to 1024.
The ADC only converts voltage between 0 and 3.3Volts. So before you apply any voltage to your A0 pin, you need to make sure that you’re using a device that only outputs 3.3V. Otherwise you might need to use a voltage divider:
Now upload the code
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(analogRead(A0));
delay(1000);
}
See serial monitor
Video
thanks sir nice post
ReplyDelete