Both my bmp280 sensors started to output random 100+ Celsius temperature spikes lately. Looks to me like an anomaly in reading. Could anyone point me in the right direction? Is this faulty hardware? Or misconfiguration? Not sure how to debug this.
Would appreciate any feedback.
This is my yaml:
# Needed config for i2c bus to work
i2c:
sda: 21
scl: 22
scan: true
frequency: 400kHz #TMP117, BH1750 support max 400kHz (Fast Mode); BMP280, SHT4x are capable more. There is a known issue with SSD1306 displays where the Auth Expired message appears and the board is unable to connect to the wifi, setting the frequency to 800kHz seconds will remedy this. -> https://community.home-assistant.io/t/esphome-wifi-auth-expired/443790/22
# Sensor settings
sensor:
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 1min
entity_category: "diagnostic"
- platform: bmp280
temperature:
name: "Temperature Pantry"
id: temperature_pantry #id of the sensor reading
oversampling: 8x
filters:
# - offset: -1.8
# - multiply: 0.95
address: 0x77
iir_filter: 4x
update_interval: 1min
- platform: bmp280
temperature:
name: "Temperature Outside"
id: temperature_outside #id of the sensor reading
oversampling: 8x
filters:
# - offset: -1.8
# - multiply: 0.95
pressure:
name: "Pressure Outside"
id: pressure_outside
oversampling: 16x
address: 0x76
iir_filter: 4x
update_interval: 1min
Power supply?
You should track down the actual problem, but you can use a filter to just ignore spikes in the mean time.
I believe filters are available as lamda’s in espHome and they are available in HA on the sensor created.
@Karosm thank you. One wire is cca 2m the other 0.1m. Since both sensors are reporting anomalies and it only started lately (haven’t made any hardware changes.), I ruled this out for now.
I thought of interference (moisture), especially the sensor which is outside. But not sure why the Pantry (inside) sensor would also report anomalies.
Can it be the proximity of the access point? The ESP is 10cm away.
What else could interfere?
@Sir_Goodenough thank you! I thought of power issues, but simulating power outages would just give a reporting gap in the histogram, so I am not sure it’s that. I noticed that some of the pressure values are having anomalies at the exact times, but not all, so I am lost even further now.
Thank you for the idea for filtering, I could try using the clamp filter. it’s a quick fix at least.
Quite long for I2C…
Also nice antenna for interferences
consider:
-shorter wiring, shielded wiring
-soldered connections (do you get spikes if you touch the wires?)
-reduce speed
If nothing helps, filter out those spikes in your esphome yaml
I guess many of us do have spare bits of ethernet cable lying about. I built several antennas for 433mhz out of them after stripping wires out. I found even few cm long wires useful in esp32 projects.
oh ok. Nothing happens when I touch the wires or around Dupont connectors. I used two pairs of UTP cables however, for the sensor going outside. But the short wired Pantry sensor is also reporting spikes (albeit only one so far). Not sure if it is really the cables, but I will consider using a STF. Or can the interference from the longer cable spill to the other sensor?
This is the crude setup. UTP cable going outside, you can also see the inside Pantry bmp280 and a splitter before going to the esp module:
Thank you very much for the ideas, I’ll report back. I’ll test one idea at a time, it might take some days. But would be nice to know what is happening, before applying the filter.
We live in an elecromagnetic soup. I made the mistake of once having a switch to a light on a pair of 10cm cables without the pullup resistor. Instant disco strobe lights
I understand this is the only way a stp cable would live to it’s purpose, by actually grounding it to the ground. I did that for one stp in the same room so I have a ground to connect too.
Not necessarily easy task. If it wasn’t the fact that it was working before, I would just tell you shorten your wiring and lowering speed . With 2meters you are crudely out of original I2C design (30cm).
Any changes in ambient that can give interferences? Any power supply changes of your Esp?
Accoring to your yaml, you use a single I²C bus.
So if an electrical disturbance occurs on the longest cable, it will be present on the bus and could also disrupt the sensor connected to the short cable.
Reducing the I²C frequency is free and easy.
And unless 400KHz is needed, that’s always a good idea.
What’s happening electrically?
80cm I²C bus with unshielded wires, 2 devices connected to an ESP32, 50KHz default ESPHome frequency
despite the awfull rising times and a quite high noise level, it works flawlessly on my table, even with 2 meters. But the I²C transceiver of the bmp280 may be weaker, or your environment more disturbed.