Question

Final Project Apr 30, 2019 12:15 PM Greetings Please do a final project which can be based on any microcontroller that can be
0 0
Add a comment Improve this question Transcribed image text
Answer #1

You can build an automatic Solar grass cutter with obstacle avoidance syste.

Details of this project is given below.

You are going to Arduino, ultrasonic sensor, motor driver moduleS, Solar panel, geared DC motor, Four wheel robotic model to build this projects.

Layout of the project is shown below.

Grass cutter Solar Panel 1.5 Watt, 12 V motor Arduino nano Wheel motor1 Power backup Ultrasonic sensor Wheel motor 2 L298N mo

Here is the coding for this project

const int trigPin = 10;
const int echoPin = 11;
// defines variables
long duration;
int distance;
int MOTOR1A= 6;
int MOTOR1B =7;
int MOTOR2A =8;
int MOTOR2B =9;

void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
pinMode(MOTOR1A, OUTPUT);
pinMode(MOTOR1B, OUTPUT);
pinMode(MOTOR2A, OUTPUT);
pinMode(MOTOR2B, OUTPUT);
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

if (distance<50){
digitalWrite(MOTOR2A, HIGH);
digitalWrite(MOTOR2B, LOW);
digitalWrite(MOTOR1A, LOW);
digitalWrite(MOTOR1B, HIGH);

}
else if (distance>50){
digitalWrite(MOTOR1A, HIGH);
digitalWrite(MOTOR1B, LOW);
digitalWrite(MOTOR2A, HIGH);
digitalWrite(MOTOR2B, LOW);
}
}

Your final project will look like below

kindly thumbsup if answer helped you.

Add a comment
Know the answer?
Add Answer to:
Final Project Apr 30, 2019 12:15 PM Greetings Please do a final project which can be...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT