Brief:

The idea of the assignment is to use 2 sensors and 1-2 actuators in arduino to create a working system.

Concept:

Motion detection with lights:

The idea of the project is to use the ultrasonic sensor to detect objects coming close to it so the light sensor can be activated which it turn forces the led lights to turn on, hence making aware of how close the object is to the ultrasonic sensor. 

Application: 

Parking lots where when the car is close to the wall, the light sensor causes the led lights to switch on for indication.

Components required:

Wiring diagram:

Explanation of wiring in steps:

Step 1: Setting up the ultrasonic sensor

Step 2: Setting up the servo motor

Step 3: Setting up the LDR sensor close to the servo motor; Sticking a strip on the motor so it can sweep over the LDR

Step 4: Setting up the LEDs

Final assembly and working:

As an object goes within a 10cm range of the ultrasonic sensor, the strip on the servo motor will turn by 90 degrees, this covering the LDR sensor. As it gets dark over the LDR, the blinking green LEDs will be constantly lit. As the object moves away from the ultrasonic sensor, the strip over the servo motor goes back to its initial position. 

Code:

Video: