[No.15] You'll Forget Anyway, So Build an Automatic Waterer!

Programming and Making

Last time, we built a watering warning system. But what if someone still forgets to water even with the warning... Then let's go all the way and invent an automatic watering machine with SPACEBLOCK! The "soil moisture sensor module" checks how much water is in the soil, and if there isn't enough, watering starts. When the soil has enough water, it stops by itself. You'll use the "180° micro servo motor."

Elementary School ~ Intermed. 90 min
Here's the device you'll build!

What You Need & Getting Ready

Top row, from left: SPACEBLOCK Standard Package, 8×8 RGB LED matrix panel, jumper wires. Bottom row, from left: 180° micro servo motor, soil moisture sensor module

Connect the Expansion Parts to SPACEBLOCK

First, let's connect the LED panel and the soil moisture sensor to SPACEBLOCK.
The whole setup

Build the Watering Mechanism!

The servo motor, which we use as the output device this time, can turn anywhere from 0° to 180°. We used it to come up with a way to sprinkle water.

Make holes on just one side of a small plastic bottle, fill it about halfway with water, and lay it on its side. When the holes face up, no water comes out. But when you turn the bottle so the holes face down, the water drips out. That's the idea. Glue a servo horn onto the bottle cap, and control the servo motor's angle with your program to turn the bottle.

The watering bottle. A servo horn is glued on so it fits onto the servo motor. It's easy to take off, so refilling the water is simple
The servo motor part

The servo motor alone can't hold up the watering bottle, so the other end needs support too. We used a slightly bigger plastic bottle to make a support that doesn't get in the way of turning, and attached it to a stand.

The support and the stand
Just slide it into place like this
View from directly above

In this example, a big bottle of water is used as the stand, so it might look like it supplies water. But it's only a stand, and it doesn't supply any water.The watering bottle comes off easily, so when it runs out of water, fill it up again and put it back.

Make a Program That Waters Automatically!

The program looks like the next picture. The soil moisture sensor value uses 500 as the threshold. If it's less than 500, the [Repeat while ( )] block repeats the watering motion. When the soil gets damp and the sensor shows 500 or more, the motion stops and the device waits again.
Notice that there's a [Repeat while ( )] inside the [Repeat] block, and pay attention to when the soil moisture sensor value is put into the variable "water."
A program that repeats the watering motion while the moisture value meets the condition

Let's run it in standalone mode.

If there's enough water, it doesn't move.

QR code for project
When the moisture value drops below 500, it starts moving. While it's working, the LED panel shows the Japanese character "水" (water).

Depending on your setup, the soil moisture sensor can get pretty wet, so waterproof it as shown in the previous lesson. Also, the way the water comes out changes a lot depending on how you make the holes, so try lots of different patterns.

Let's watch the video.
In the video, the battery box is switched on, SPACEBLOCK starts up, and the program begins running. The soil moisture was checked and there wasn't enough water, so the automatic watering machine started working.

By moving a servo motor based on the soil moisture sensor value, we built this awesome device.

Now we've gone up a level in solving the problem: from "I won't forget to water anymore!" to "I don't even need to water anymore!" Now you won't have to worry about watering while you're away on a trip!

Just by moving one servo motor, you can build all kinds of mechanisms with a little creativity. Try inventing something that solves a problem around you!!