How to connect 5v sensors to esp32

Hi everyone,
Does any has one tried connecting 5v sensor to an esp32.I have a turbidity sensor which says it's 5v. How can I connect it to my esp32.

Use a voltage divider.
5.1K resistor and 10K resistor
image

Thank you

I heard some thing called logic level converter will it work.

yes logic level converter will work too, you can find ready made boards with 4 or 8 entries

It depends on the output of your turbidity sensor and the converter type.
If it's analog output it will not work,
Most logic converters modules are designed for interface that use open collector inputs/outputs.
There are other ways.

If you share the data sheet of your sensor maybe we can provide the Best solution.

1 Like

Good point - yes as the name implies it’s for logic (true/false - high/low) signals indeed .

Description

Operating Voltage: 5VDC.
Current: 30mA (MAX).
Operating temperature: -30 ° C to 80 ° C.
Compatible with Arduino, Raspberry Pi, AVR, PIC, etc.
Measuring Range: 0 ~ 1000 NTU.

It has 3 pins

what's the exact voltage?
4.5V is okay, that's why there's a big voltage regulator in the ESP32, to lower 5V down slightly to create 4.5V, the 5V label on your board says "5V" but the output should actually be around 4.5V.

look here:
Esp32 powering buck convertor with Schottky diode - ESP32 Forum.

What if I connected my turbidity sensor to Arduino Uno and then connect my Arduino to esp32

We need to know WHICH SENSOR you are using. not the "specs"

That doesnt tell us the nature of the output.

Sorry I couldn't get the datasheet.

Is their any other way

@Johan_beginner

Is their any other way

Yes

Is the sensor output analog or digital?
Does it look like this?

No

Can you provide a link to that webpage please

I found it
It has an analog output so use the circuit I show in post #2

Ok thankyou

Connect the sensor OUT to the circuit IN
Connect the sensor GND to the circuit GND

Connect any ESP analog input to the circuit OUT
Connect ESP GND to the circuit GND

1 Like

Is this 3.3v can it work with esp32

SKU1074718.pdf (542.3 KB)

If you use the voltage divider I show in post #2