Plant Pot Water Detector

Introduction

If you are anything like us, you like the idea of growing your own plants, but keep forgetting to water them. Well CodeBug has the solution, build a water detector with just a couple of parts and the analogue inputs on CodeBug’s legs.

You will need
CodeBug CodeBug
Micro USB cable
Computer
CR2032 battery
10k ohm resistor
Crocclips
Paperclips
OR Seeds (optional)
Plant (optional)

Writing your program

To keep track of your plant’s thirst, you need to write a program that reads the analogue value of CodeBug’s legs and displays it on the screen. Follow the activity below to create your program.


Writing up your plant pot

Attach your paper clips to the side of your pot about 6 cm apart and sticking them at least ⅓ of the height of the clips into the soil. Make sure no parts of the two paperclips are touching each other.

Connect a crocclip from the GND leg on CodeBug to one of the paperclips. Now attach another crocclip from leg 0 on CodeBug to the other paper clip. Now connect a croclip to leg 0 and the other end to one leg of a 10k ohm resistor, then connect another crocclip to the other leg of the resistor and the other end of the croclip to the PWR leg.


Test your detector

If the numbers are very high (255), try moving the paperclips closer together, if the number is too low (0) then try moving the paperclips further away from each other, you can also experiment with different values of resistors. Repeat this process after adding a little bit of water to your plant’s soil and see how the numbers change on CodeBug.


What next?

Come up with another way to display the water level and even display the optimum level.

CodeBug has 4 legs that can detect analogue values, try looking after more than one plant with your CodeBug.

Try attaching an alert to your project, such as a sounder or some GlowBugs to grab your attention when your plant is thirsty. You could also make your project light sensing and turn on a light automatically when it gets dark.


Back to top