I'm working on an ESPhome project of a night light lamp for my young kids, which automatically glows in different colors to let them know when they're supposed to be already sleeping at night \ allowed to get out of bed in the morning.
Here's a video demo:
https://v.redd.it/link/1au2ss1/asset/gjdup17vdejc1/DASH_720.mp4
It also has a temperature sensor, intended to automate turning on/off a radiator when it gets too cold in their room at night.
Essentially, it's a just a D1 Mini ESP8266 running ESPHome hooked up to 6 ws2812b LEDS and a BME280 I2C Temperature/Humidity sensor. The LEDS illuminate a plexiglass sheet that sits in a concrete molded fitting. The electronics are housed below in a custom 3d printed base. Everything is powered by a 2 amp 5V USB charger connected to the board.
My issue is that the BME280 gives me different readings when the LEDS are on from when they are off (while they're static, ie not changing color). Specifically, I'm comparing its readings to a SONOFF SNZB-02P ZigBee Temperature/Humidity sensor that sits right next to it. (The BME280 is in the open air, next to the Sonoff and away from the LEDS so it's not affected by their heat). I know the BME280 reads a couple of degrees higher due to self heating (which I've set an offset for, but what I'm seeing is that it actually gives higher temperatures when the LEDS are on and lower when the LEDS are off. Here it is in the data:
Any clue why this might be happening and how to prevent the LEDS from affecting the sensor? To reiterate it's not the LED heat that's changing the reading since the BME280 is far away from those and sits right next to the SONOFF, which isn't affected.
Here's how it's wired:
More information about the sensor module:
My intuition is that when the LEDS are on, there is some sort of voltage drop that affects the sensor reading. How would I go about avoiding it though? Is there a type of component I can add to the circuit to do so, and if so which, where and how should it be wired?