5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



EASY plug Ultimate Starter Learning Kit Project 9: Avoiding obstacles

Posted by Fiona Su on

Overview
Why some intelligent robots can automatically avoid an obstacle ahead? Easily, use an obstacle avoidance sensor. In this project, we’ll simply test the obstacle avoidance sensor.
Component Required
  • EASY plug control board*1
  • EASY plug obstacle detector sensor *1
  • EASY plug LED module *1
  • EASY plug motor *1
  • RJ11 cable *2
  • USB cable*1
Component Introduction
Infrared obstacle avoidance sensor is equipped with distance adjustment function and is especially designed for wheeled robots.
This sensor has strong adaptability to ambient light and is of high precision. It has a pair of infrared transmitting and receiving tube.
When infrared ray launched by the transmitting tube encounters an obstacle (its reflector), the infrared ray is reflected to the receiving tube, after a comparator circuit processing, the indicator will light up.
You can adjust the detection distance by rotating the potentiometer knob, the effective distance range of 2~40cm.
They can be widely used in robot obstacle avoidance, avoidance car, line count, and black and white line tracking and many other occasions.
  • Working voltage: DC 3.3V-5V
  • Working current: ≥20mA
  • Working temperature: -10℃ to+50℃
  • Detection distance: 2~40cm
  • Output signal: TTL voltage
  • Effective Angle: 35°

Connect It Up
Connect the EASY Plug obstacle detector sensor and LED module to control board using RJ11 cables.

thumb

Test Code

thumb

What You Should See

thumb

Done uploading the code, when the sensor detects an obstacle, the led is turned on.

thumb

Controlling Motor
In the previous section, we use the obstacle detector sensor to control the LED on and off. Now, let’s try another play, controlling the motor rotating.
Hookup Guide

thumb

Test Code

thumb

What You Should See
Done uploading the code, when the sensor detects an obstacle, the fan motor rotates. Otherwise, fan motor stops.

Troubleshooting:

  • Compiling Fails ?

This happens sometimes, the most likely case is a library file not added. You should be sure that all the libraries are added to the libraries directory of Arduino-1.8.5. Shown below.

thumb

thumb

  • Program Not Uploading?

This happens sometimes, the most likely case is a confused Board and serial port, you should firstly select your proper board and port.

thumb

All Tutorials

Buy >> EASY plug Ultimate Starter Learning Kit 

0 comments

Leave a comment

Please note, comments must be approved before they are published