Hey everyone. In one of our previous projects I made a obstacle avoiding car. But a problem with it is that car doesn’t detect pits. So if the car falls into on it would be rotating 360 degrees as car would seem there is obstacle in front of it and has no way to get out. So in this project we will make a car that avoids pits. Before I start the project don’t forget to press the follow and respect button also comment your opinions and consider hiring me in this link for your future projects.
https://www.freelancer.in/hireme/pranavmadhavaram0
connections:
1) take an IR sensor
2) digital pin of IR sensor to 4th pin of Arduino
3) VCC of IR sensor to 5V of Arduino
4) GND of IR sensor to GND of Arduino
5) a pin of DC motor to digital pin 13 of Arduino
6) anotherpin of DC motor to GND of Arduino
7) take another DC motor
8) a pin of DC motor to digital pin 11 of Arduino
9) another pin of DC motor to GND of Arduino
*-
code:
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);//dc motor
pinMode(11, OUTPUT);
pinMode(2, INPUT);
pinMode(4, INPUT);
}
void loop()
{ if(digitalRead(2)==HIGH||digitalRead(3)==LOW)
{digitalWrite(13, HIGH);
digitalWrite(11, HIGH);}
else
{digitalWrite(13, HIGH);}}
ADVERTIZEMENT:
**********************Don’t skip**************************
Are you interested in making your own arduino project and rely on mysources.
If you rely on my sources then you might have your own ideas thatneither I have not uploaded or nor others. So you might leave the hopes oncompleting that project. But there is no need for youas I will help youout personally. Yes you heard it right. I will complete your project. All youneed is just to press this link.
https://www.freelancer.in/hireme/pranavmadhavaram
*****************advertisementcompleted******************
Precautions:
1)make sure motor 1 always rotates clockwise and motor to rotates anti clockwiseif it doesn't happen exchange the connections.
2)front motor should be left side
3)back motor should be right side
4)Keep the ir sensor at front
physics behind it:
you might be wondering how the car rotates. I will explain it how with example
example:
when you are removing a bottle cap you will use two fingers thumb and index.
with the index finger you move it front and with thumb you move it backside.
the index will be placed left and thumb will be placed right the bottle rotates.
Herewhen it detects obstacle or a pit both motors rotate



_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)



Comments