Skip to content

Weather_ _proof_Ultrasonic_Sensor_with_Separate_Probe_SKU___SEN0208

Angelo edited this page Sep 22, 2016 · 5 revisions

right

Introduction

Most ultrasonic distance sensors aren't waterproof which can be a problem if you need your project to withstand the elements outdoors. No need to worry any more! We have developed waterproof ultrasonic distance sensors with a waterproof sealed emitter. This sensor is suitable for outdoor applications such as car reversing sensors, security alarms, industrial inspection, etc. What will you make?

Specification

  • Operating Voltage: 5V DC
  • Static Current: 5mA
  • Operating Current: 30mA
  • Operating Range: 25cm ~ 4.5m
  • Resolution: 0.5cm
  • Detecting Angle: < 70°
  • Operating Temperature: -10 ~ 70°C
  • Cable Length: 2.5 M
  • Dimension: 41mm x 28.5mm/1.61*1.12 inches
  • Weight: 54g

Board Overview

----------------------------------------------------
center
                                                      |-----------------------------------------------|
                                                      | |                                           |
                                                       |-------------------------------------------|
                                                       | |           |          |                |
                                                        |-----------|----------|----------------|
                                                        | **LABEL** | **NAME** | **FUNCTION**   |
                                                        | 1         | 5V       | Power Input +  |
                                                        | 2         | Trig     | Trigger Signal |
                                                        | 3         | Echo     | Echo Signal    |
                                                        | 4         | GND      | GND            |  |  |  |

Tutorial

This tutorial will demonstrate how to use the Weather-proof Ultrasonic Sensor to measuring distance.

Fundamental Principles

center A short ultrasonic pulse is transmitted at the time 0, reflected by an object. The sensor receives this signal and converts it to an electric signal. The next pulse can be transmitted when the echo fades. This time period is called cycle period. The recommend cycle period should be no less than 50ms. If a 10μs width trigger pulse is sent to the signal pin, the ultrasonic module will output eight 40kHz ultrasonic signals and detect the echo back. The measured distance is proportional to the echo pulse width and can be calculated by the formula above. If no obstacle is detected, the output pin will give a 38ms high level signal.

### Requirements
  • Hardware
    • Arduino UNO x1
    • Battery Capacity Indicator x1
  • Software
### Connection Diagram

center

Sample Code

#define ECHOPIN 2// Pin to receive echo pulse
#define TRIGPIN 3// Pin to send trigger pulse
void setup(){
  Serial.begin(9600);
  pinMode(ECHOPIN, INPUT);
  pinMode(TRIGPIN, OUTPUT);
}
void loop(){
  digitalWrite(TRIGPIN, LOW); // Set the trigger pin to low for 2uS
  delayMicroseconds(2);
  digitalWrite(TRIGPIN, HIGH); // Send a 10uS high to trigger ranging
  delayMicroseconds(10);
  digitalWrite(TRIGPIN, LOW); // Send pin low again
  int distance = pulseIn(ECHOPIN, HIGH,26000); // Read in times pulse
  distance= distance/58;
  Serial.print(distance);
  Serial.println("   cm");                   �
  delay(50);// Wait 50mS before next ranging
}

FAQ

There are no questions about this product yet. If you have any problems or suggestions, you are welcome to email us or post on the DFRobot forum!

center For any questions/advice/cool ideas to share, please visit the DFRobot Forum or email techsupport@dfrobot.com

More Documents

link=http://www.dfrobot.com/ get it from dfrobot store

Clone this wiki locally