So I changed the power supply yesterday from my Apple one, to a Sony one, and no change, except the voltage dropped (not sure whats going on with the readings since 17:00 where it seems to go up and have slightly less swing though - its still sitting in exactly the same place on my desk! Air pressure maybe?)
I saw a similar swing in my testing one that I just left out… I’m guessing temperature/humidity or something. Still no luck on my end. Have you tried wiring power direct to the sensor?
Not tried direct power yet - after @tom_l said he tried both ways with no change, I didn’t rush to try. I’ll give it a try in the next couple of days after I try swapping out the other bits. I found another Apple supply to try as well!
The long term drift is due to temperature, humidity, and deformation. Wood is not a dimensionally static material. Also these sensors seem to have a fairly high temperature coefficient. It’s manageable though.
Noise. I still don’t know what is going on there. Next thing for you to try would be the capacitors. A 0.1uF monolithic ceramic and a 470uF electrolytic across the sensor power supply. Also shorten up the connecting leads as much as possible.
damn you @tom_l and your accurate sensors… I didn’t even know there were different types of capacitors, so that next step may be a bit over my head. you are just going to have to ship me your whole setup and call it a day
You can definitely find better deals than this. Just showing an example of what is required.
The ceramic capacitor can be connected in any orientation. The electrolytic is polarised and has (+) and (-) connections, be careful to get the orientation correct. (+) lead to (+) power supply connection.
I used the delta and throttle filters to have it report to HA at a minimum interval of 30 seconds, but also report immediately if the value changes more than 0.05.
You can see it was a little noisy still, with the values fluctuating almost 0.4 even when nothing was moving.
At 8am I changed the esp32 to the following config:
I’m not convinced a straight up threshold is going to be reliable enough given the drift and spikes, but we’ll see how it goes after a few more nights.
Swapped out the strain gauge today, and still the same. Also switched to a much shorter cable, and still the same. I’ll swap out the Wemos tomorrow, and try powering the sensor direct and see what happens. I found the 470uF caps at work, but need to order the 0,1uF ones, so been trying to eliminate all the other options in the mean time!
So i’m pretty sure the sliding_window_moving_average was doing something. Here’s a new snapshot. First is the previous config I pasted above. I slept from 1am-7am in that config too, then right before 10am I changed it to remove the sliding_window_moving_average and use just the delta and throttle and as you can see it got a lot noisier!
The problem with that is it means I have to either flood home assistant with data all the time, or send data at an interval so slow that it would feel unresponsive. I tried that and it makes the device push to home assistant at a strict interval (update_interval * send_every).
I want the lights to react within a second or two of getting on or off the bed, but sending data every 2-3 seconds to home assistant is too much.
That was my reasoning for using the combination throttle and delta. The idea is I want to sample the sensor at least once a second, but only push it to home assistant if the value changed more than X, as well as at least once every Y seconds. I’m going to keep fiddling with the intervals I’m using to see if I can improve it more.
You don’t have to leave it like that. I’m just interested in what your baseline noise is like compared to mine and two other users here (who have a noise problem).
As you can see, I added another sensor for the other side of the bed. Something is wrong with it, probably how I glued the flex sensor to the slat, and I’m not getting good readings from it at all. Unfortunately it means I have to rip that one off and re-solder a new flex sensor onto the chip, so that’ll be an adventure.
I have no input at the moment, as I’m vacation, but I just wanted to say that I’m so happy people are posting about their attempts. This gives me hope for my setup in the future! Thanks!!