Monkey Detecting Sprinkler overview

UPDATE 2023:

See part 3 for the new battery powered motion detecting version. Much simpler!

Original version (2019) below:

Using the power of Machine Learning we will create an Android app to detect the intrusion of any type of monkey (or baboon). This app can be programmed to send a signal to a WiFi connected device which can trigger a tap to turn on, and thus set off the sprinkler. This is an effective way to deter monkeys from hanging around, as they don’t like getting wet.

The nice thing about this project is it can be adapted to detect almost anything! I adapted the Android app to detect my son’s stuffed monkey toy by changing one line of code. Download Teddy_Bear_Detector here.

The ML platform we will be using for the Android app,*, provides pre-trained models as part of their api so you don’t have to go through the hassle of training a model and getting dirty with low level ML stuff.

*update: is now deprecated. This tutorial is now, unfortunately, obsolete. Possibly the Python version also won’t work…

The Source code will be provided both for the Android app (in Kotlin) and D1 mini firmware (Arduino) for the monkey squirter. An alternative Machine Learning monkey detector implemented in Python will also be explored, for the desktop, or possibly a Raspberry Pi…

If you just want to play with this project for fun, you can set it up quite quickly on a breadboard, using just an LED as an indicator instead of the relay powered solenoid tap valve.

To just test this out you will need:

  1. Android phone to run the Monkey Detector App
  2. Android Studio
  3. Breadboard:
  4. D1 Mini:
  5. USB cable to program and charge D1 mini:
  6. Arduino IDE

For the full project you will need:


  1. Android Studio OR:
  2. Pycharm (recommended python IDE)
  3. Arduino IDE


  1. Breadboard
  2. D1 Mini:
  3. D1 mini relay: OR:
  4. Relay: OR:
  5. you can buy the relays in bulk really cheaply here:
  6. More relays but 3v ones (if you use these just take out the transistor in my circuit):
  7. Solenoid valve like this:

Try out the first test run of the project now! Switching on an LED when a soft toy is detected.

See the history and idea behind the monkey detecting sprinkler (blog posts)

Check out the Monkey Detector standalone app on Google Play Store