π§ͺ Testing and Feature Options
π― Lesson Objective
In this lesson, students will learn:
β’ How to test the Light Sensitive Robot
β’ How to verify that the LDR sensor is detecting light correctly
β’ How to confirm that the motors are working properly
β’ How to troubleshoot common problems
β’ Additional features that can improve the robot
This lesson focuses on testing the robot and improving its performance.
1οΈβ£ Checking the Hardware Setup
Before running the robot, it is important to check all hardware connections.
Verify the following:
β ESP32 is connected properly
β LDR sensor module wiring is correct
β Motor driver connections are correct
β Motors are connected to the correct terminals
β Battery polarity is correct
β All components share a common ground
Incorrect wiring is one of the most common reasons why robotics projects fail.
Always check the circuit before powering the system.
2οΈβ£ Uploading the Program
To start testing the robot:
1οΈβ£ Connect the ESP32 to the computer using a USB cable.
2οΈβ£ Open Arduino IDE.
3οΈβ£ Select the correct ESP32 board.
4οΈβ£ Select the correct COM port.
5οΈβ£ Upload the program to the ESP32.
Once the program is uploaded, the robot will start running automatically.
3οΈβ£ Testing the LDR Sensor
The first step is to verify that the LDR sensor is working properly.
Steps to test:
1οΈβ£ Open the Serial Monitor in Arduino IDE.
2οΈβ£ Set the baud rate to 9600.
3οΈβ£ Observe the light sensor values displayed.
Example output:
Light Value: 3000
Light Value: 1500
Light Value: 900
Now perform the following test:
β’ Shine a flashlight or phone light on the LDR sensor.
β’ Cover the LDR sensor with your hand.
You should see the light values change.
This confirms that the LDR sensor is functioning correctly.
4οΈβ£ Testing the Motors
After verifying the sensor, the next step is to test the motors.
Steps:
1οΈβ£ Place the robot on a flat surface.
2οΈβ£ Shine a light toward the LDR sensor.
3οΈβ£ The robot should begin moving forward.
4οΈβ£ Remove the light or reduce the light intensity.
5οΈβ£ The robot should stop.
If the robot moves correctly, the system is working as expected.
5οΈβ£ Complete Robot Test
Once both the sensor and motors are working, test the full robot behavior.
Testing process:
1οΈβ£ Turn on the robot.
2οΈβ£ Move a light source near the LDR sensor.
3οΈβ£ The robot detects the light intensity.
4οΈβ£ The ESP32 processes the sensor value.
5οΈβ£ The motors activate and the robot moves.
This confirms that the Light Sensitive Robot is operating correctly.
6οΈβ£ Troubleshooting Common Problems
Students may encounter some common issues.
Problem: Robot not moving
Possible causes:
β’ Motor driver wiring incorrect
β’ Motors not connected properly
β’ Battery not supplying enough power
Solution:
Check motor driver connections and battery power.
Problem: Sensor value not changing
Possible causes:
β’ LDR sensor not connected properly
β’ Wrong analog pin used
β’ Sensor damaged
Solution:
Verify LDR wiring and confirm the analog pin connection.
Problem: Robot always moving
Possible cause:
The light threshold value in the code may not match the environment.
Solution:
Adjust the threshold value in the program.
Example:
Adjust this value depending on the lighting conditions.
7οΈβ£ Improving the Light Sensitive Robot
Once the basic robot works, several improvements can be added.
Possible improvements include:
π‘ Adding two LDR sensors for better light direction detection
β‘ Using PWM to control motor speed
π Adding a buzzer indicator when light is detected
π‘ Adding LED indicators to show sensor activity
These improvements make the robot more advanced and interactive.
8οΈβ£ Real-World Applications
Light detection systems are widely used in modern technology.
Examples include:
π‘ Automatic street lights
π· Camera brightness sensors
π Smart home lighting systems
π Light-following robots
This project demonstrates how simple sensors can be used to build intelligent automation systems.
π What Happens Next
Now that you have successfully built and tested the Light Sensitive Robot, the next project will introduce physical interaction with the environment.