Arduino read analog input9/14/2023 ![]() The analog voltage is converted to digital values and displayed on the Serial Monitor. Let us now build a small circuit to demonstrate the ADC function of ESP8266.Ī 10 KΩ Potentiometer is chosen as the analog input device with its end terminals connected to 3.3V and GND and the Wiper Terminal connected to A0 Pin of NodeMCU. If you have an ESP8266 NodeMCU board, then you can directly use the ADC Pin (A0) for reading analog voltages in the range of 0V to 3.3V. Demonstration of ESP8266 ADC using NodeMCU WARNING: Do not provide more than 1V directly to the ADC Pin (TOUT – Pin 6) of ESP8266EX SoC. ESP-01 users, who don’t have access to ADC Pin can solder a wire to Pin 6 of ESP8266EX SoC and use it with the voltage divider. If you want to use the ADC for 0V to 3.3V, then you have to use a voltage divider circuit as shown above. IMPORTANT NOTE: The voltage range of ADC in ESP8266 SoC is 0V to 1V. If you take a look at the schematic of NodeMCU, the ADC0 pin in the above pinout image acts as an input to the voltage divider formed by 220 KΩ and 100 KΩ resistors with the output of the voltage divider given to the TOUT Pin of ESP8266EX SoC. The NodeMCU board, which is essentially based on the ESP-12E Wi-Fi Module, has a pin for ADC called A0.Īdditionally, NodeMCU also takes care of the input voltage range limit from the original 0V to 1V to more user friendly 0V to 3.3V. If you are desperate, then you can use the Pin 6 as ADC Pin but remember that it can accept voltages in the range of 0V to 1V only. If you have the vanilla ESP8266 Board i.e., ESP-01, then you are out of luck, as it doesn’t have the pin for ADC on the board. If you are building the firmware from the SDK, then refer to the datasheet and other relevant documentation, as there is a lot more information regarding the ADC and its configuration. But when measuring external voltage at TOUT Pin, the input voltage range should be between 0V and 1V. For Power Supply Voltage measurement, the TOUT Pin must be left floating. Measure the input voltage of Pin 6 i.e., TOUT Pin.īoth these measurements cannot be implemented at the same time.Measure the Power Supply Voltage at Pin 3 and Pin 4. ![]() The ADC can be used for basically two types of measurements. If you refer to the datasheet of ESp8266EX SoC, the ADC Pin is the Pin 6, also known as TOUT pin. ![]() The 10-bit resolution means, the output values will be in the range of 0 to 1023. The ADC in ESP8266 has a 10-bit resolution and is of Successive Approximation Register (SAR) type. The ESP8266EX SoC, which is the main processor in all the ESP8266 Boards, has a single channel ADC. Most modern microcontrollers already have an ADC Block built into their silicon so, you don’t need to use an external (and dedicated) ADC IC. ADCs allow Microcontrollers and SoCs to interface with Analog devices (like Sensors) and build systems around them. ![]() This is really important as all Microcontrollers are digital devices and work only on logic LOW and logic HIGH values. An Analog to Digital Converter, as the name suggests, converts continuous Analog signals in to discrete Digital Values. Demonstration of ESP8266 ADC using NodeMCUĪnalog to Digital Converter or simply ADC is an amazing feature of most modern Microcontrollers and SoCs. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |