WiFi Rain Meter

Posted <2017-11-25 Sat 09:49> by Aaron S. Jackson.

I bought a "Spark Core" several years ago on Kickstarter. It's a WiFi enabled Arduino-like project board which I never got round to using. They are called Particle now. On eBay I noticed they sell replacement rain meters for a range of weather stations made by Maplin. The best thing about these is that they are only £4, so I thought it might make a fun small project.

Here is the counter on top of the shed, and the USB powered board inside the shed.

The meter has two buckets which fill up in an alternating fashion. When one bucket is full it seesaws to the other bucket, dumping the contents accumulated so far. In doing so, a small magnet passes a reed switch, which sets pin D7 HIGH.

You might be asking me why I don't have a pull up or pull down resistor in that photo. The Core has built in resistors which you can configure to be in a pull up or pull down configuration. Quite nice!

Apparently it takes 5mL of water to cause a pulse. The WiFi board opens a TCP connection to escher (machine I keep on in the loft), which using inetd runs a shell script to write the current time stamp to a text file.

A bit of awk and gnuplot later and we end up with this graph, which should update every 20 minutes:

The latency to the shed can be a bit high at times, but I left a ping running over night and in the morning there was 0% packet loss, although I might have just got lucky. Testing last night I got 3% packet loss, but with TCP it should be fine.

I will be replacing (or maybe just adding to) my temperature sensor network soon with some ESP8266 modules which come with humidity and temperature sensors. These are amazing value compared to the core. When I bought the Core several years ago it was £25 or so. These ESP8266 with the sensor module is only £4!

In the case of the Spark Core, I compiled the full firmware from the code available on github so I am not too afraid of it doing something unwarranted. I have statically assigned the Core with an address in the range 192.168.1.176/28 for which traffic to the internet is blocked. ESP8266 might not be so flexible, so they will also have an address in this range. Safety first!