X
Home > Blog > STEM for Arduino > HOW to Make a Rainwater Control System with KidsIOT
HOW to Make a Rainwater Control System with KidsIOT
By r August 30th, 2024 29 views
Note: Sprinkling water on other sensors will cause a short circuit and device failure. Sprinkling water on batteries will cause heating and explosion. Please be careful when using the device, especially when used by young children, it must be under the supervision of parents. To ensure safe operation of the device, please follow relevant usage guidelines and safety regulations.
Img

1. Description

This project explains how to use a steam sensor, a passive buzzer and a kidsIOT board to make a rain detection system. When the sensor detects rain, it sends a signal to the kidsIOT mainboard to trigger various actions.

For example, the buzzer can be used to sound an alarm to alert the user that it is raining. This system is able to monitor rainfall in gardening, agriculture, and detect leaks in roofs or buildings. The sensor can be easily connected to the kidsIOT motherboard to form a simple rain detection system.

2. Components

Img

Img

Img

kidsIOT Mainboard×1

Steam Sensor×1

Passive Buzzer×1

Img

Img

Img

Wire×2

USB Cable×1

Rainwater Control System LEGO Pieces×1

Img

3. Assembly Steps

Step 1:Components Needed

Img

Step 2:Process

Process 1:

Img

Process 2:

Img

Process 3:

Img

Process 4:

Img

Process 5:

Img

Process 6:

Img

Process 7:

Img

Process 8:

Img

Process 9:

Img

Complete:

Img

4. Wiring Diagram

Module

kidsIOT Mainboard

Steam Sensor

No.6 port(control pin is io36)

Passive Buzzer

No.8 port(control pin is io5)

Connect the kidsIOT mainboard to your computer via USB cable.

Img

5. Read the analog value of the steam sensor

Img

Step 1:Write the Program

① Set the baud rate to 15200.

Img

② Set the pin IO36 connected to the steam sensor to “input” mode.

Img

③ Define a “Steam_sensor” global variable to store the analog value of the steam sensor.

Img

④ Store the read analog value of the sensor in the “Steam_sensor” variable and print it on the serial port.

Img

⑤ Complete Program

Img

Step 2:Test Result

ClickImg to upload the above complete code to the kidsIOT motherboard. After powering up via the USB cable, click Img in the serial monitor and set the baud rate to 15200.

Then the serial monitor will print the value(range:0~4095) read by the steam sensor. Touch the detection area on the sensor with a moistened finger, the larger the area, the greater the value!

Img

6. Rainwater Control System

Img

(1). Programming Steps
Step 1:Flow Chart

Img

Step 2:Add “passive buzzer”

Img

Step 3:Write the Program

①Set the baud rate to 15200, the IO36 pin of steam sensor to “input” mode.

Img

② Define a “Steam_sensor” global variable to store the analog value of the steam sensor.

Img

③ Receive analog value of the sensor and print it on the serial port.

Img

④ Determine the received analog value of the sensor. When 800≤analog value<2000, the buzzer will sound alarm 1.

Img

⑤ Determine the received analog value of the sensor. When 2000≤analog value<4000, the buzzer will sound alarm 2.

Img

⑥ Determine the received analog value of the sensor. When analog value≥4000, the buzzer will sound alarm 3.

Img

⑦ Complete Program

Img

(2). Test Result

ClickImg to upload the above complete code to the kidsIOT mainboard. After powering up via the USB cable, when the rain value detected by the sensor is larger, the buzzer alarm sound will be louder.

Img

7. Common Problems
Q1: Is the steam sensor waterproof?

A: The detection area can be exposed to water, but when detecting water, please be careful not to use too much water.

Q2: After the sensor detects water, the alarm still sounds after a long time?
A: The passive buzzer keeps alarming because there are still water stains in the detection area of the sensor. Just clean it.
HOW to Make an Anti-theft Alarm with KidsIOT
Previous
HOW to Make an Anti-theft Alarm with KidsIOT
Read More
HOW to Make A Fan with Temperature Detection Function by Kidsuno
Next
HOW to Make A Fan with Temperature Detection Function by Kidsuno
Read More
Message Us