Blog IndexPosts by TagHome

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.

[aaron@walrus ~]$ ping rainy.nat
PING rainy.nat.rhwyd.co.uk (192.168.1.191) 56(84) bytes of data.
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=1 ttl=64 time=6.68 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=2 ttl=64 time=4.84 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=3 ttl=64 time=239 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=4 ttl=64 time=9.91 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=5 ttl=64 time=4.86 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=6 ttl=64 time=7.69 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=7 ttl=64 time=153 ms
64 bytes from rainy.nat.rhwyd.co.uk (192.168.1.191): icmp_seq=8 ttl=64 time=4.88 ms
^C
--- rainy.nat.rhwyd.co.uk ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7009ms
rtt min/avg/max/mdev = 4.840/54.043/239.586/85.138 ms

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!

Related posts:

Tags: hacks house

Blog IndexPosts by TagHome

Copyright 2007-2017 Aaron S. Jackson (modified: Sat 25 Nov 10:09:38 GMT 2017)