Overview
In this Robotic project, we will build an Automatic Grass Cutter Robot or a Lawn mower robot using Arduino. The Robot can cut the excess grass in the garden automatically. If there is an obstacle in the garden then it will automatically change its direction. It helps to reduce human efforts.
The article provides a basic overview of the project with the components required for making an Arduino Grass Cutter Robot. The circuit schematic along with Arduino Source code is provided so that the assembly process and programming process can be made easier.
WARNING: This project is not a toy, it contains sharp blades which can cause serious injuries if it is not used carefully. Do not leave it unattended. The blades should be correctly fixed. Check before operating the Robot.
Bill of Materials
We need the following components to build an Arduino Automatic Grass Cutting Robot. You can purchase all the components from the given links.
| S.N. | Components | Quantity | Purchase Links |
|---|---|---|---|
| 1 | Arduino UNO Board | 1 | Amazon | AliExpress |
| 2 | L293D Motor Driver Shield | 1 | Amazon | AliExpress |
| 3 | Ultrasonic Sensor HC-SR04 | 1 | Amazon | AliExpress |
| 4 | Ultrasonic Sensor Case/Holder | 1 | Amazon | AliExpress |
| 6 | DC Gear Motors | 4 | Amazon | AliExpress |
| 7 | BLDC Motor 100KV | 1 | Amazon | AliExpress |
| 8 | Servo Motor SG-90 | 1 | Amazon | AliExpress |
| 9 | ESC Module | 1 | Amazon | AliExpress |
| 10 | Servo Motor Tester | 1 | Amazon | AliExpress |
| 11 | 3-Pin Slide Switch | 1 | - |
| 12 | X Type Cross Holder | 1 | - |
| 13 | Robot Chasis | 1 | Amazon | AliExpress |
| 14 | 11.1V Lipo Battery | 1 | Amazon | AliExpress |
What is a Grass Cutting Robot (Lawn Mower)?
A grass-cutting robot, also known as a lawn mower robot, is a robotic device designed to automatically cut and maintain a lawn. These robots use sensors and algorithms to navigate and mow the lawn and can be programmed to cut the grass on a specific schedule or in response to the growth rate of the grass. Some grass-cutting robots are also equipped with features such as obstacle detection, anti-theft protection, and remote control via a smartphone app. They are becoming more popular in recent years as a way to save time and effort on lawn maintenance.
Grass-cutting robots use a variety of technologies to navigate and cut the lawn. Some use a random pattern to cover the entire lawn, while others use more advanced algorithms such as spiral patterns to ensure that the entire lawn is evenly cut. The robots typically have sensors that help them detect obstacles such as trees, rocks, and gardens, and they will adjust their path accordingly to avoid damaging these areas.
The robots are usually equipped with a cutting mechanism, which can be a reel of cutting blades or a rotary blade. The cutting height can be adjusted to suit the length of the grass and the robot can be programmed to cut the lawn at a specific height. Some robots also have a mulching function, which finely cuts the grass clippings and returns them to the lawn as a natural fertilizer.
Overall, grass-cutting robots are a convenient and efficient way to maintain a lawn. They can save time, effort, and energy compared to manual lawn mowing and can help ensure that the lawn is kept in good condition all year round.
Block Diagram: Automatic Grass Cutting Robot using Arduino
The block diagram of Arduino Automatic Grass Cutting Robot shows how the different components are connected and how they interact with one another to perform the task of cutting grass automatically.
The Arduino board acts as the brain of the robot, controlling all the other components and executing the programmed instructions. The ultrasonic sensor is used to detect the location of grass and obstacles in the robot’s path.
The L293D motor driver Shield is used to control the movement of the robot and is connected to the microcontroller. The 4 DC Gear motors are used to power the movement of the robot. And Servo Motor SG90 is attached at the head so pan motion to look for an obstacle on the left, right, and front.
For the cutting mechanism, a 100KV BLDC motor is used which rotates at a very high speed. This motor is connected to a cutting blade, which is used to cut the grass. The on/off mechanism and speed of the motor is controlled using the Servo Motor tester. You can use BLDC Motor Controller for this application.
The robot requires a power source to operate, which can be a rechargeable battery or a power cord. In our case, we are using an 11.1V Lipo Battery.
Circuit Diagram & Connections
A circuit diagram of an automatic grass cutting robot using Arduino would show the connections between the different components of the robot. Here’s an example of what the circuit diagram used for this project.
The L293D Motor Driver Shield is connected to the top of the Arduino UNO Board. The 4 DC motors are connected to the Motor Driver shield which is controlled via digital pins D1, D2, D3, and D4 of the Arduino UNO Board. The Servo Motor is controlled via PWM Pin D10 of Arduino. The Ultrasonic Sensor HC-SR04 has TRIGN & ECHO Pins which are connected to A0 & A1 of the Arduino Board.
To control the BLDC Motor an ESC Module Servo Tester is used. The entire circuit is powered by an 11.1V Lithium-Ion Battery. The Arduino has a 5V regulator which converts the 11.1V to 5V Supply. The BLDC Motor directly operates at 11.1V.
Source Code/Program
The program for Grass Cutting Lawn Mower Robot is written on Arduino IDE. We need to add few libraries to the Arduino IDE.
- AFMotor Library: https://github.com/adafruit/Adafruit-Motor-Shield-library
-
NewPing Library: https://github.com/microflo/NewPing
Copy the following code and upload it to the Arduino UNO Board.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
#include <AFMotor.h> #include <NewPing.h> #include <Servo.h> #define TRIG_PIN A0 #define ECHO_PIN A1 #define MAX_DISTANCE 200 #define MAX_SPEED 190 #define MAX_SPEED_OFFSET 20 NewPing sonar(TRIG_PIN, ECHO_PIN, MAX_DISTANCE); AF_DCMotor motor1(1, MOTOR12_1KHZ); AF_DCMotor motor2(2, MOTOR12_1KHZ); AF_DCMotor motor3(3, MOTOR34_1KHZ); AF_DCMotor motor4(4, MOTOR34_1KHZ); Servo myservo; boolean goesForward=false; int distance = 100; int speedSet = 0; void setup() { myservo.attach(10); myservo.write(115); delay(2000); distance = readPing(); delay(100); distance = readPing(); delay(100); distance = readPing(); delay(100); distance = readPing(); delay(100); } void loop() { int distanceR = 0; int distanceL = 0; delay(40); if(distance<=15) { moveStop(); delay(100); moveBackward(); delay(300); moveStop(); delay(200); distanceR = lookRight(); delay(200); distanceL = lookLeft(); delay(200); if(distanceR>=distanceL) { turnRight(); moveStop(); }else { turnLeft(); moveStop(); } }else { moveForward(); } distance = readPing(); } int lookRight() { myservo.write(50); delay(500); int distance = readPing(); delay(100); myservo.write(115); return distance; } int lookLeft() { myservo.write(170); delay(500); int distance = readPing(); delay(100); myservo.write(115); return distance; delay(100); } int readPing() { delay(70); int cm = sonar.ping_cm(); if(cm==0) { cm = 250; } return cm; } void moveStop() { motor1.run(RELEASE); motor2.run(RELEASE); motor3.run(RELEASE); motor4.run(RELEASE); } void moveForward() { if(!goesForward) { goesForward=true; motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD); for (speedSet = 0; speedSet < MAX_SPEED; speedSet +=2) { motor1.setSpeed(speedSet); motor2.setSpeed(speedSet); motor3.setSpeed(speedSet); motor4.setSpeed(speedSet); delay(5); } } } void moveBackward() { goesForward=false; motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(BACKWARD); motor4.run(BACKWARD); for (speedSet = 0; speedSet < MAX_SPEED; speedSet +=2) { motor1.setSpeed(speedSet); motor2.setSpeed(speedSet); motor3.setSpeed(speedSet); motor4.setSpeed(speedSet); delay(5); } } void turnRight() { motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(BACKWARD); motor4.run(BACKWARD); delay(500); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD); } void turnLeft() { motor1.run(BACKWARD); motor2.run(BACKWARD); motor3.run(FORWARD); motor4.run(FORWARD); delay(500); motor1.run(FORWARD); motor2.run(FORWARD); motor3.run(FORWARD); motor4.run(FORWARD); } |
Testing Arduino Lawn Mower Robot
After uploading the code, you can take the Robot to the field and maybe in high grass areas. The tall grass region area can be a good choice for testing.
Turn on the Switch on the Robot & make sure that the power source is providing the correct voltage to the Arduino board and that all the components are properly connected. Test the motors of the robot by manually controlling the movement of the robot and ensuring that it moves smoothly and accurately.
Test the sensors of the robot by placing obstacles in its path and ensuring that it avoids them. Also, check the sensor range and sensitivity to ensure that the robot can detect grass.
Now using the Servo tester activate the BLDC Motor. Then test the cutting mechanism by manually activating it and ensuring that it cuts the grass effectively.
Finally, test the robot’s navigation and autonomy as it moves around a test area and cut the grass. Check that the robot can navigate around obstacles and that it cuts the grass to the desired height.

















2 Comments
Can you please give me detailed description for connections and circuit diagram i mean arduino connections
This project is a fantastic example of how technology can make our lives easier. Creating an Automatic Grass Cutting Robot using Arduino not only saves time but also ensures a well-maintained lawn. One tip to enhance this project is to consider adding a rain sensor. This way, the robot won’t operate when it’s raining, preserving both energy and the quality of your lawn.
How often do you think a grass-cutting robot should be scheduled to mow the lawn for optimal maintenance?
Thanks,
Matt