Hey, everyone today we are making obstacle avoiding car usingArduino.
Connections
1) Out pin of IR sensor to 4th pin ofArduino
2) VCC pin of IR sensor to 5V of Arduino
3) GND pin of IR sensor to GND of Arduino
4) Take a dc motor
5) Pin 1 of dc motor to pin 13 of Arduino
6) Pin 2 of dc motor to pin GND of Arduino
7) Take another dc motor
8) Pin 2 of dc motor to pin 13 of Arduino
9) Pin 1 ofdc motor to pin GND of Arduino
Precautions:
1)make sure motor 1 always rotates clockwiseand motor to rotates anti clockwise if it doesn't happen exchange theconnections.
2)front motor should be left side
3)backmotor should be right side
are you liking the project?
do you want code for your project
contact me here
https://www.freelancer.in/hireme/pranavmadhavaram
Code:
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);//dc motor
pinMode(11, OUTPUT);
pinMode(4, INPUT);
}
void loop()
{ if (digitalRead(4)==HIGH)
{digitalWrite(13, HIGH);
digitalWrite(11, HIGH);}
else
{digitalWrite(13, HIGH);}}
are you liking the project?
do you want code for your project
contact me here
https://www.freelancer.in/hireme/pranavmadhavaram
physics behind it:
you might be wondering how thecar rotates. I will explain it how with example
example:
when you are removing a bottlecap you will use two fingers thumb and index.
with the index finger you moveit front and with thumb you move it backside.
the index will be placed leftand thumb will be placed right the bottle rotates.
here when the obstacle avoiderdetects any obstacle both motor rotates as they are placed left and right.
did you like the project?
do you want code for your project
contact me here



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



Comments