International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
OUTDOOR MOBILE ROBOTIC ASSISTANT
MICRO-CONTROLLER MODULE (ARDUINO),
FIRMWARE AND INFRARED SENSOR CIRCUIT
DESIGN AND IMPLEMENTATION, OPERATING
PRINCIPLE AND USAGE OF PIRMOTION SENSOR
Bashir Ahmad
Faculty of Engineering, Multimedia University, Cyberjaya, Selangor, Malaysia.
ABSTRACT
This paper presents an outdoor mobile robot that can be controlled remotely using an android phone. With
the help of the sensors, the robot was programmed to navigate within the bounded field, detectthe motion in
the surroundings and can also send an alarm. The robot was designed to be able to navigate to the
flowerpots placed in the zone and dispense water to those pots.The robot has proved capable of watering a
total of 600 ml to two different plants in a predefined area. The robot, if operating in a manual mode, can
be used to remotely water plants in a radius of 9 meters. On top of this, it emits no carbon and produces no
RoHS by-products and can thus be deemed 100% eco-friendly.
KEYWORDS
Arduino Uno, IR Sensor, PIR Sensor, Motor.
1. INTRODUCTION
Mobile robots are independent robots that are designed to perform specific tasks. They are very
convenient in domestic, military, space and medical purposes. Based ontheir functional
capabilities and utility, mobile robots can be classified into two types - indoor and outdoor.
Indoor mobile robots can be used for industrial applications, floor cleaning, material handling etc.
Outdoor robots can be used for patrol, surveillance, exploring planets in space functions, watering
the flowers, navigating obstacles on the ground, etc.
The aim of this project is to introduce an outdoor mobile robot that can move inside the field
which consists of an area with the dimensions 1800mm × 1800mm. There are two zones: Patrol
Zone and Flowerpot Zone. Patrol zone is an area with the dimension of 1100mm × 1100mm and
Flowerpot Zone is an area that is extended 300mm beyond the boundary of the Patrol Zone. The
boundary between the two zones is a black line with the width of 50mm. The robot is
programmed in such a way that it is not allowed to cross the boundary between the two zones. It
has the ability to navigate within the Patrol zone and search for flowerpots placed in Flowerpot
zone and dispense water into the flowerpots. The robot is also able to sense the motion of a
foreign object/obstacle and alarm while patrolling in Patrol zone. An android phone with the aid
of communication link was used to control this robot. In addition, a voltage detector was used to
detect the battery voltage level of the robot.
To meet the above functionalities, IR sensor, motion sensor, ultrasonic sensor, bluetooth, linear
battery, DC geared motors and Arduino Uno Microcontroller were integrated.
DOI : 10.5121/ijaia.2018.9303
37
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
2. OVERVIEW OF THE ROBOTIC SYSTEM:
This robot is basically an outdoor mobile assistant which is designed to navigate within a Patrol
zone autonomously or via any electronic device. It was programmed to detect a flower pot located
at the edge of the Patrol zone while avoiding any moving objects in its way. It was also able to
establish a communication link with a computer or a smart phone via Bluetooth. This robot was
also designed to automatically navigate within the patrol, detect the flowerpots and dispense
water into the flowerpot. It was equipped with a built-in alarm system that notifies the user when
motion is detected.
The operational field of the robot consists of an area of 1800mm x 1800mm which includes two
zones: Patrol zone and Flowerpot zone. Patrol zone is an area with dimension of 1100mm x
1100mm which is surrounded by a 50mm thick line and is separated from the Flowerpot zone.
The robot is using a DC 12V LiPo battery as a power source. The total weight, excluding the
water container, of the whole robot is around 1 kg including all the circuits, sensors, mechanical
structure, and battery. The dimension of the robot is designed to be 270mm (L) x 210mm (W) x
500mm (H).
Figure 1: Basic Design of the Robot
Figure 1 shows the basic design and the components of the robot which includes microcontroller,
motor drivers, sensors and a wireless communication module to connect with a smart device or
laptop. Arduino Uno is used in this robot to provide specific functionalities using the
ATMega328 microcontroller. Two motors were used for the movement of the robot and for the
water plan system servo motor was deployed. To sense the Patrol zone and flower pots basically
3 types of sensors were used in this project: IR sensor,Pyroelectric infrared (PIR) sensor and
ultrasonic sensor. For wireless communication module to connect with a smart device, HC-05
Bluetooth serial module was used in this robot.
3. DESCRIPTION
All the sensors and motors are integrated using an Arduino Uno, which is based on ATmega328
microcontroller and contains 14 digital I/O, 6 analog inputs, 32KB flash memory, 2KB SRAM,
1KB EEPROM and performs at 16MHz clock speed. It has two Vcc ports which provides 5V at
100mA and 3.3v at 50mA. The Arduino itself is connected to a 12V lithium polymer battery
which is regulated to supply 5V to the Arduino. Arduino IDE 1.6.9 was used to write and burn
38
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
the code, C++ language, onto the board. For the purpose of this project, the Arduino will be
connected to several sensors to provide functionsfor an autonomous robot.
The primary sensor that will contain the car within the bounded, patrol region is the optical reflex
sensorwhich is made of IR light emitting diodes. This sensor detects the intensity of reflected
light. Patrol zone for the robot is bounded by a black line whereas the ground is a lighter shade of
blue. The difference in color allows the sensor to recognize the 2 states of light intensity.
The second sensor attached to the robot is the PIR sensor also known as a motion sensor or
passive infrared sensor. Basically, they are made of piezoelectric sensor which is divide into two
halves. This sensor detects heat in the form of radiation from moving sources. Although heat is
present in every object with temperatures above absolute zero, it will only respond to radiation
emitted or reflected from an object which can only occur when there is a change in the
environment i.e. some kind of movement. In autonomous mode, the robot will be using this
sensor to distinguish moving objects from stationary objects which will assist it in detecting
plants. There is a fourth sensor called the ultrasonic sensor attached to the robot that is used to
detect the plant, but that is beyond the scope of this report.
4. METHODOLOGY
4.1 Arduino Uno
The Arduino UNO is the central processing unit of this robot. A total of 10 digital inputs
and 2 analog inputs were used to connect the sensors, motors and Bluetooth. Since it
contains only one 5V output and 3 grounds, wires have been extended into a cut
breadboard to provide a 5V power line which is used by all three sensors. Figure 4 above
shows the block diagram of all the components connection and pin types to the Arduino.
Figure 2: Block Diagram of Arduino Connections
39
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
The software aspect of the Arduino is divided into 2 parts: autonomous mode and manual mode.
Using Arduino IDE 1.6.9, the code was written and burned onto the Arduino. As per the
requirement, the robot can run manually or autonomously. In manual mode, the robot will only be
using the servo motor and the driver motors to move and water the plant. The user will be sending
commands to the Arduino using the Bluetooth. In the autonomous mode however, the sensors
will take over car guiding it throughout its journey. The coding for the motor driver, IR sensor
and PIR sensor will be discussed later on in the report.
4.2 IR Sensor
The TCRT5000 IR sensor used consists of an IR Emitter and IR phototransistor. Two IR sensors
were used which were connected to analog pins of the Arduino. These sensors will send signals
from 0V to 5V. The Arduino board will then read the signal and, using an analog-to-digital
converter, convert the value to a number between 0 and 1023. After several trials, the ideal value
for the detection of a black line was found to be 300.
Figure 5: IR Sensor Internal Design
Figure 6 shows the schematic of one of the circuit of the IR sensor. A LM339N comparator was
used to integrate the 2 sensor circuits. Sensor 1 was connected to pin 5 whereas sensor 2 was
connected to pin 6. Pins 4 and 7 were connected to 5V. LEDS were added to the outputs at pins
1and 2 to give a visual signal when the sensors detect the black line. The outputs from pin 1 and 2
were added to the Arduino’s analog pins.
Figure 6: IR Sensor Circuit
Figure 7: LM339N Schematic
40
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
4.3 PIR Sensor
Figure 8: PIR Sensor Schematic
Figure 9: PIR sensor
The PIR sensor needs a supply voltage of 5V. The output from the sensor ranges from 0V (Low)
to 3.3V (High). The sensors output was directly connected to one of the analog pins of the
Arduino. Sensitivity and delay time can be adjusted using the potentiometers which can be seen
in Figure 8.It has a sensing angle smaller than 110o which can be adjusted by capping the sensor
and a sensing distance of less than 7 meters. The purpose of this sensor is to prevent the robot
from considering moving objects as plants. The ultrasonic sensor used for detecting the plant will
detect anything that comes within its range. PIR sensor will act as a filter which will keep the
robot away from moving objects. Once the coast is clear, the robot will proceed and if the
ultrasonic sensor gets triggered, the servo motor will drop the pipe to water the plant.
5. RESULTS AND DISCUSSION
The sensors, motors and bluetooth has all been integrated with the Arduino to provide specific
functionalities. These functionalities were set and adjusted using Arduino IDE 1.6.9. The code for
this robot has been divided into 2 segments: autonomous mode and manual mode. Modes can be
switched by using the bluetooth app.
5.1 Manual Mode
The code for the manual mode consists of the motors only: servo and driver motors. Using the
bluetoothapp, the user will send commands on moving forward, backward, left and right. The
driver motors are using PWM inputs on the Arduino. Using a ‘for’ loop, the PWM is incremented
by 5 from ‘0’ to ‘255’ with a delay of 5ms to accelerate and decelerate smoothly. The Bluetooth
is coded in a way that while the button is pressed, the car will keep moving in the direction
assigned. The servo motor is using a digital pin and initially positioned at 90º with respect to the
wooden board. Once the user presses the button to lower the pipe, the servo motor will go
through a ‘for’ loop code that will decrement the angle of the motor from 90º to 0º. Figure 10
shows the program flow of the manual mode with the exception of the servo motor for watering
the plant.
41
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
Figure 1: Manual Mode Program Flow
5.2 Autonomous Mode
The autonomous mode is a bit more complicated as the sensors determine the movements of the
robot. In this mode, it initially starts moving forward using PWM of 155. The IR sensor and PIR
sensors constantly checks for the black line on the floor and movement. If it reaches the black
line, the IR sensor will trigger to a value less than 300 and stop it. It will then back up using
PWM which will start at 155 and decrement by 1 until it reaches 0. A delay of 250ms will take
place before it turns left using the same PWM format as reversing and then continue forward. If
the PIR sensor detects motion, it will stop and the buzzer will beep. Figure 11 shows the program
flow of this mode excluding the ultrasonic sensor.
42
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
Figure 11: Autonomous Mode Program Flow
5.3 Results of the robot as a whole:
This outdoor mobile robot is able to move forward, backward, turn left and right at a controllable
speed. It can be controlled remotely using an android phone and is able to make communication
with it. It is designed to patrol only in the Patrol zone. With the help of the sensors, it can
distinguish sense motion in the surrounding and the ‘border’ of the two zones inside the field and
send an alarm. The robot can navigate within the bounded field. It can also navigate for
flowerpots placed in the flowerpot zone and dispense water. Its battery voltage level can also be
detected. This robot is environmentally friendly.
6. CONCLUSION
Overall this autonomous robotic is equipped to water maximum 2 plants in an area as its size and
weight can only afford to hold no more than 600ml water. This robot is quite primitive in the
43
International Journal of Artificial Intelligence and Applications (IJAIA), Vol.9, No.3, May 2018
context of current technological advancement. Its autonomous mode can only water limited plants
within its scope, in this case an area bounded by a black tape. This system can be improved to
meet other bounded regions but its limited size makes it suitable for small areas to perform in.
However, the manual mode can be used to remotely water plants in a radius of 9 meters. The
biggest advantage of this robot is that it’s 100% eco-friendly. The Li-PO battery doesn’t emit
carbon. The other mechanical components provided also doesn’t produce any RoHS by products .
REFERENCES
[1]
adafruit, "PIR motion sensor Tutorial," Instructables.com. [Online]. Available:
http://www.instructables.com/id/PIR-Motion-Sensor-Tutorial/. Accessed: Sep. 20, 2016.
[2] "What is an IR sensor?". [Online]. Available:
http://education.rec.ri.cmu.edu/content/electronics/boe/ir_sensor/1.html. Accessed: Sep. 20, 2016.
[3] "Introduction," 2016. [Online]. Available: https://www.arduino.cc/en/Guide/Introduction. Accessed:
Sep. 18, 2016.
[4] "What is an Arduino?". [Online]. Available: https://learn.sparkfun.com/tutorials/what-is-an-arduino.
Accessed: Sep. 21, 2016.
[5] "Autonomous robots," springer.com, 2016. [Online]. Available:
http://www.springer.com/engineering/robotics/journal/10514. Accessed: Sep. 25, 2016.
[6]
"Serial port Bluetooth module (master/slave): HC-05 - ITEAD Wiki,". [Online]. Available:
https://www.itead.cc/wiki/Serial_Port_Bluetooth_Module_(Master/Slave)_:_HC-05. Accessed: Sep.
22, 2016.
[7]
M. Media, "Arduino," Maker Shed, 2004. [Online]. Available:
http://www.makershed.com/collections/arduino. Accessed: Sep. 22, 2016.
[8] "Arduino articles on Engadget," Engadget, 2016. [Online]. Available:
https://www.engadget.com/tag/arduino/. Accessed: Sep. 20, 2016.
[9] "Newest ‘arduino’ questions," 2016. [Online]. Available:
http://stackoverflow.com/questions/tagged/arduino. Accessed: Sep. 22, 2016.
[10] "Mobile Open-Source," 2017. [Online]. Available:
http://http://www.scirp.org/journal/PaperInformation.aspx?PaperID=80090. Accessed: Sep. 22, 2016.
AUTHOR
Bashir Ahmad is an Electrical engineer and holds a B.Sc in Electrical Engineering
from Multimedia University, Malaysia. He operated in few presumed firms as an
engineer, he is tangled with correlated research workand leadership programs. His
area of emphasis is development, scheming,arranging, and augmenting core in
electrical engineering. Currently he is pursuing his PhD. in electrical engineering
with focus on dynamic voltage restoration.
44