Send rainwater tank level via MQTT

I have published my script which uses the JSN-SR04T sensor.

5 Likes

do you find that python on the pi is fast enough to get reliable readings? I found I had to use C, as python gave horribly inconsistent readings. Then again, could be because I’m using an original v1B raspberry pi…

I can calibrate the sensor by changing the speed of sound in the code. I’m using a rpi2 and the script takes the average value of 10 consequent readings. This can also be altered in the script if you want.

To do list:

  • make API connection to buienradar or equivalent to not send a value when it is raining.

On the other hand, accuracy is not that really important for me as a few liters of water won’t make the difference in a 5000L tank :slight_smile:

I do the same, but with a nodeMCU (esp8266). Why do it with a pi?

Hi @wars

Wifi reception inside the (concrete) raintank is horrible. It’s located underground beneath my terrace in the backyard. I"m also using a poe injector to power the rpi2 so I hit 2 birds with one stone.

I understand, that’s why I only have the sensor inside my tank. The nodemcu is located in my basement next to an AP. But a cable is offcourse always better.