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.
kidsIOT Mainboard×1 |
Steam Sensor×1 |
Passive Buzzer×1 |
Wire×2 |
USB Cable×1 |
Rainwater Control System LEGO Pieces×1 |
Process 1:
Process 2:
Process 3:
Process 4:
Process 5:
Process 6:
Process 7:
Process 8:
Process 9:
Complete:
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.
① Set the baud rate to 15200.
② Set the pin IO36 connected to the steam sensor to “input” mode.
③ Define a “Steam_sensor” global variable to store the analog value of the steam sensor.
④ Store the read analog value of the sensor in the “Steam_sensor” variable and print it on the serial port.
⑤ Complete Program
Click to upload the above complete code to the kidsIOT motherboard. After powering up via the USB cable, click 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!
①Set the baud rate to 15200, the IO36 pin of steam sensor to “input” mode.
② Define a “Steam_sensor” global variable to store the analog value of the steam sensor.
③ Receive analog value of the sensor and print it on the serial port.
④ Determine the received analog value of the sensor. When 800≤analog value<2000, the buzzer will sound alarm 1.
⑤ Determine the received analog value of the sensor. When 2000≤analog value<4000, the buzzer will sound alarm 2.
⑥ Determine the received analog value of the sensor. When analog value≥4000, the buzzer will sound alarm 3.
⑦ Complete Program
Click 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.
A: The detection area can be exposed to water, but when detecting water, please be careful not to use too much water.