This item has closed 2 buyers bought 2 items
View other items offered by BotShop3166

Similar products

IC SMD SOIC14 HEX INV 74HC04D
New
R14.49
IC DIP14 HEX INVERTER 74HC04L
New
R6.61
ULTRASONIC RANGING AMPLIFIER PCB ONLY JSN-SR04M-2
New
R189.87
ULTRASONIC TRANSMITTER ONLY GS-400
New
R971.39
HC-SR04 Ultrasonic Sensor
Sold

HC-SR04 Ultrasonic Sensor

New 709 were available
R62.00
Shipping
R65.00 Standard shipping applies to orders under R100.00, in most areas in South Africa. R35.00 Standard shipping applies to orders over R100.00. Some areas may attract a surcharge surcharge. This will be calculated at checkout if applicable.
Check my rate
The seller has indicated that they will usually have this item ready to ship within 3 business days. Shipping time depends on your delivery address. The most accurate delivery time will be calculated at checkout, but in general, the following shipping times apply:
 
Standard Delivery
Main centres:  1-3 business days
Regional areas: 3-4 business days
Remote areas: 3-5 business days
Buyer protection
Get it now, pay later

Product details

Condition
New
Location
South Africa
Product code
SEN-032
Bob Shop ID
593184147

The HC-SR04 ultrasonic sensor uses sonar to determine the distance to an object like bats or dolphins do. It offers excellent range accuracy and stable readings in an easy-to-use package. Its operation is not affected by sunlight or black material like Sharp rangefinders are. Similar in performance to the SRF005 but with the low-price of a Sharp infrared sensor.

  • Power Supply:5V DC
  • Quiescent Current: <2mA
  • Effectual Angle: <15
  • Ranging Distance: 2cm — 500 cm (5 meters)
  • Resolution: 0.3 cm

Basic use of the HC-SR04 Ultrasonic Sensor

Please see the datasheet for an excellent description of how the sensor operates.

HC-SR04 Datasheet

Using the HC-SR04 with an Arduino

Great Video here: http://vimeo.com/44836674

There is an Arduino library for the HC-SR04 that offers two ways to use the sensor. To install, download the "Ultrasonic Library" from this page, unzip the release package into your "arduino-0018/libraries/" folder. Open the Arduino IDE and include the library by Sketch-Import library-Ultrasonic. There is also an example sketch in File-Examples-Ultrasonic-UltrasonicDemo.

Ultrasonic Library

The library includes 3 functions:

1. Ultrasonic(int TP, int EP)

This is an initial function for the ultrasonic ranging module, choose the pins for module TRIG and ECHO pin. For example:

Ultrasonic(13,12);

defines the digital pin 13 of Arduino as the TRIG pin of HC-SR04 and pin 12 for the ECHO pin.

2. long Timing()

This function triggers the ultrasonic module and returns the duration that the ECHO pin was held high. For example:

 long time; Ultrasonic hcsr; time = hcsr.Timing();

The distance of the object correlates to the time the ECHO pin is held high. The distance formula is:

Distance = ((Duration of high level)*(Sonic :340m/s))/2

3. long Ranging(int sys) — (sys: CM / INC)

If you don't want to change the time into distance yourself, this function will help you get the distance immediately. This function has a parameter (using CM or ICN) that shows the distance in centimetres or inches. This function will call Timing() and you don't need to use the Timing() before it. For example:

long distance; Ultrasonic hcsr; distance = hcsr.Ranging(CM); 

returns the distance in centimetres.

Library: HC-SR04_Library.zip

HC-SR04 Ultrasonic Sensor

Code
#include <NewPing.h>
#define TRIGGER_PIN 12
#define ECHO_PIN 11
#define MAX_DISTANCE 200
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

void setup() {
Serial.begin(115200);
}

void loop() {
delay(500);
unsigned int uS = sonar.ping();
Serial.print("Ping: ");
Serial.print(uS / US_ROUNDTRIP_CM);
Serial.println("cm");
}

Recently viewed

See more
Starcote Toggle Switch
New
R69.00
Excess Stock - RSA 3.21 FDC`s - Set of 10 FDC's (Bid per FDC to take all 10)
Secondhand
R0.30 No bids
Lego (U) ~ Technic Axle and Pin Connector Angled #2 - 180 degrees ~ [Red]
Secondhand
R1.20
Solar Powered Sensor Light 192 COB
New
R479.00