Things used in this project

Hardware components:
11114 01a
SparkFun Arduino Pro Mini 328 - 3.3V/8MHz
×1
51gzz5eu9pl. sx425
HC-SR04
×3
Adafruit industries ada1536 image
Buzzer
×1
Mobile phone vibrator
×2
Gus 1719
C.H.I.P. Approved 3.7 V LiPo Battery
×1

Code

FIZZQV0IZ6D1PFF.inoArduino
#define trigPin1 A0
#define echoPin1 A1

#define trigPin2 A2
#define echoPin2 A3

#define trigPin3 A4
#define echoPin3 A5


#define motor1 5
#define motor2 6
#define buzzer 3

void setup()
{
pinMode(trigPin1, OUTPUT);

pinMode(echoPin1, INPUT);

pinMode(trigPin2, OUTPUT);

pinMode(echoPin2, INPUT);

pinMode(trigPin3, OUTPUT);

pinMode(echoPin3, INPUT);


pinMode(motor1, OUTPUT);

pinMode(motor2, OUTPUT);

pinMode(buzzer,OUTPUT);

}

void loop()

{

long duration, distance;

digitalWrite(trigPin1, LOW); 

delayMicroseconds(2); 

digitalWrite(trigPin1, HIGH);

delayMicroseconds(1); 

digitalWrite(trigPin1, LOW);

duration = pulseIn(echoPin1, HIGH);

distance = (duration/2) / 29.1;

if (distance < 45)

{ 

 

digitalWrite(buzzer,HIGH);

} else

{



digitalWrite(buzzer,LOW); 

} delay(50);



digitalWrite(trigPin2, LOW); 

delayMicroseconds(2); 

digitalWrite(trigPin2, HIGH);

delayMicroseconds(1); 

digitalWrite(trigPin2, LOW);

duration = pulseIn(echoPin2, HIGH);

distance = (duration/2) / 29.1;

if (distance < 40)

{ 

digitalWrite(motor1,HIGH);



} else

{

digitalWrite(motor1,LOW);

 

} delay(100);




digitalWrite(trigPin3, LOW); 

delayMicroseconds(2); 

digitalWrite(trigPin3, HIGH);

delayMicroseconds(2); 

digitalWrite(trigPin3, LOW);

duration = pulseIn(echoPin3, HIGH);

distance = (duration/2) / 29.1;

if (distance < 30)

{ 

digitalWrite(motor2,HIGH); 

} else

{

digitalWrite(motor2,LOW);

 

} delay(100);

}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Third Eye for The Blind
Intermediate
  • 556
  • 8

Full instructions

An innovative wearable technology for visually impaired peoples.

Roomba Dashboard - A CLI Dashboard for iRobot Create 2
Intermediate
  • 166
  • 1

Roomba-Dash is a CLI dashboard for the iRobot Create 2 platform written in Golang. It is cross-platform compatible.

FAM
Intermediate
  • 1,341
  • 7

Work in progress

Super Secret Messaging with PocketCHIP!

Push for Pizza Using Proximus Public LoRaWAN Connectivity
Intermediate
  • 145
  • 0

A simple push button using Proximus public LPWAN connectivity. Optimized for power consumption (<30 microAmps) and long distance (>15km!).

C.H.I.P.py Ruxpin ʕ•ᴥ•ʔ
Intermediate
  • 47,273
  • 73

Full instructions

Bring Teddy Ruxpin back to life, but on your own terms! Make him say whatever you want, or have him search twitter to read tweets!

Otto DIY +
Intermediate
  • 7,754
  • 50

Work in progress

"Otto DIY with steroids" + Bluetooth + APP + switch + sensors + strength +...

Otto DIY +

Team Otto builders

Add projectSign up / Login