Note: ALL OSOYOO Products for Arduino are Third Party Board which is fully compatitable with Arduino

Authorized Online Retailers

Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP


Objective

In this lesson, we will install 2pcs IR Obstacle Avoidance modules on robot car and program the car to follow object movements. The principle of this experiment is based on IR detection object. The car receives the signal from the IR Obstacle Avoidance module, and then the program will drive the car to take actions.
You must complete lesson 1 (assembling the car) before you continue on with this lesson.

Parts and Devices:


Hardware Installation

Install devices

Step 1: Install the smart car basic frame work as per Smart Car Lesson 1 . If you have already completed installation in Lesson 1 , just keep it as is.

Step 2: Remove the screws on copper pillars and add 2pcs IR Obstacle Avoidance modules onto the car. Install the IR Obstacle Avoidance modules with 2pcs M2.5*10 plastic screws, M2.5 plastic pillars and M2.5 plastic nuts at the back of low car chassis.

Step 3: Connect 2pcs IR Obstacle Avoidance modules as below connection diagram (Remember : DO NOT remove any existing wires installed in Lesson 1 ) :

Step 4: Fix the screws on copper pillars to connect upper chassis to lower chassis.


Software Installation:

Open-source Arduin
Software(IDE)
Download Arduin IDE here:
https://www.arduino.cc/en/Main/Software?setlang=en
7 zip is a free zip
utility that un-zips zip files
Download 7zip here for free
https://www.7-zip.org/

Step 1: Install latest Arduin IDE (If you have Arduin IDE version after 1.1.16, please skip this step)Download Arduin IDe from https://www.arduino.cc/en/Main/Software?setlang=en , then install the software.

Step 2: Download Lesson One sample code from https://osoyoo.com/driver/v2smartcar-lesson3.zip , unzip the download zip file v2smartcar-lesson3.zip, you will see a folder called v2smartcar-lesson3 .

Step 3: Connect OSOYOO basic board to PC with USB cable, Open Arduin IDE -> click file -> click Open -> choose code “v2smartcar-lesson3.ino” in v2smartcar-lesson3 folder, load the code into arduin. (Notice: Shut off your battery or Unplug your power adapter when upload sketch code to Arduin.)

Step 4: Choose corresponding board/port for your project,upload the sketch to the board.

Step 5: Turn on the car, put object about 10cm ahead of each IR Obstacle Avoidance modules and adjust potentiometer on IR Obstacle Avoidance modules to detect object or your hand.

Note: When these module detect objects, the power indicator and signal indictor are on. when you move object over detection distance, the power indicator is on. If the signal indictor is always on even though the object is over detection distance, you also need to adjust the potentiometer

Final Testing :

Turn on the car, move object or your hand ahead of car, and then the car will move accordingly: looks like you pull it. It goes forward when both IR Obstacle Avoidance modules detect object or your hand; it turns right when the right IR Obstacle Avoidance modules detect object; it turns left when the left IR Obstacle Avoidance modules detect object.
when object or your hand is over 10cm ahead, it will stop.

Note:
1) As IR Obstacle Avoidance modules are installed at the back of the car, all movement directions are contrary to other courses.
2) The car can only move forward, turn right and turn left, but cannot move backward.