# The Values for High and Low on The ESP8266EX

When using digital input,  we refer to the inputs as HIGH or LOW.  To use these inputs effectively,  it is necessary to know what a high or low is.   This article describes how these values are determined.

# ESP8266EX Datasheet Specifications for GPIO Input Threshold

We refer to the ESP8266EX Datasheet to determine the threshold values for the ESP8266EX chip.   The picture below is from the datasheet and the arrow points to the values that help to define what the GPIO input threshold is. As you can see,  it is not quite as straightforward as you might hope it to be.  Still, its not really hard to understand and only requires only understanding of the terms used.

## ESP8266 VIH and VIL Defined

The general way to think of a high and low input is to say that a LOW equals zero volts and a HIGH = 3.3 volts (or the power supply voltage).    The problem is that you’re generally not going to apply a perfect zero volts or a perfect 3.3 volts.   Trust me.  Nothing works like that or is that good.

•  A minimum value above which will always be interpreted as a HIGH.    This is known as VIH.
• A maximum value below which will always be interpreted as a LOW.   This is known as VIL.
• A band between VIH and VIL that is undefined.

The graphic below illustrates these parameters. ## ESP8266EX VIO Defined

The ESP8266EX has multiple power supply voltage inputs and because there are different sections to the chip,  there are different specifications for each section.   For example Analog Power has a specified range of 3.0 to 3.6 Vdc.  On the other hand,  Digital I/O power has a specified range of 1.8 to 3.3Vdc.

It is the Digital I/O supply that we are interested in as this is VIO.   The value applied to VIO determines what VIL and VIH are.

VIO is applied to pins 11 and 17 of your chip as seen HERE.

KEY POINT:  Most of the time,  the development boards will tie ALL of the power inputs together and specify an input voltage of 3.3V.

# Determining the HIGH and LOW Input Ranges of the ESP8266

Having defined the parameters,  we can now figure out what the threshold voltages are.

Notice how the parameter column says VIL/VIH.    This tells us is what is being specified in the expressions found in the ‘Min’ and ‘Max’ columns.

We’ll determine the VIL first.

In the ‘Min’ column VIL is -0.3 Volts and in the ‘Max’  column is 0.25VIO  (or 25 percent of the Digital IO Voltage).  Assuming a 3.3 Volt supply,  the Max VIL value is 0.825 volts.   Thus anything in the range of -0.3 volts and 0.825 Volts will be interpreted as a LOW.   Anything falling below -0.3 volts relative to chip ground could cause damage to the chip.

We’ll determine the value of VIH next.

In the ‘Min’ Column VIH is specified at 0.75VIO ( or 75 percent of the digital IO supply).  Assuming a 3.3 Volt supply,  this value is 2.475 volts.  In the ‘MAX’ column we find a value of 3.6V.   Thus anything between 2.475 volts and 3.6 volts will register as a HIGH.   Anything above 3.6 volts could damage the chip.

The graphic below illustrates what was just discussed. 