Why Does ML8511 UV Sensor Read Negative Values on ESP32 When Using WiFi?

Hi everyone,

I’m using an ESP32, ML8511 UV Sensor, and an OLED display for a simple project. However, I’ve noticed that the ML8511 often reads negative values when the ESP32 is connected to WiFi.

From my observations, it seems that when WiFi is enabled, the ESP32 draws more current, leaving insufficient power for the sensor, which might explain the inaccurate readings.

I’ve attached a circuit diagram for better understanding. Has anyone experienced a similar issue? Any suggestions on how to resolve this problem would be greatly appreciated.

Thank you!

You need to have common ground between sensor and Esp.
Also 9V battery through two voltage converters is not good power supply.

Any suggestion to fix my circuit?

Power the UV sensor from Esp 3.3V pin and GND.

Also what is the bridge between Sensor 3.3V and enable(?) pin supposed to do while it's also connected to Esp Gpio?
I'm quite sure it has pullup resistor, so it's enabled by default.

And find some alternative power supply, like USB charger if you don't need battery operated setup. That 9V battery is not going to last long anyway...

bridge between 3.3V Sensor and enable pin according to sensor datasheet guide. and I really want to use it portable so I use battery

I'm 99% sure you don't need it but if you bridge it to 3.3V, you can't disable it with Esp pin.

Also, what's the voltage from converter to Esp and Oled? I have strong doubt's your oled should be powered at any other voltage than 3.3V.

Too much guessing here, you should post specs or links for the modules you use.

Which ADC are you using? ADC2 can't be used when WiFi is enabled

Image presents Gpio32, ADC1.

Thank you. I tend not to decode pictures into schematics :slight_smile:

I tried using the power supply from the laptop, but the result is still negative even without WiFi.

You can post your code and links to the specific components you use for best support
Sensor can be damaged if you supplied 3.3V pin from lipo-battery.

this is the datasheet of the sensor

then, I use LCD Oled and ESP32

You use LCD that might or might not have a voltage regulator.
Also you use some voltage converter that we have no idea what it is and what it outputs.