Learn how to set off an alarm when an object breaches a set perimeter.
In this mission, you will help Piperbot and Pip detect when an object breaches a set perimeter using the Ultrasonic Range Finder and sound an alarm. Ask students: “What do you think home security systems use as the sensor? What about smart doorbells?”
A servo, which is short for servomotor, is a special kind of motor that is used to control something by moving it. A simple motor moved by spinning continuously. A servo turns to a specific position and it uses gears to transform the high speed of the motor into more force so it can move things more easily.
The servo is connected using three wires: one for ground, one for power, and one for a signal that tells the servo motor what position to turn to. The Pico tells the servo what position to turn to by changing the width of the pulse that it is sending out. A pulse with a shorter "ON" time will turn to one side, and a pulse with a longer "ON" time will turn to the opposite side.
The motor inside of the servo turns very fast, but it is also weak - it cannot apply very much force. The gears inside the servo convert the motor's high speed and low force into a slower speed with more force.