0% found this document useful (0 votes)
92 views3 pages

Triggering A Relay With An SR04 Ultrasonic Sensor PDF

This document describes how to trigger a relay using an SR04 ultrasonic sensor and an Arduino. It lists the required materials which include a breadboard, Arduino, relay module, ultrasonic sensor, and jumper wires. It provides the connections for the components, with the relay output connecting to pin 11 and the sensor connecting to pins 3, 4, 6 and 7. The document also includes related instructables on controlling motors and fans with ultrasonic sensors and automatic temperature/humidity controllers using Arduino.

Uploaded by

Loka Bagus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views3 pages

Triggering A Relay With An SR04 Ultrasonic Sensor PDF

This document describes how to trigger a relay using an SR04 ultrasonic sensor and an Arduino. It lists the required materials which include a breadboard, Arduino, relay module, ultrasonic sensor, and jumper wires. It provides the connections for the components, with the relay output connecting to pin 11 and the sensor connecting to pins 3, 4, 6 and 7. The document also includes related instructables on controlling motors and fans with ultrasonic sensors and automatic temperature/humidity controllers using Arduino.

Uploaded by

Loka Bagus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

technology workshop craft home food play outside costumes

Triggering a relay with an SR04 ultrasonic sensor


by rianc on September 19, 2015

Table of Contents

Triggering a relay with an SR04 ultrasonic sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Triggering a relay with an SR04 ultrasonic sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: The Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

http://www.instructables.com/id/Triggering-a-relay-with-an-SR04-ultrasonic-sensor/
Intro: Triggering a relay with an SR04 ultrasonic sensor
This isn't the best way to trigger a relay with this sensor but it is a quick and dirty way to do so. I am NOT a professional coder nor do I claim to be. I am still trying to
learn C ++ so i would ask that you keep that in mind if you make a comment. I appreciate feedback, however i ask that you keep it constructive. Thank you.

Step 1: Materials
All you really need is:

1. A breadboard (http://www.amazon.com/Solderless-BreadBoard-tie-points-power-rails/dp/B005GYAIES/ref=sr_1_1?ie=UTF8&qid=1442695282&sr=8-
1&keywords=breadboard)

2. an Arduino of any kind(I used an Uno)(http://www.amazon.com/Arduino-UNO-board-DIP-


ATmega328P/dp/B006H06TVG/ref=sr_1_1?s=electronics&ie=UTF8&qid=1442695333&sr=1-1&keywords=arduino+uno)

3. Relay module(http://www.amazon.com/Indicator-Light-Channel-Module-Arduino/dp/B00P7QDJD2/ref=sr_1_5?s=electronics&ie=UTF8&qid=1442695315&sr=1-
5&keywords=relay+module)

4. An SR04 Ultrasonic sensor(http://www.amazon.com/niceEshop-Ultrasonic-Distance-Measuring-


Sensor/dp/B00F167T2A/ref=sr_1_4?s=electronics&ie=UTF8&qid=1442695299&sr=1-4&keywords=sr04+distance)

5. Jumper wires(http://www.amazon.com/Wosang-Solderless-Flexible-Breadboard-Jumper/dp/B005TZJ0AM/ref=sr_1_2?s=electronics&ie=UTF8&qid=1442695342&sr=1-
2&keywords=jumper+wires)

Step 2: The Connections


Connections are as follows:

Pin 11: Relay Output

Pin 7: link to pin 6

Pin 6: link to pin 7

Pin 4: Echo

Pin 3: Trigger

That is all other than 5v and Gnd but those are self-explanatory. Feel free to modify and republish the code, all i ask is that you link this instructable in if you re-publish it.

http://www.instructables.com/id/Triggering-a-relay-with-an-SR04-ultrasonic-sensor/
Related Instructables

Arduino Arduino Artoo [R2]


Control a Motor Controlled Arduino and Automatic Linkit one (ATtiny2313
using Ultrasonic Personal Fan ultrasonic Temperature& sensor tutorial Wall Avoiding
Distance with Ping sensor control Humidity by Dushyanta
Sensors (HC- servo and Robot) by
Sensor / Controller for vishalapr
SR04) by Simple- distance meter
ATtiny2313 by Pets by jack1986
Circuits by Electronice
WWC

Advertisements

Comments
2 comments Add Comment

DIY Hacks and How Tos says: Sep 19, 2015. 7:19 PM REPLY
Cool project.

rianc says: Sep 20, 2015. 11:13 AM REPLY


thank you

http://www.instructables.com/id/Triggering-a-relay-with-an-SR04-ultrasonic-sensor/

You might also like