Outdoor Mobile Robotic Assistant Micro-Controller Module (Arduino), Firmware and Infrared Sensor Circuit Design and Implementation, Operating Principle and Usage of Pirmotion Sensor

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, detect the motion in the surroundings and can also send an alarm. The robot was designed to be able to navigate to the lowerpots 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.


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 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.

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 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.

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. 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.

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 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. 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 110 o 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.

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.

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.

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.

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.

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 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.