logic levels on Arduino

The doubt I have is regarding Arduino 5V and 3.3V.
I know that when using 5V pin ,the logic levels of the I/O pins are 0V(LOW) and 5V(HIGH).
However when using the 3.3V pin,are the logic levels 0V(LOW) and 3.3V(HIGH)?
Also if the above is true,do we have to declare this in the sketch?
If so how?

The 3.3 V pin is just a supply.
What are you trying to do?

I'm trying to connect esp8266 with the Arduino.And I have read that esp8266 has 3.3V logic ,while Arduino has 5V logic.So,how to interface the them?

Voltage is the potential difference between two points. 0V - 3.3V or 0V - 5V.

So logic level HIGH or LOW is measured in respect to a point (GND).

According the voltage rating of the components that are used in the project a 3.3 OR 5 volte supply may be used.

Subhan95:
The doubt I have is regarding Arduino 5V and 3.3V.
I know that when using 5V pin ,the logic levels of the I/O pins are 0V(LOW) and 5V(HIGH).
However when using the 3.3V pin,are the logic levels 0V(LOW) and 3.3V(HIGH)?
Also if the above is true,do we have to declare this in the sketch?
If so how?

I think for the 8-bit Atmega controllers it is like that:

  • voltage lower than 0.3*VCC = LOW
  • voltage higher than 0.6*VCC = HIGH
  • other voltage ==> not defined (maybe HIGH or LOW when reading)

So when operating an Arduino UNO powered by USB at 4.9 V, the levels are:

  • 0.3*4.9 = LOW if voltage less than 1.47V
  • 0.6*4.9 = HIGH if voltage above 2.94V
    not defined otherwise

So if you create output from a 3.3V chip like ESP8266, the 3.3V from the chip should be enough to get a "HIGH" on the Arduino Input.

But take care when creating Output with the Arduino and feeding into ESP8266: You need a voltage divider then and are not allowed to provide 4.9V from the Arduino board into the 3.3V ESP8266.

Here is a Document i found on Spark Fun web.

It explains logic levels pretty well

Logic Levels.pdf (435 KB)