G4D: Water flow

This entry is part 2 of 3 in the series Gardening for Dum-Dums (G4D)
Hey. This page is more than 5 years old! The content here is probably outdated, so bear that in mind. If this post is part of a series, there may be a more recent post that supersedes this one.

My gardening for dumdums project has got sidetracked, mostly because it’s coming on to winter in NZ and it rains so much here in winter that trench foot is the main concern, not your plants’ well being.

I got bored of developing the RaspPi sides of things – see here. Spoiler alert: after settling on Windows 10 IoT & C#, I went with Android Things & Java. I bought a flow sensor off AliExpress and decided to fiddle with that for a bit.

YF-810 flow sensor with dia 25mm male threaded ends.

It uses the Hall effect (apparently…and so is in effect contactless/brushless…and should last…though it was 10bucks) to detect how fast a little turbine is spinning. I figured ‘at some point’ I could go a little fusion and use rainfall stats (from the web or a weather station) & this flow sensor to know how much water is going on to my garden and to correct things accordingly. Seems a long way off now sitting by the fire in the winter dark. Ho hum.

The thing about the RaspPi it that it does not really do directly plugging into sensors too well, but Arduinos do. So, want I have done is:

  1. Use UART to connect the an Arduino Micro to the RaspPi-running-Android Things. I was going to go with simple USB connection but decided not to. Cannot remember why.
  2. Connect my ‘ ‘ tp the Arduino.

Having gone to the trouble of this mean that I could have just use the Arduino to control some relays

I got halfway through doing the above (the soldering. Grrr!) and stopped. I remembered that while wallowing in Windows 10 IoT I had seen a sample for a flow sensor directly plugged into the RaspPi pins using the GPIO. I figure: if it works for Win10 IoT, it’ll work for Android Things, just need to port over the C#.

Image from the Win10 IoT GitHub samples site. Similar flow sensor – mine is just larger and has a different pulse-flow relationship.

This is a relief (provided I can get it working!). Introducing the Arduino is a hassle:

  • a load of soldering – HATE
  • it means I need to have another load of code running on the Arduino – HATEx2, and;
  • I cannot update it from Google Play over-the-air – HATEx3.

Its a lot of hate right, right?

Series navigation

<< New Project: Gardening for Dum-Dums, or G4DG4D: RPi4 and python >>