An experiment to avoid obstacles using IR Sensor.

 

Objectives:

To design a system that detects and avoids obstacles using an IR sensor.

To implement a simple autonomous navigation system using IR technology.

Components Required for IR Sensor with Arduino

1.Arduino UNO

2.USB cable for uploading the code

3.IR sensor

4.Buzzer and an LED

5.Jumper wires and a breadboard

6.220-ohm resistor

Theory: The IR sensor emits infrared light and detects the reflection from nearby objects. By measuring the intensity of the reflected light, the sensor can determine the presence and distance of obstacles. The microcontroller processes these signals and controls the motors to navigate around the obstacles, ensuring smooth movement without collisions.


Implementation Process:

Block Diagram:

Create a block diagram representing the connections between the IR sensor, microcontroller, buzzer ,arduino uno,Led.

Step-by-Step Implementation:

Connect the IR sensors to the Arduino uno board.

Connect the buzzer with Arduino uno board using connecting wires.

Write the code to read data from the IR sensors.

Implement the logic to control the motors based on the sensor data to avoid obstacles.

Upload the code to the Arduino uno software and test the system.


                                           CIRCUIT DIAGRAM



IR SENSOR



BUZZER



Circuit Diagram:

  • Create a circuit diagram showing the connections between the IR sensor, microcontroller, motor driver, and motors. This can be done using tools like Fritzing.

After completing the circuit diagram it will be look like


IR SENSOR WITH ARDUINO CODE
  1. int val = 0 ;
  2. void setup()
  3. {
  4. Serial.begin(9600); // sensor buart rate
  5. pinMode(2,INPUT); // IR sensor output pin connected
  6. pinMode(6,OUTPUT); // LED
  7. pinMode(7,OUTPUT); // BUZZER
  8. }
  9. void loop()
  10. {
  11. val = digitalRead(2); // IR sensor output pin connected
  12. Serial.println(val); // see the value in serial monitor in Arduino IDE
  13. delay(500);
  14. if(val == 1 )
  15. {
  16. digitalWrite(6,HIGH); // LED ON
  17. digitalWrite(7,HIGH); // BUZZER ON
  18. }
  19. else
  20. {
  21. digitalWrite(6,LOW); // LED OFF
  22. digitalWrite(7,LOW); // BUZZER OFF
  23. }
  24. }




We have to upload the code into Arduino uno software and plug the usb of the new made circuit board into pc to test the result



pin management





Result and Discussion:

  • Capture and describe the behavior of the system when encountering obstacles.
  • Discuss any challenges faced and how they were resolved.

Implementations:

  • The system can be implemented in various robotics applications such as autonomous vehicles, robotic vacuum cleaners, and obstacle detection systems in industrial automation.

Conclusion:

  • Summarize the success of the experiment in creating an obstacle avoidance system using IR sensors.
  • Reflect on the effectiveness of the IR sensor in detecting obstacles and the responsiveness of the system.

Post a Comment

0 Comments