ESP8266 is a Wifi micro-controller, but has limited pins for ADC. Therefore this topic shows ways to expand ADC pins in the micro controller.
We are undergoing a phase in digital world, where everything is getting small, powerful and wireless.
With the emergence of the term Internet of things, the market is going crazy with all kind of internet enabled devices. One such buzz is created by ESP8266. This chip is already scrambled both in hardware and software by hackers to squeeze the best out of it. Starting from running Lua to analog Tv transmission its ruling the roost.
This chip though serves the purpose for which it is created that is IOT, it lacks in one thing which is needed for using it for IOT. Yes ADC or Analog to Digital Converter. The ESP8266 has just one ADC pin which for an IOT sensor is a bottleneck. That said, it does not mean that you cannot expand the ADC. There are quite a few methods to achieve it which are explained below.
Using ADC Expander:
This is a very common method. You expand the ADC by using an external chip which provides ADC pins and interfaces with ESP8266 via I2C, SPI or Serial etc. Search for “I2C ADC” or “SPI ADC” or ” Serial ADC” you will get plenty of chips.
Using Analog multiplexer IC:
In this method, you use a chip which provides a switch to receive analog signals from different sources. Then it passes it on to the only ADC pin and use GPIOs to control the switch.
Isolation using diode:
In this method, you connect all the Analog sensor’s one end to the ADC pin like a common bus. The other end gets enabled by a diode.
Isolation using resistor:
In this method diode isolation and resistors are used. A pull down resistor is connected to the ADC pin to lower the voltage. One end of the sensor is connected to the ADC pin and the other end is connected to the GPIO pin through resistor.
At the end you need to chose a method which suits your needs. You need to Trade off between cost, capability and various other factor.
Do you have any other methods, if yes then comment below ?