I am unable to use the filter median option with this particular sensor
[filters] is an invalid option for [sensor.dht]. Please check the indentation.
filters: [source Switch standing desk studio.yaml:50]
- median:
window_size: 5
send_every: 5
send_first_at: 1
What troubleshooting options do I have? This is a new problem but could it be a faulty dht sensor? Would reducing the update frequency help? Can I solve this within Home Assistant or would that be an anti-pattern?
I’m following this thread b/c I see the same spiky pattern from my sensors sometimes.
For me, it’s whenever I change WiFi access points (turn on a second one, turn off the first, so all the stations have to reconnect to the second one). So maybe it has something to do with WiFi reconnects.
It just doesn’t make sense how something like that would manufacture wacky data.
This can very well be RF interference. The WiFi signals can induce currents in the electronics of the sensor. Try to get the sensor further away from the ESP. Even if the sensor is on a PCB shield, do NOT plug it directly onto the ESP. Try to shield it with aluminum foil. Change its orientation, i.e. turn it so that it shows minimal surface when seen from the ESP.
It is true that ESPs often suffer from short voltage drops in their power supply. But my experience is that this usually results in brown outs of the MCU itself. I never had noisy sensor readings as a result.
Brown outs usually happen when the power consumption of the ESP spikes. This in turn is often the result of WiFi transmission bursts.
My recommendation is to buffer the 3.3V side of the D1 mini with a 47uF Tantalum capacitor. Larger capacitors are not really relevant but using a Tantalum type is (they can deliver much faster). Out of painful experience I do not operate any ESP without such a capacitor anymore.
But as said: If the ESP is generally stable I don’t think that the observed behavior is the result of a weak power supply.
Thank you, I have added the filter in the correct place
To answer your other questions, short distance from DHT sensor to ESP board and yes to pullup resistor
Is the 2 in parallel to reduce the resistance and inductance of the capacitor, as I would assume adding 100nF to 50uF really doesn’t make much difference to capacitance, or does these 2 different values give different frequency filtering? See what you describe in datasheets and haven’t been able to find out why.
Electrolytic capacitor has large capacitance, but also high impedance (=HF resistance), so it’s capable of filtering out only short voltage drops (flattens the voltage curve). That’s why you add a smaller, different technology capacitor, which has reversed specs: small capacitance, but also small HF resistance. So 100nF is filtering HF noise spikes.