Rainsensors and bed sensor build

So i build a bed sensor, inspired by Tom and others. It uses a FSR but i hooked it up to an aqara sensor, and it works great, surprisingly. There is a slight sometimes that it doesn’t register but that can be negated by having multiple strips in a group i guess. For a while there i thought it would register the matrass but it doesn’t. It might do tomorrow though. If it does i’ll try the couch, those cushions are not as heavy.

I also re-purposed 2 old 433Mhz door sensors and used a ‘Rain’ sensor with them (which seems to me really to be a FSR sensor as it registers when you tap it the same as it the bed sensor, maybe more sensitive. But i might be completely wrong on that.

I used this little plastic housing with a hole drilled in for the wires, and i used the same for the bed sensor. The FSR strip lies on the wooden slats and the box sits next to the matrass, not under. I didn’t solder the part to the FSR, the dupont cables i soldered to the aqara sensor sort of fit on the connectors to the strip (and it makes for easy removal).

I can upload a picture of how it sits upon request, but it’s really the same box with an aqara sensor + FSR strip.

Took me all day and 1 aqara and 1 FSR strip broke but pretty happy with the overall build.

1 Like

The bed sensor seems to work ok, although i get a lot of open and close, the history itself shows it pretty accurately. I’m not entirely sure what is the difference between history and the logbook.

Cool. Reminds me of this project I recently noticed.

1 Like

It’s not an FSR. It’s not sensitive to pressure but to moisture. It’s simply two electrodes with a circuit that measures resistance. Raindrops (or the moisture of your fingers) lower the resistance. Note that these things tend to corrode really quickly when left outside and lose sensitivity. It’s much better to use a capacitive sensor for rain detection instead, as it won’t expose any metal directly to the environment and can’t degrade.

2 Likes

This suggests they can hold up ok.

Yeah i saw that too. I guess it depends on how acidic the rain is or where you live. We’ll see how they hold up.

1 Like

Hey, yeah i thought as much. End result for both this and the FSR is almost the same though :-). Although i don’t know if a FSR would respond to raindrops, i guess you would need super high detection whereas most FSR strips start at about 10kg of pressure.

They even look the same in appearance.

They might look similar, but it’s really a very different physical principle behind both. The FSR changes resistance as it deforms from an external force. It’s fully encapsulated in a plastic coating and nothing is exposed to the elements. The rainsensor doesn’t deform at all, its resistance is dependent on moisture. Actually LDRs (light dependent resistors) also look a little similar, albeit smaller, you also have this stripe / snake like patterns.

Just as a technical info though, if things work alright then all the better :slight_smile: You’ll have to see how well they hold up in your climate. At the price they cost, I guess you can treat them as disposable anyway.

1 Like

Thanks Alex, appreciate the explanation. I’m just getting started so not that well versed in these yet, so much obliged for the helpful comment.

Yeah i get 5 for 8,- or so, and i can easily pull the wires and add a new one. One per year should be ok.

I have to say i struggle with the angle on these things. I put them at an angle currently, but obviously the rain falls straight off and that’s why i suspect it almost immediately says that rain has stopped. Maybe a flat mount might be better here.

I’m going to add some sort of bucket or siphon or similar above this, because while the sensor works for detecting rain, it’s not very good to know when it stopped. It will almost immediately say rain cleared. I need something that keeps the rain going while it’s still raining, so either a funnel/bucket installation on top or i need to retain the moisture somehow, like put the sensor in a small bucket, but then how does one get rid of the rain.

I did get one of those tipping bucket sensors from Asia, not sure how quickly that would detect rain. Anyway, more experimentation required for this type of sensor.

That’s how it’s supposed to work. Raindrops fall onto the thing and will register. They will clear with gravity while new raindrops will register subsequently. This may lead to the digital out going low/high constantly (depends on how strong the rain is and on the detection threshold), the average frequency of these signal transitions gives an estimate of the amount of rain falling. The rest is then in software. Sensors like this won’t just go on when rain falls and off when it stops. You’ll need to add appropriate signal processing in the software / firmware, at the very least a delay or a sliding window average.

There’s also an analog out, which might be more stable and easier to process. Of course it will need an ADC. Better / less cheap sensors have a heating element that will clear the sensor on demand, but that would typically be used in sub-freezing temperatures to clear ice and snow only.

But then i would expect more messages of Moisture detected, it seems it only does it once at rainfall and after that no more. I think it works fine if rains stays on the board though.

I’m not using the little board that came with it, i just hooked it up straight to an aqara door sensor, so just analog i guess.

Well then the results will be pretty much random and very unreliable. The door sensor expects a digital signal. You hooked up basically a variable resistor, a purely analog signal. That’s not what the electronics in the Aqara sensor were designed to deal with. It may somehow, somewhat work, but you’re operating on some random tolerance of the Aqara circuits on where they place the high / low threshold when they trigger. They were designed to deal with a circuit that is either entirely open or entirely closed. Not something inbetween. If you want reliable detection, then you need to supply a digital filtered signal with well behaved high / low tresholds and possibly some hysteresis in them. If you don’t have that, it will always be hackish and ‘kinda’ working, but not really and you will need some weird contraptions to keep water on the sensor, etc.

Maybe, instead of using these door sensors, you might want to look into this ESP Home stuff that seems to be all the rage around here. The ESP has analog inputs you could use and you could do the thresholds and filtering in software.