HomeTurtlegraficsGPanelRobotics WebTigerPython
 Python - Online
alarmanlagen
Deutsch   English   

9. ALARM SYSTEMS

 

 

YOU LEARN HERE...

 

how you can use the Calliope to monitor systems and trigger an alarm if necessary.

 

 

MONITOR THE WATER LEVEL

 

 

You rarely need to water your little plant, but you can't forget to do so. With your Calliope, you can monitor the water level and trigger an alarm if it is too low.

You use the property of water to conduct electricity, so if you create a circuit from the 3V (+) power supply to pin 1, which leads through the water, a higher voltage will be measured at pin 1 than when the circuit is open. You only need two cables with crocodile clips and two pieces of wire or other metal that you insert into the flower pot as probes.

Connect one cable to pin 1 and the other to 3V.

 

You can use any water container for the program development.

With the command pin1.read_analog()

you measure the voltage at P1 and write the value into the terminal window. As you can see, the difference in the measured values is large, depending on whether the probes are in the water or not.

Program:

from calliope_mini import *

while True:
    v = pin1.read_analog()
    print(v)     
    sleep(500)
► Copy to clipboard

As your own work, add a visual or acoustic warning to the alarm system.

 

 

REMEMBER...

 

You can easily set up simple alarm systems with the Calliope as an embedded system if you combine your manual skills with some knowledge of electronics and programming.

 

 

TO SOLVE IT YOURSELF

 

 

1.

Add a visual alarm indicator to your system on the LED display. When the water level is normal, the Image.HAPPY image should be displayed; when the water level is low, the Image.SAD image should be displayed.

2.
Add an acoustic signal to the alarm system, which is triggered by the built-in loudspeaker when the water level is low.

3.

Set up an alarm system that monitors whether a door is opened. You can use the position sensor for this.