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

FAM
Intermediate
  • 272
  • 3

Work in progress

Super Secret Messaging with pocketCHIP!

El Wire T-shirt: Connected to a LightBlue Bean
Intermediate
  • 101
  • 6

Work in progress

A custom Internet connected shirt using a LightBlue Bean to light up the shirt's El Wire graphics.

Pulsecounting and Deepsleep Based IoT Water Meter
Intermediate
  • 86
  • 2

This project creates a way to monitor water usage, to reduce water costs.

Agent
Intermediate
  • 136
  • 1

Work in progress

A device to provide data for Machine Learning.

C.H.I.P.py Ruxpin ʕ•ᴥ•ʔ
Intermediate
  • 46,430
  • 72

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
  • 6,028
  • 44

Work in progress

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

Otto DIY +

Team Otto builders

Add projectSign up / Login