Robots are supporting human behaviors, activities, and jobs in several remarkable ways. From robotic arms and hands to robots that perform surveillance and maintenance tasks, this technology is rapidly advancing to help make certain tasks safer, faster or more accessible.
These robots are either automatic – meaning they can operate automatically without any human intervention – or remotely controlled, meaning they operate manually from a remote location. Remote-controlled robots are typically wireless.
Examples of remotely controlled robots include:
- Snake robots – can enter extremely narrow or small tunnels or pipelines, these robots are mainly used to find problems (such as a leak in a pipeline) but can also be used for search and rescue operations.
- Fire fighting robots – are used as a fire extinguisher that sprays water or CO2 on the fire. An operator controls this robot from a safe location and tries to extinguish the fire so that the firefighter does not have to put his life in danger.
- My Diffuser Robots – are used to diffuse active bombs or mines across a battlefield. An operator can control its movements from a safe, remote distance, diffusing a bomb (or mine) without risking life.
The Bluetooth-controlled robot
As robots advance, so does the ability to communicate with them. Today's remote-controlled robots are generally wireless, which is typically done using a smartphone via Bluetooth communication. This means that anyone can control the robot's movements with the touch of their fingers.
One industry that has benefited from robotic support is the agricultural sector. These robots can be controlled or programmed wirelessly to automate slow or repetitive tasks for farmers, allowing them to focus more on improving overall production yield. Some of the most common robots in agriculture are used to seed, spray, harvest, harvest and control weeds.
The project
For our purposes, we are going to build a robot that can help with basic plant growth. Four conditions must be ideal for a plant to grow healthy.
1. Temperature
2. Humidity
3. Soil moisture
4. Ambient light (light intensity).
Three sensors will be used on our robot to monitor these conditions.
Additionally, for this project, the operator will be:
- Able to maneuver the robot within a radius of 10 to 30 meters while taking measurements and selecting the ideal location for planting.
- Able to achieve temperate, humidity, soil moisture and ambient light measurements after planting.
- Able to take corrective action to change any of these four conditions.
Although this robot is built to care for plants, it is important to note that the concept can easily be used for different applications by changing the sensors. For example, if we equip the robot with MQ2, MQ3 or a similar gas sensor, the robot can be used to detect gas leaks of any GAS like CO2, CO, LPG, etc.
But for now, let's focus on developing a robot to care for plants.
The system block diagram
The main building blocks of the system are three sensors for:
1. Soil moisture: used to measure the moisture content in the soil and provides analog voltage output according to the measured moisture level. Its output voltage decreases as the moisture content increases.
2. DHT11 temperature and humidity sensor: measures atmospheric temperature and humidity. Provides direct digital values for temperature in Celsius and humidity in %RH. It's a smart sensor.
3. LDR, Arduino UNO development board, Bluetooth module, two DC motors and motor driver chip.
The Bluetooth module is used for commanding purposes (to move the robot forward, backward, left and right) from a smartphone. It provides this data, serially, to the Arduino UNO microcontroller.
The Arduino UNO board performs the following tasks:
- Reads the analog output voltage of the soil moisture sensor and converts it to digital. It then calibrates between a humidity level of 0 to 100%.
- Reads temperature and humidity values from the DHT11 sensor.
- Reads the analog voltage output from the LDR and calibrates the light intensity between 0-100%.
- It receives different commands from the Bluetooth module and rotates the two DC motors to move the robot forward, backward, left or right.
- Sends (transmits) these readings from all three sensors to a smartphone via the Bluetooth module.
The motor driver supplies enough voltage and current to both motors to turn them. It also amplifies the output of the Arduino board and drives the motors.
The DC motors drive the robot's left and right wheels and move the robot forward, backward, left, and right.
Now, let's see how the circuit is constructed from this block diagram.
The circuit diagram
Circuit description
- The HC-05 module operates with the 5V supplied by the Arduino board. It communicates with the Arduino board with USART Tx-Rx pins. This means that its Tx pin is connected to the Rx pin of the Arduino board and vice versa.
- The DHT11 sensor also provides 5V power from the Arduino board. Its digital output is connected to digital pin D7 on the Arduino board.
- The analog output of the soil moisture sensor is connected to the A1 analog input pin of the Arduino board. Requires 5V bias voltage from Arduino board.
- The LDR is configured in pull-down mode with the 10 KΩ pull-down resistor. Its analog output is given to analog input pin A0.
- digital pins D8, D9, D10 and D11 drive the two DC motors using the L293D chip. These pins are connected to the inputs of the L293D and the two motors are connected to the output of the chip.
- The Vss motor power pin of the L293D (pin number 8) receives 12V from the battery.
- The Arduino board also receives 12V input from the battery on its Vin pin. It takes 12V input and provides 5V output to all other components.
Functioning and operation of the circuit
The circuit works when the 12V battery is connected to the Arduino UNO board and the L293D chip.
- Initially, both motors are stopped and the robot is also at rest.
- To move the robot in any direction, we have to give commands from the smartphone through the Bluetooth-based Android app.
- To do this, we have to open (launch) the Bluetooth Android application on the smartphone and then search for the HC05 Bluetooth module. Once the smartphone detects the HC05 module, you need to pair the module with the app so that it can send commands from the smartphone via Bluetooth to the HC05 module (note: you need to enter the password “1234” at the first time to pair with the module HC05).
- Now we can send commands to the robot to move forward, backward, left or right through the smartphone through the app.
These commands are used to move the robot (all these commands are defined in the Android application):
- When any of the above commands are sent (by sending a direct character or pressing the application button), it is received by the HC05 module. The module also provides this command to the Arduino, in series, through the Tx-Rx pins.
- Arduino receives this command and compares it with the defined commands. If it finds a match, it will rotate the left and right motors accordingly to move the robot in any of the four appropriate directions.
- Once the robot starts its movement, it will move continuously until we send the 'S' command to stop.
- When the robot stops, it will start reading the DHT11 sensor values, soil moisture and LDR. It will read the analog voltage output from the soil moisture sensor and LDR and convert it to a range of 0 to 100%. It will also read digital temperature and humidity values from the DHT11 sensor.
- Then it transmits all four values of soil moisture, light intensity, temperature and humidity to the smartphone via the Bluetooth module, it will continuously transmit these four values every two seconds until stopped.
- Upon receiving the command to start moving again, it will stop transmitting values.
- The operator can take this robot to the desired location and measure these four conditions. He or she will get the readings on their smartphone while moving the robot with the touch of a finger.
- It should be easy to program the environmental conditions of temperature, humidity, soil moisture and light intensity in the nearby area
The software program
The program is written in C/C++ language using Arduino IDE software tool. It is also compiled and downloaded into the internal memory (FLASH) of the ATMega328 microcontroller using this same software.
Here is the program code:
#include
#include
#include “DHT.h”
#define LDR_pin A0
#define solo_moisture_sensor_pin A1
#define DHTPIN2
#define DHTTYPE DHT11
Servo solo_moisture_servo;
int light_intensity, soil_moisture;
Liquid Crystal LCD (12, 13, 8, 9, 10, 11);
DHT dht(DHTPIN, DHTTYPE);
int motor1Pin1 = 4; //pin 2 on IC L293D
int motor1Pin2 = 5; //pin 7 on IC L293D
int motor2Pin1 = 6; //pin 10 on IC L293D
int motor2Pin2 = 7; //pin 15 on IC L293D
int humidity_sensor_servo_pin = 3;
internal state;
int stopflag = 0;
null configuration
{
// define the pins as outputs:
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);
pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);
solo_moisture_servo.attach(moisture_sensor_servo_pin);
solo_moisture_servo.write(0);
Serial.begin(9600);
lcd.begin(16, 2);
lcd.claro;
lcd.setCursor(2, 0);
dht.begin;
lcd.print(“Data logger”);
lcd.setCursor(6, 1);
lcd.print(“Robot”);
delay(5000);
lcd.claro;
lcd.print(”t*CH % L % M %”);
}
empty loop
{
int h = dht.readHumidity;
int t = dht.readTemperature;
light_intensity = analogRead(LDR_pin);
light_intensity = map(light_intensity, 750, 50, 5, 100);
lcd.setCursor(9, 1);
lcd.print(light_intensity);
lcd.setCursor(1, 1);
lcd.print
lcd.setCursor(5, 1);
lcd.print(h);
if (stopflag == 1)
{
soil_moisture = analogRead(soil_moisture_sensor_pin);
soil_moisture = map (soil_moisture, 1015, 100, 0, 100);
lcd.setCursor(13, 1);
lcd.print(soil_moisture);
Serial.print(“Humidity:”);
Serial.println(h);
Serial.print(“temp:”);
Serial.println
Serial.print(“light:”);
Serial.println(light_intensity);
Serial.print(“humidity:”);
Serial.println(soil_moisture);
delay(1000);
}
if (Serial.available > 0)
{
state = Serial.read;
// if the state is '1' the DC motor will advance
if (state == '1')
{
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
stop flag = 0;
solo_moisture_servo.write(0);
}
else if (state == '2')
{
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
stop flag = 0;
solo_moisture_servo.write(0);
}
// if the state is '3' the engine will stop
else if (state == '3')
{
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
stop flag = 1;
delay(500);
solo_moisture_servo.write(90);
delay(500);
}
// if the state is '4' the motor will rotate to the right
else if (state == '4')
{
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
stop flag = 0;
solo_moisture_servo.write(0);
}
}
}
(tagsToTranslate)Arduino