0% found this document useful (0 votes)
10 views33 pages

Full Book - Solar Base Grass Cutting Robot

The document presents a project report on the 'Smart Solar Grass Cutter with Lawn Coverage,' developed by students of City University, Dhaka, as part of their B.Sc. in Electrical and Electronic Engineering. This innovative system utilizes solar energy and advanced automation for efficient lawn maintenance, featuring obstacle detection and autonomous navigation. The project aims to provide a sustainable, user-friendly alternative to traditional grass-cutting methods while minimizing environmental impact and operational costs.

Uploaded by

aminuleee123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views33 pages

Full Book - Solar Base Grass Cutting Robot

The document presents a project report on the 'Smart Solar Grass Cutter with Lawn Coverage,' developed by students of City University, Dhaka, as part of their B.Sc. in Electrical and Electronic Engineering. This innovative system utilizes solar energy and advanced automation for efficient lawn maintenance, featuring obstacle detection and autonomous navigation. The project aims to provide a sustainable, user-friendly alternative to traditional grass-cutting methods while minimizing environmental impact and operational costs.

Uploaded by

aminuleee123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Smart solar Grass Cutter with Lawn Converge

B.Sc. Project

By

Most. Rita Akter


ID: 1922103504

Faruk Hossen
ID: 2122703037

Rocky Khan
ID: 2122703050

Nur Sadek
ID: 1932203087

A Project Report Submitted In Partial Fulfillment Of The Requirements For


The Degree Of Bachelor Of Science In Electrical And Electronic Engineering

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING


CITY UNIVERSITY, DHAKA, BANGLADESH

(December, 2024)

I
CERTIFICATE

The project titled “Smart solar Grass Cutter With Lawn Converge” submitted by
Most.Rita Akter ID: 1922103504, Faruk Hossen ID: 2122703037, Rocky Khan ID:
2122703050, Nur Sadek ID: 1932203087,has been accepted as satisfactory in partial
fulfillment of the requirement for the degree of Bachelors of Science in Electrical &
Electronics Engineering on December, 2024

Supervisor

……………………………..

MD. Aminul Islam


Assistant Professor
Electrical & Electronics Engineering
City University, Dhaka, Bangladesh

II
DECLARATION

This is to certify that the project titled “Smart solar Grass Cutter With Lawn
Converge” is the result of our study in partial fulfillment of the B.Sc. Engineering
degree under the supervision of MD. Aminul Islam. It is also hereby declared that
this project or any part of it has not been submitted elsewhere for the award of any
degree.

Submitted by

……………………………………….

Most.Rita Akter
ID: 1922103504
Electrical And Electronic Engineering
City University, Dhaka, Bangladesh

……………………………………….

Faruk Hossen
ID: 2122703037
Electrical And Electronic Engineering
City University, Dhaka, Bangladesh

……………………………………….

Rocky Khan
ID: 2122703050
Electrical And Electronic Engineering
City University, Dhaka, Bangladesh

……………………………………….

Nur Sadek
ID: 1932203087
Electrical And Electronic Engineering
City University, Dhaka, Bangladesh

III
ACKNOWLEDGEMENT

First of all we would like to pay our sincerest gratitude to the almighty Allah for
keeping us in sound mind and health during the work and giving us ability to work
hard successfully. Specially, we would like to thanks MD. Aminul Islam., Lecturer,
Department of Electrical and Electronic Engineering, City University for allowing us
to do the projects. His constant supervision, constructive criticism, valuable advice,
Scholarly guidance and encouragement at all stage of our work have made it possible
to complete this project.

We would like to give thanks to all the teachers of the department of Electrical and
Electronic Engineering for their constructive criticism and valuable advices and
cordial co-operation during study in the University. Specially thank to my family
members who gave us huge support and inspiration during our whole B.Sc. Course in
EEE.

In this connection, we also thank to the officers and staffs to the university of their
co-operation and to all others not stated here for their help and co-operation. Science
& Engineering, City University (Bangladesh) who is supported us in any case with his
kind and all the time during our project.

Finally, we would like to give thank to our course mates, friends and well wishers
who gave us huge support inspiration and their friendly and lovely company during
our project.

IV
ABSTRACT

The Smart Solar Grass Cutter with Lawn Coverage is an innovative and eco-friendly
solution for efficient lawn maintenance. This system integrates renewable solar
energy with advanced automation to create a sustainable alternative to conventional
grass-cutting methods. Equipped with solar panels, the device harnesses solar power
to charge its batteries, ensuring continuous operation with minimal environmental
impact. The grass cutter is designed to operate autonomously, employing smart
technologies such as ultrasonic sensors for obstacle detection, efficient navigation
algorithms for uniform lawn coverage, and adjustable cutting blades to achieve
precise grass cutting. The system eliminates the need for manual intervention, making
it a user-friendly and cost-effective solution for residential, commercial, and public
spaces. By combining sustainability, automation, and intelligent design, the Smart
Solar Grass Cutter addresses the challenges of energy consumption and labor-
intensive lawn maintenance. This project not only demonstrates the practical
application of renewable energy but also sets the stage for future advancements in
smart gardening technologies, contributing to environmental preservation and modern
lifestyle conveniences.

V
TABLE OF CONTENTS

Name Of The Content Page No.


Certificate II
Declaration III
Acknowledgement IV
Abstract V
Table of Figures VIII

Chapter 1: Introduction
1.1 Introduction 01
1.2 Objectives 01

Chapter 2: Literature Review & Methodology

2.1 Literature Review 03


2.2 Methodology 03

Chapter 3: Hardware & Software Description


3.1 Arduino Nano 06
3.2 Motor Driver 06
3.3 Buck Conveter 07
3.4 Solar Panel 07
3.5 Ultrasonic Sensor 08
3.6 Battery 08
3.7 Bo Motor 08
3.8 Switch 09

Chapter 4: System Design


4.1 Block Diagram 10
4.2 Circuit Diagram 11
4.3 Working Procedure 12
4.4 Hardware Implementation 12

Chapter 5: Results & Discussions


5.1 Experimental Results 13

Chapter 6: Conclusion
6.1 Conclusion 16
5.2 Future Scopes 16

VI
Refarences 20

Appendix
Programming Codes 21

VII
TABLE OF FIGURES

Figure No Figure Contents Page No

Figure 3.1 Arduino Nano 06


Figure 3.2 Motor Driver 06
Figure 3.3 Buck Conveter 07
Figure 3.4 Solar Panel. 07
Figure 3.5 Ultrasonic Sensor 08
Figure 3.6 Battery 08
Figure 3.7 Bo Motor 08
Figure 3.8 Switch 09

Figure 4.1 Block diagram of the proposed system 10


Figure 4.2 Complete circuit diagram of the project 11
Figure 4.4 Experimental setup of our system. 12

Figure 5.1 Cutting Blade off now. 13


Figure 5.2 Cutting Blade is rotating to cutting grasses. 13
Figure 5.3 Set Obstacle in front of our robot 14
Figure 5.4 Robot Changing the way of Movement. 14
Figure 5.5 Robot Changing the way more and more 14
Figure 5.6 Robot change the way to movement properly. 15
Figure 5.7 Robot going forward again after changing the way of 15
movement

VIII
Chapter 1

Introduction
1.1 Introduction

The Smart Solar Grass Cutter with Lawn Coverage is an innovative and eco-friendly
solution designed to automate grass-cutting tasks while minimizing environmental
impact. This system harnesses solar energy to power its components, eliminating the
need for conventional fuel and reducing greenhouse gas emissions. Equipped with
advanced sensors and control mechanisms, the grass cutter ensures efficient and uniform
lawn coverage, adapting to various terrains and grass types. Its smart technology enables
precise navigation and obstacle avoidance, making it suitable for both residential and
commercial applications. By integrating renewable energy sources and automation, this
device not only offers a sustainable alternative to traditional lawn mowers but also
reduces labor and operational costs, contributing to a greener future.

1.2 Objectives

The objective of the Smart Solar Grass Cutter with Lawn Coverage is to develop an
automated, eco-friendly grass-cutting solution that utilizes solar energy for efficient and
sustainable lawn maintenance. This project aims to ensure uniform and precise grass
trimming across various terrains while minimizing manual labor and energy
consumption. By integrating smart technologies like obstacle detection and autonomous
navigation, the system seeks to enhance user convenience and operational safety.
Additionally, it strives to reduce environmental impact by eliminating the use of
conventional fuels, making it a cost-effective and sustainable alternative to traditional
lawn maintenance methods.

1. Utilize Renewable Energy: Harness solar power to operate the grass cutter,
ensuring eco-friendly and sustainable functionality.

1
2. Achieve Uniform Lawn Coverage: Design a system that ensures even grass
cutting across various terrains and lawn sizes.
3. Minimize Manual Effort: Automate the grass-cutting process to reduce human
intervention and labor requirements.
4. Integrate Smart Navigation: Incorporate sensors and control systems for
obstacle detection and autonomous navigation.
5. Enhance Safety: Ensure safe operation by avoiding collisions with obstacles or
people during grass-cutting tasks.
6. Promote Environmental Sustainability: Reduce carbon footprint by eliminating
the need for fossil fuels or electricity from non-renewable sources.
7. Develop a Cost-Effective Solution: Create a low-maintenance, affordable
alternative to traditional lawn maintenance equipment.
8. Support Versatility: Enable adaptability to different grass types, terrains, and
environmental conditions.
9. Improve User Convenience: Design a user-friendly interface and system for
seamless operation and control.
10. Contribute to Smart Landscaping: Align with modern landscaping needs by
combining efficiency, technology, and environmental consciousness.

2
Chapter 2

Literature Review & Methodology

2.1 Literature Review

The concept of a Smart Solar Grass Cutter with Lawn Coverage integrates advancements
in renewable energy, automation, and smart technology to revolutionize traditional lawn
maintenance methods. Previous studies and projects in this field have laid a strong
foundation, focusing on improving efficiency, sustainability, and user convenience. The
existing literature demonstrates a clear trajectory toward developing eco-friendly,
automated lawn maintenance solutions. The integration of solar energy, smart
technologies, and efficient cutting mechanisms in grass cutters is not only technologically
viable but also aligned with global sustainability goals. The Smart Solar Grass Cutter
with Lawn Coverage builds on these advancements, offering a comprehensive solution
that addresses environmental concerns, operational efficiency, and user convenience.
Further research and innovation in this domain are essential to refine the technology and
expand its applicability.

2.2 Methodology

The development of the Smart Solar Grass Cutter with Lawn Coverage involves a
systematic approach that integrates renewable energy, automation, and smart navigation
technologies. The methodology is divided into the following steps:

2.2.1 System Design and Component Selection

 Solar Power Integration: Design a solar panel system to harness sunlight and
charge the battery efficiently. Ensure the power requirements of the grass cutter
are met under varying sunlight conditions.

3
 Chassis and Frame: Construct a lightweight yet durable frame to house all
components, ensuring stability and easy maneuverability.
 Cutting Mechanism: Incorporate a high-speed blade system optimized for
uniform grass cutting.

2.2.2 Hardware Implementation

 Motors and Wheels: Use DC motors for driving wheels and moving the grass
cutter autonomously. Select wheels suitable for uneven terrains.
 Microcontroller: Employ a microcontroller (e.g., Arduino, NodeMCU) to control
the system, manage inputs from sensors, and execute programmed instructions.
 Sensors: Install ultrasonic sensors for obstacle detection and IR sensors for
boundary detection to ensure safety and proper lawn coverage.

2.2.3 Energy Management

 Battery Storage: Connect the solar panel to a rechargeable battery to store


energy for operation during low sunlight or shaded areas.
 Power Distribution: Implement an efficient power management circuit to
distribute energy between motors, sensors, and the cutting mechanism.

2.2.4 Software Development

 Programming: Develop software to control the movement, navigation, and


obstacle avoidance of the grass cutter. Use algorithms to optimize lawn coverage.
 Automation Features: Implement a control logic for automatic start/stop, blade
activation, and terrain adaptation.

2.2.5 Prototyping and Assembly

 Assemble all hardware components and integrate the solar panel, battery,
microcontroller, and sensors into the chassis.
 Test individual components for functionality and overall system compatibility

4
2.2.6 Testing and Optimization

Lawn Coverage Testing: Evaluate the performance of the grass cutter across different
lawn sizes and terrains.

Obstacle Avoidance: Test sensor accuracy in detecting obstacles and the system's ability
to navigate around them.

Energy Efficiency: Monitor power consumption and battery performance under various
operational conditions.

2.2.7 Final Implementation and Deployment

 Make necessary adjustments based on testing results.


 Deploy the grass cutter in real-world scenarios to assess its reliability and
usability.

This methodology ensures a structured approach to developing an efficient and eco-


friendly Smart Solar Grass Cutter with Lawn Coverage, leveraging modern technologies
to achieve sustainable and automated lawn maintenance.

5
Chapter 3

Hardware and Software Description

3.1 Arduino Nano

The Arduino Nano is a small, versatile, and powerful microcontroller board designed for
compact projects and applications. It is a part of the Arduino family, which is popular for
its open-source electronics platform. The Nano is based on the ATmega328P or
ATmega168 microcontroller and is ideal for small-scale and space-constrained projects.

Figure 3.1: Arduino Nano

3.2 Motor Driver

A motor driver is an electronic device or circuit used to control the operation of electric
motors in various applications.

Figure 3.2: Motor Driver

6
It acts as an interface between a microcontroller (like an Arduino) and a motor. Since
motors typically require higher current and voltage than a microcontroller can provide, a
motor driver manages this power and enables the microcontroller to control the motor
effectively.

3.3 Buck Converter

A buck converter is a type of DC-DC power converter that steps down (reduces) a higher
input voltage to a lower output voltage while maintaining high efficiency. It is also
known as a step-down converter.

Figure 3.3: Buck Converter

3.4 Solar Panel

A solar panel is a device that converts sunlight into electrical energy using the
photovoltaic (PV) effect. It consists of multiple solar cells made from semiconducting
materials, typically silicon , that generate electricity when exposed to sunlight.

Figure 3.4: Solar Panel.

7
3.5 Ultrasonic Sensor

An Ultrasonic Sensor is an electronic device that uses sound waves to measure distances
or detect objects. It operates by emitting ultrasonic waves (high-frequency sound waves,
typically above 20 kHz) and analyzing the echoes that bounce back after hitting an
object.

Figure 3.5: Ultrasonic Sensor


3.6 Battery

A battery is a device that stores chemical energy and converts it into electrical energy to
power various devices and systems. It consists of one or more electrochemical cells, each
containing two electrodes (an anode and a cathode) and an electrolyte that facilitates the
movement of ions. Batteries are a crucial energy source for countless applications,
ranging from small electronic devices to large-scale power systems.

Figure 3.6: Batter


3.7 Bo Motor
A BO motor (Battery Operated motor) is a small, lightweight, and low-cost DC gear
motor commonly used in robotics and small electronic projects. These motors are
typically designed to operate at low voltages (usually between 3V to 12V) and are geared

8
to provide higher torque at lower speeds, making them suitable for applications like small
robots, toys, and automation systems.

Figure 3.7: Bo Motor

3.8 Switch

A switch is an electrical device that is used to open or close a circuit, thereby controlling
the flow of current. By interrupting or allowing current flow, switches enable users to
turn devices on or off, change the operating mode, or redirect electrical signals. They are
one of the most fundamental components in electronic and electrical systems.

Figure 3.8: Switch

9
Chapter 4

System Design

4.1 Block Diagram

In this part we will discuss about Block Diagram of proposed system. We used here a
solar panel to Generate power and this generated power will be stored in our Battery. We
used here Four numbers of 3.7V Battery, so it will be 16V Battery. Our Microcontroller
and sensors is operated here in 5V that will get from L298N Motor Driver 5V output. But
Motor driver Need 12V DC supply. So we used here buck converter to get required
voltage. We used here an Arduino Nano and one L298N Motor Driver to control the
movement of our robot. Arduino Nano will detect object in front of our robot and
Arduino will send command to change the way of movement. Our Grass cutting system
will be operated by using a Manual Switch and a DC Motor. This DC motor will be
operated using 9V DC Output that will get from a Buck converter.

Figure 4.1: Block diagram of the proposed system.

10
4.2 Circuit Diagram

In this part we will discuss about Circuit Diagram of proposed system. We used here a
solar panel to Generate power and this generated power will be stored in our Battery. We
used here four numbers of 3.7V Battery, so it will be 16V Battery. Our Microcontroller
and sensors is operated here in 5V that will get from L298N Motor Driver 5V output. But
Motor driver Need 12V DC supply. So we used here buck converter to get required
voltage. We used here an Arduino Nano and one L298N Motor Driver to control the
movement of our robot. Arduino Nano will detect object in front of our robot and arduino
will send command to change the way of movement. Our Grass cutting system will be
operated by using a Manual Switch and a DC Motor. This DC motor will be operated
using 9V DC Output that will get from a Buck converter.

Figure 4.2: Complete circuit diagram of the project

11
4.3 Working Procedure

We used here a solar panel to Generate power and this generated power will be stored in
our Battery. We used here four numbers of 3.7V Battery, so it will be 16V Battery. Our
Microcontroller and sensors is operated here in 5V that will get from L298N Motor
Driver 5V output. But Motor driver Need 12V DC supply. So we used here buck
converter to get required voltage. We used here an Arduino Nano and one L298N Motor
Driver to control the movement of our robot. Arduino Nano will detect object in front of
our robot and Arduino will send command to change the way of movement. Our Grass
cutting system will be operated by using a Manual Switch and a DC Motor. This DC
motor will be operated using 9V DC Output that will get from a Buck converter.

4.4 Hardware Implementation

Figure 4.4: Experimental setup of our system.

12
Chapter 5

Results & Discussions

5.1 Experimental Results

In this part we will try to show operational output of proposed system in bellow:

Figure 5.1: Cutting Blade off now.

Figure 5.2: Cutting Blade is rotating to cutting grasses.

13
Figure 5.3: Set Obstacle in front of our robot.

Figure 5.4: Robot Changing the way of Movement.

Figure 5.5: Robot Changing the way more and more.

14
Figure 5.6: Robot change the way to movement properly.

Figure 5.7: Robot going forward again after changing the way of movement.

15
Chapter 6

Conclusion

6.1 Conclusion

This paper The Smart Solar Grass Cutter with Lawn Coverage presents an innovative
solution for efficient, eco-friendly, and autonomous lawn maintenance. By integrating
solar energy, the system not only reduces dependence on conventional power sources but
also contributes to environmental sustainability. The use of smart technologies, such as
obstacle detection, autonomous navigation, and uniform grass cutting, enhances the user
experience while minimizing manual labor. This system provides a cost-effective and
low-maintenance alternative to traditional grass cutters, with the added benefit of being
environmentally conscious. The autonomous nature of the device, combined with
renewable energy, makes it a perfect fit for modern landscaping, whether for residential,
commercial, or public spaces. Overall, the Smart Solar Grass Cutter with Lawn Coverage
sets a precedent for future innovations in lawn care and automation, aligning with
growing trends in sustainability, energy efficiency, and technological integration. It offers
a promising solution to achieve both efficient lawn maintenance and a greener
environment.

6.2 Future Scope

Future Scope of Smart Solar Grass Cutter with Lawn Coverage

The Smart Solar Grass Cutter with Lawn Coverage has significant potential for further
advancements and expansion in the future. As technology and sustainability practices
evolve, the scope for enhancing and adapting this system continues to grow. Some of the
key areas for future development include:

16
6.2.1 Advanced Solar Power Efficiency

 Improved Solar Panels: Future developments in solar technology may lead to


more efficient solar panels, enabling the grass cutter to operate for longer
durations even in low sunlight conditions.
 Energy Storage: The integration of more advanced battery technologies, such as
lithium-ion or solid-state batteries, could improve energy storage capabilities,
allowing the device to operate continuously without interruptions.

6.2.2 Enhanced Autonomous Navigation

 AI and Machine Learning: Future versions of the grass cutter could incorporate
artificial intelligence (AI) to better understand the terrain, optimize grass-cutting
patterns, and learn from environmental feedback. AI algorithms could help the
system predict and adapt to changing conditions like uneven terrain, wet grass, or
obstacles.
 Improved Sensor Systems: Advanced sensor technologies, such as LIDAR
(Light Detection and Ranging) and more precise ultrasonic sensors, could
enhance the obstacle detection and navigation capabilities, allowing the device to
work in more complex environments.

6.2.3 Smart Integration with IoT

 Remote Control and Monitoring: Integration with IoT platforms would allow
users to control and monitor the grass cutter remotely via smartphones or
computers. This could include tracking battery levels, scheduling cutting times,
and receiving maintenance alerts.
 Automation Scheduling: The grass cutter could be connected to smart home
systems, enabling automatic operation based on weather conditions, time of day,
or lawn growth cycles.

17
6.2.4 Multi-Terrain Adaptability

 Terrain Sensing: Future models could incorporate advanced terrain sensors that
allow the grass cutter to automatically adjust its speed and cutting height
according to different types of grass or terrain, ensuring more consistent cutting
results.
 All-Weather Capabilities: The system could be enhanced to perform in various
weather conditions, such as rain or snow, by incorporating weather-resistant
components and improving the blade system.

6.2.5 Sustainability Enhancements

 Zero Emissions: The future development of solar-powered grass cutters can


focus on achieving a completely zero-emission operation, reducing their carbon
footprint further and enhancing their environmental benefits.
 Recycling and Biodegradable Materials: The grass cutter could be made using
more sustainable, recyclable materials, promoting eco-friendly manufacturing
processes.

6.2.6 Commercial and Industrial Applications

 Larger Coverage Areas: Future models could be designed for larger lawns,
parks, golf courses, or other commercial spaces. With enhanced power and speed,
they could handle bigger areas more efficiently.
 Fleet Management: For commercial users, the system could support the
management of multiple grass cutters, all operating autonomously in different
areas, with data and performance monitored in real-time via a centralized system.

6.2.7 Cost Reduction and Accessibilit

 Affordable Production: As the technology matures and production processes


improve, the cost of manufacturing these smart solar grass cutters may decrease,
making them more accessible for residential users, particularly in lower-income
regions.

18
 Scalable Solutions: Different models could be developed to cater to different
lawn sizes and budgets, providing scalable solutions for various customers.

The future of the Smart Solar Grass Cutter with Lawn Coverage holds great promise,
with advancements in energy efficiency, automation, smart technology, and
sustainability. These developments will make the system more versatile, accessible,
and environmentally friendly, positioning it as a leading solution in lawn care for
years to come. As technology progresses, this device could become an indispensable
tool for efficient and eco-conscious lawn maintenance in both residential and
commercial settings.

19
REFERENCES
1. G.Rahul, “Grass cutting machine by solar energy power”, ISSN no:2348-
4845,international journal and magazine of engineering, technology management
and research.
2. Bhosale Swapnil, Khadke Sagar, “Solar powered automatic grass cutter”, ISSN:2395-
0056,volume no:04 issue:05,may 2017,International research journal of engineering and
technology.
3. Ms.Yogita D. Ambekar, Mr. Abhishek U. Ghate, “Solar based grass cutter”, ISBN:978-
93-86171-31-3, 26 Feb 2017, International conference on recent trends in engineering,
science, Humanities and management.
4. P.Amrutesh,B.Sagar,B.Venu, “Solar grass cutter with linear blades by using scotch yoke
mechanism ”, ISSN:2248-9622,volume no:4 issue: 9, September 2014, International
research journal of engineering and application.
5. Pamujula hythika madhav, Bhaskar H.B, “MANUALLY OPERATED ROTARY LAWN
MOWER,” Novateur Publications International Journal Of Innovations In Engineering
Research And Technology [IJIERT] Volume 2, Issue 2 pp. 1-4, February 2015.
6. Basil Okafor, “Simple Design of Self-Powered Lawn Mower,” International Journal of
Engineering and Technology Volume 3 No. 10, pp. 933-938, October 2013.
7. Bharaneedharan Muralidharan and Ranjeet Pokharel. 2014. Manually operated lawn
mower applicable for grass cutting. Volume 3. Issue: 4. April 2014. ISSN no 2277-8179
8. "History of the Lawn Mower,"
http://www.americanlawns.com/history/history_mower.html
9. G. Newstadt , K. Green, D. Anderson, M. Lang, Y.Morton, and J. McCollum,Miami
Redblade III: A GPSaided Autonomous Lawnmower.
10. Sachin Prabha, Dattatray G.Biradar, Sachin Panshette, Veerbhadrappa.T,“SOLAR
GRASS CUTTER MACHINE,” International Journal For Technological Research In
Engineering Volume 3, Issue 10, pp. 2702- 2706, June-2016
11. Dutta P.P , Baruah A 2, Konwar A,Kumar.V, “A Technical Review of Lawn Mower
Technology,” ADBU-Journal of Engineering Technology AJET, Volume 4(1), pp. 179-
182, 2016.

20
APPENDIX

Programming Code:

#include <Arduino.h>

// Pin definitions for ultrasonic sensor

#define TRIG_PIN 2

#define ECHO_PIN 3

// Motor control pins (connected to L298N)

#define IN1 7

#define IN2 6

#define IN3 5

#define IN4 4

#define SPEED_PIN_LEFT 9

#define SPEED_PIN_RIGHT 10

// Threshold distance to detect obstacles (in cm)

const int obstacleDistance = 20;

int obstacleCount = 0;

// Function to measure distance using ultrasonic sensor

int getDistance() {

21
digitalWrite(TRIG_PIN, LOW);

delayMicroseconds(2);

digitalWrite(TRIG_PIN, HIGH);

delayMicroseconds(10);

digitalWrite(TRIG_PIN, LOW);

int duration = pulseIn(ECHO_PIN, HIGH);

int distance = duration * 0.034 / 2;

return distance;

// Function to move robot forward

void moveForward() {

analogWrite(SPEED_PIN_LEFT, 100);

analogWrite(SPEED_PIN_RIGHT, 100);

digitalWrite(IN1, HIGH);

digitalWrite(IN2, LOW);

digitalWrite(IN3, HIGH);

digitalWrite(IN4, LOW);

// Function to stop the robot

void stopRobot() {

digitalWrite(IN1, LOW);

digitalWrite(IN2, LOW);

digitalWrite(IN3, LOW);

22
digitalWrite(IN4, LOW);

delay(1000); // Adjust delay for 90-degree turn

// Function to rotate left

void rotateLeft() {

analogWrite(SPEED_PIN_LEFT, 170);

analogWrite(SPEED_PIN_RIGHT, 170);

digitalWrite(IN1, LOW);

digitalWrite(IN2, HIGH);

digitalWrite(IN3, HIGH);

digitalWrite(IN4, LOW);

delay(2100); // Adjust delay for 90-degree turn

stopRobot();

// Function to rotate right

void rotateRight() {

analogWrite(SPEED_PIN_LEFT, 170);

analogWrite(SPEED_PIN_RIGHT, 170);

digitalWrite(IN1, HIGH);

digitalWrite(IN2, LOW);

digitalWrite(IN3, LOW);

digitalWrite(IN4, HIGH);

23
delay(2000); // Adjust delay for 90-degree turn

stopRobot();

// Main logic loop

void loop() {

int distance = getDistance();

if (distance < obstacleDistance) {

obstacleCount++;

if (obstacleCount == 1) {

rotateLeft();

delay(500); // Short forward move

moveForward();

} else if (obstacleCount == 2) {

rotateRight();

delay(500); // Short forward move

moveForward();

obstacleCount = 0; // Reset count to repeat pattern

} else {

moveForward();

24
delay(100); // Small delay to avoid rapid changes

void setup() {

// Set motor pins as outputs

pinMode(IN1, OUTPUT);

pinMode(IN2, OUTPUT);

pinMode(IN3, OUTPUT);

pinMode(IN4, OUTPUT);

pinMode(SPEED_PIN_LEFT, OUTPUT);

pinMode(SPEED_PIN_RIGHT, OUTPUT);

// Set ultrasonic sensor pins

pinMode(TRIG_PIN, OUTPUT);

pinMode(ECHO_PIN, INPUT);

// Initial state

stopRobot();

25

You might also like