Tag Archives: iot

ESP8266 reading ADC data

The ESP8266 has in built single channel ADC that can measure between 0V and 1V with 10 bit resolution. To read higher voltages you need external voltage divider. ADC is available on ESP12.

Voltage Divider

Resistor voltage dividers are commonly used to create reference voltages, or to reduce the magnitude of a voltage so it can be measured. Continue reading ESP8266 reading ADC data

Software Serial for ESP8266

Software serial uses timer, be careful when you are using software serial. Timer is also used for WiFi communication section if you don’t give enough time to WiFi routines it will create problem of stack error or misbehavior. It is better to use software serial only when you need two serial ports and also avoid use of software serial for data reception.

Continue reading Software Serial for ESP8266

IO Level Conversion 3.3V to 5V for ESP8266

Most cases we need to interface 5V (TTL) logic level devices with ESP8266. For this you can simple use 1N4148 diode and one pull-up resistor.

Logic Level Conversion
Logic Level Conversion

The above circuit working can be understood using below figure.

  1. When we give logic 1 i.e. 5V to TXD diode becomes reverse bias and ESP 3.3V RXD pin gets supply of 3.3V (Logic 1) from pull-up.
  2. When we give logic low 0V to TXD pin the diode becomes forward bias and the voltage at its anode terminal drops below 0.7V i.e. logic zero.
  3. For TXD pin of ESP we don’t need any circuit as we can read 3.3V as logic 1 and 0V as logic 0 using any 5V controller.
Logic Level Conversion
Logic Level Conversion

5V TTL Serial Communication with ESP8266

For serial interface you have two options go with 3.3V USB to Serial converter or use above circuit  to do level conversion and use 5V serial converter.

Serial interface is required to program the ESP flash.

5V Serial Interfacing with ESP8266
5V Serial Interfacing with ESP8266