Will an Arduino recognize a 3.3 input as HIGH

I am working on a project in which I want to have a pin from a 3.3v ESP32 MOD DEV output to a pin on a 5V arduino. The two devices would have a common ground.

Would the arduino digitalRead a pin as High if it has only 3.3v applied to it, or possiibly is there a way to use an analog pin to sense it and my program would just have to measure when the analog pin was over a certain threshhold.

From constants - Arduino Reference

The meaning of HIGH (in reference to a pin) is somewhat different depending on whether a pin is set to an INPUT or OUTPUT. When a pin is configured as an INPUT with pinMode(), and read with digitalRead(), the Arduino (ATmega) will report HIGH if:

  • a voltage greater than 3.0V is present at the pin (5V boards)
  • a voltage greater than 2.0V volts is present at the pin (3.3V boards)

An arduino running from 5.0V will accept 3.0V as a “high”. However the output voltage from the ESP32 is not guaranteed to be 3.3V.
To be safe you can configure your Arduino input as input-pullup. It wont damage the ESP32, just lift the logic level a little.

I would just add a 3.3V to 5V level converter (2n7000)

Depends on the Arduino - its true for the 5V AVR based Arduinos such as the Uno(*),
but you need to check the datasheet for the actual microcontroller in the
general case.

(*) there the datasheet says VIH is 0.6 x Vcc when the chip is powered from 5V, ie 3V.

I experimented using an analog pin on the Nano as an input.
When I put 3.3 v on that pin, I get an analogRead of between 710 and 720 (which makes sense based upon 1023)

so i am thinking if I just use an if X>500 type of formula, i should be fine.

Can anyone think of a down fall to doing it this way.

Perhaps speed would be an issue if you need to detect a signal faster than 5kHz (analogRead takes about 100µs). The measurement speed could be increased safely 4x by using some register level programming.

Could add hysteresis …
if x “just goes” > 500, then output goes high.
if x “just goes” < 300, then output goes low.
“just goes” means to compare with previous reading.

Thanks so much. Time is not so much an issue, but I will add that “hysteresis” (new word in my vocabulary lol). It will only help.

Idea: add a n-channel mosfet to the input (source to GND, and drain to the input pin). Then use INPUT-PULLUP.
Although not necessary a 1K resistor between mosfet gate and the input signal.
With the correct mosfet, the gate saturation voltage can be maybe 2V, and you’re in business.
It will invert the digitalRead so the 3V input will switch as LOW.