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

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."

What You Need & Getting Ready
- SPACEBLOCK Standard Package [SPACEBLOCK board, USB cable, battery box]
- Soil moisture sensor module (soil moisture sensor)
- 8×8 RGB LED matrix panel (LED panel)
- 180° micro servo motor (servo motor)
- Jumper wires [3 pin header–pin socket wires × the number of wires you want to extend]
- A computer for programming

Connect the Expansion Parts to SPACEBLOCK


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 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.



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!
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."

Let's run it in standalone mode.
If there's enough water, it doesn't move.


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!!