Bukit Mertajam, Penang

Obstacle Avoiding Robot

Since we have successfully build Bluetooth Mobile Robot, let’s try to turn this robot to an “Obstacle Avoiding Robot” by adding an ultrasonic sensor to it. This robot will avoiding any obstacle in distance of 10 cm in front of it. Just follow this tutorial to know more ­čÖé

Hardware Preparation

This tutorial use :

  1. Maker UNO Bluetooth Robot Kit
  2. HC-SR04 Ultrasonic Sensor

You can make the hardware connection based on the diagram and table below.

Connection
Ultrasonic : TrigMaker UNO: Pin 3
Ultrasonic : EchoMaker UNO: Pin 4
Ultrasonic : GNDMaker UNO: GND
Ultrasonic : VCCL298ND : 5V
L298ND : ENAMaker UNO: Pin 5
L298ND : ENBMaker UNO: Pin 6
L298ND : IN1Maker UNO: Pin 7
L298ND : IN2Maker UNO: Pin 9
L298ND : IN3Maker UNO: Pin 10
L298ND : IN4Maker UNO: Pin 11
Figure 1 : Hardware Connection

Sample Code

This is the sample code used for this tutorial. Try it!

Thank you

Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.

Leave a comment