Another illustration that very useful building an obstacle bot or a project that used obstacle avoidance. This module allows for sensing of solid objects within a fixed range it is actually an adjustable with on-board potentiometer. This guide is guide how to wire the module for obstacle avoidance sensing. It is a very simple module that requires only one DIO pin defined as an input to operate. When the sensor detects a reflective object in close proximity it will pull a connected DIO pin to LOW or a non-reflective, no object in close proximity will cause the DIO pin to go HIGH.
Required Components
Arduino UNO/MEGA/PRO/MINI
Obstacle Avoidance Sensor Module Board
Jumper wires
Solder-less Breadboard
Wiring Guide
Arduino Sketch Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
/*__________________________________________________________ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 14CORE.com ARDUINO OBSTACLE AVOIDANCE MODULE $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ____________________________________________________________ */ #define SENS_DIO 2 //Define as the Arduino Digital Pin 2 void setup() // Initializing Input Operation { Serial.begin(9600); //start serial port for displaying the status of the sensor in baurd rate 9600 pinMode(SENS_DIO, INPUT); //Configure the Input Operation pin in the sensor will be connected to as an input } void loop() /* program loop */ { if (!digitalRead(SENS_DIO)) // If the board detect an object it will pulled as low. Serial.println("14CORE> Object detected !"); delay(200); //Delay at 2 seconds then ready to read again. } |