4.1.6. Motion Activated Security Floodlight
| Description | Learners will engineer an advanced 'Proximity Warning Radar' multi-component system. This design integrates HC-SR04 Ultrasonic + Active Buzzer + Traffic Light Module into a cohesive industrial automation unit. |
|---|---|
| Use case | This project connects to real-world industrial and IoT applications such as: Project 66 provides essential master-level engineering skills for real-world IoT, safety, and control systems. |
Components (Things You will need)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|---|---|
Building the circuit
Things Needed:
- Arduino Uno = 1
- Arduino USB cable = 1
- Servo motor = 1
- Jumper Wires
- Ultrasonic Sensor
- Buzzer
- Traffic Light Module
- Bread Board
Mounting the component on the breadboard and wiring the circuit
Step 1: Connect the Sensors
Connect the sensor input leads to the appropriate analog or digital pins on the Arduino.
Step 2: Connect the Actuators and Displays
Connect the actuator and display output leads to the required digital, PWM, or I²C pins on the Arduino.
Step 3: Connect the Power Lines
Connect all VCC power lines to the appropriate 5V or 3.3V power pin on the Arduino, according to the component requirements.
Step 4: Connect the Ground Lines
Connect all GND lines to an available GND pin on the Arduino or to the breadboard's common ground rail.
Step 5: Perform a Final Check
Carefully check all wiring to ensure that the power, signal, and ground connections are correct. Verify that each component is connected to the required 5V, 3.3V, or GND connection.
Step 6: Connect the USB Cable
After verifying all connections, connect the Arduino USB cable to the Arduino and the computer to power the board and begin programming.

Make sure to connect the Arduino USB cable to the Arduino board.
PROGRAMMING
Step 1: Open your Arduino IDE. See how to set up here: Getting Started.
Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.
// Project 66: Proximity Warning Radar
// Target Integration: HC-SR04 Ultrasonic + Active Buzzer + Traffic Light Module
const int trigPin = 2;
const int echoPin = 3;
const int redLed = 4;
const int yellowLed = 5;
const int greenLed = 6;
const int buzzer = 7;
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(redLed, OUTPUT);
pinMode(yellowLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
Serial.println("Project 66: Proximity Warning Radar Initialized...");
}
void loop() {
long duration, distance;
// Trigger sensor
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read echo
duration = pulseIn(echoPin, HIGH);
distance = (duration / 2) / 29.1;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
// Logic control
if (distance > 0 && distance < 10) {
// Red Light + Buzzer
digitalWrite(redLed, HIGH);
digitalWrite(yellowLed, LOW);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000);
} else if (distance >= 10 && distance < 25) {
// Yellow Light
digitalWrite(redLed, LOW);
digitalWrite(yellowLed, HIGH);
digitalWrite(greenLed, LOW);
noTone(buzzer);
} else {
// Green Light
digitalWrite(redLed, LOW);
digitalWrite(yellowLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(200);
}
Step 3: Save your code. See the Getting Started section
Step 4: Select the arduino board and port See the Getting Started section:Selecting Arduino Board Type and Uploading your code.
Step 5: Upload your code. See the Getting Started section:Selecting Arduino Board Type and Uploading your code
CONCLUSION
By integrating the HC-SR04 sensor, active buzzer, and traffic light module, students gained practical experience in building sensor-based safety and automation systems.
This project strengthens understanding of input processing, actuator control, and real-world IoT applications, preparing learners to develop more advanced monitoring and control solutions.







