IN THIS PROJECT, WE’LL USE AN ULTRASONIC SENSOR TO DETECT AN INTRUDER.
• Arduino board
• Jumper wires
• Four-pin HC-SR04 ultrasonic sensor
• Red LED
• Green LED
• 2 220-ohm resistors
We’ll connect the intruder sensor to a servo and some LEDs so that when someone comes within a certain distance, a green LED turns off, a red LED turns on, and the servomotor moves (see Figure 18-1).
This project is versatile and can be ...