-40%
Waterproof Ultrasonic/Distance Sensor UART/PWM 8° Small Angle long range Arduino
$ 18.47
- Description
- Size Guide
Description
Product introduction:DYP-ME007-ULS large-range waterproof distance measuring module is a high-performance ranging controller independently. It adopts a transceiver-enclosed waterproof probe with a certain degree of dustproof and waterproof, suitable for wet and harsh measurement occasions. Compatible with three different output modes, the module is a high-performance, high-reliability commercial-grade functional module that is easy to operate.
DJL-ME007-ULS V1 ultrasonic controller is a high-performance ranging controller designed with integrated waterproof probe. Using the principle of ultrasonic echo ranging, using precise time difference measurement technology, the distance between the sensor and the target object is detected non-contact. For transparent or colored objects, metal objects, non-metallic objects, and solid, liquid or powdery substances can be detected.
Ranging principle: The ultrasonic pulse emitted by the ultrasonic probe is transmitted to the measured object through the air medium, and then returned to the ultrasonic probe through the air medium after reflection, and the time when the ultrasonic pulse propagates from the launch to the receiving in the air medium is measured. According to the speed of sound in the air medium, the distance from the ultrasonic probe to the surface of the object can be calculated. So we can calculate the distance from the probe to the reflecting surface s = v * t / 2 (divide by 2 because the sound wave actually goes back and forth from launch to reception, s is the distance, v is the speed of sound, t is the time).
Product Features:
1. High degree of protection;
2, wide power supply range, ultra low power consumption;
3, easy to use, easy to operate;
4. High measurement accuracy and high resolution;
5. The detection blind zone is small and the detection distance is long;
6, with high-precision temperature output and temperature compensation;
7, with a physical bell mouth shell, has better directivity and stability;
8, the output mode is diversified, there are serial output, PWM output, switch output.
9, Strong anti-interference
10, Fast response time
11, Wide operating temperature
12, Data output is stable and reliable
13, With a physical bell mouth shell for better directivity and stability
Product application:
1. High precision ranging;
2. Obstacle avoidance and automatic control;
3, the object is close, there is awareness;
4. Traffic control;
5. Security and industrial control;
6, artificial intelligence, teaching and research.
Electrical parameters:
~ Range: 27-800cm
~ Supply voltage
3.3V-12V, ripple less than 100mV / power supply 3.3-12V
~ stand-by current
Less than 200uA
~
Working current
Average current 2mA when powering 5V/duty cycle 250MS
~ Center frequency
40 KHZ
~
Blind zone distance
250 mm
~ Detection starting point
The default is to probe the surface, to reduce the face of the bell mouth by 40MM
~
Farthest distance
Greater than 8000 mm
~ Launch angle
8°
~
Working period
Greater than 60MS for PWM,
250 MS for Switch mode
~
Trigger signal
Falling edge trigger for PWM,
Connect to GND for Switch mode
~
Ranging accuracy
±1cm
~
Resolution
1 mm
~
Temperature output present in UART mode
~ Operating temperature
-25°C—70°C
~ storage temperature
-40°C—85°C
Pin definition
1 , the interface " 1.DC3.3-12V ": power supply positive terminal, DC voltage in the range 3.3V to 12V are between work properly.
2 , interface " 2.Trigger ": trigger pin, trigger voltage input low level maximum 0.8V , input high level minimum 2.0V , can not exceed 5.5V .
3. Interface “3.TX/PWM”: output pin, output TTL level serial port signal in serial port mode ; output TTL level PWM signal in P WM mode ;
4. Interface “4.ON-OFFout”: Output pin, which outputs high and low switching signals in the switching mode.
5, the interface "5. GND": the power supply negative pin, connected to the power ground.
Operation instructions:
The ultrasonic controller has three output modes: serial output, PWM output, and digital output. When the product is shipped from the factory, it is the serial port mode output. You can switch the mode by pressing the button and trigger mode. The indicator light will indicate the switching status.
Specification:
~ Operating Voltage: 3.3~12V(DC)
~ Average Current: <10mA
~ Effective Detecting Distance: 27-800cm/ 10.63-314.96 inches
~ Output Mode:
PWM:without temperature compensation, directly output 3.3V TTL PWM signal, the working period must be over 60ms.
UART: with temperature compensation and temperature output, trigger by external signal, output 3.3V TTL serial data, the working period must be over 60ms.
Switch: auto-detecting distance with 250ms working period. The detected value will be compared with the pre-set threshold vaule so as to control the output state of switch(output high level 3.3V by default).
~ Probe Frequency: 40K±1.0K Hz
~ Measurement Accuracy:
PWM Output: ±(1+S*0.5%)cm
UART Output: ±(1+S*0.3%)cm
Switch Output: ±(1+S*0.3%)cm
~ Operating Temperature: -15~60°C
~ Storage Temperature: -25~80°C
~ Operating Humidity: RH<80%
~ Storage Humidity: RH<90%
~ Measurement Period: <60ms
~ Dimension: 60 x 43.2x 31.4mm/2.36x1.70x1.24"
Operation Instruction
The ultrasonic sensor has three output modes: serial, PWM, switch. The default output mode of the sensor is serial output. The change output mode of pressing or triggering. The indicators will flash in different ways to indicate the corresponding mode.
Button Operation Description
a. Short-press (less than 2s): serial and PWM output modes can be switched in turn by short-pressing. When successfully switched, the module will remember the mode, and it won't be lost when powered down.
b. Long-press (more than 3s): the controller will save the currently detected vaule and take it as threshold distance value under Switch mode. After the setting is done, the module will remember the threshold value and it won't lost when Powered down.
Trigger Signal
a. When the trigger pin "2.Trigger" is at High Level, the controller will be in standby state of low-power consumption.
b. When the trigger pin "2. Tigger" is at falling edge, the Low Level of the falling edge should keep 0.1~10ms. (1) Under UART output mode, the controller will be triggerred once and then output one frame serial data (2) Under PWM output mode, the controller will be triggerred one and output PWM signal.
c. When the trigger pin "2.Trigger" is at Low Level or be grounded, the controller will be under Switch Mode.
Indicator Description
When successfully switched to PWM mode by short-pressing, the LED will flash blue once, wait 1 second, and flash once again.
b. When successfully switched to serial mode by short-pressing, the LED will flash blue three times, wait 1 second, and flash three times again.
c. When the threshold value is set successfully by long-pressing, the LED will flash red and blue five times alternately.
d. When the controller is in the Serial or PWM mode, it will be triggered once by the falling edge, and the LED will flash red once.
e. When the controller is in the Switch mode, the LED will indicate the state of the Switch. If the currently detected value is within the range of the thresholds value, the LED will emit red. if not, the LED turns off.
Serial Output
The default output mode of the product is serial mode. If currently it is not in the serial mode, you can switch to this mode by short-pressing. when successfully switched, the LED flashes blue three times, stop 1 second and flashes three times Again.
When the trigger pin "2.Trigger" is at falling edge and the Low level is kept for 0.1-10ms, the controller will be triggerred once, and the output pin "3.TX/PWM" will output one frame serial data of 3.3 V TTL with temperature compensation. The trigger period of the controller must be over 60ms.
Eg: the temperature value is 281 when converted to decimal; The currently detected temperature is 28.1°C. (Unit: °C)
Checksum Calculation
Note: just reserve the eight lower bits of the accumulated value of checksum.
SUM=(frame header+ Data_H+ Data_L+ Temp_H+ Temp_L)&0x00FF
PWM Output
Switch to PWM mode by short-pressing the button. When succeeded, the LED flashes blue once, wait 1 second, then flash once again.
When the trigger pin "2.Trigger" is at falling edge and the Low level is kept for 0.1-10ms, the controller will be triggerred once and the output pin "3.TX/PWM" will output PWM signal of 3.3V TTL. The trigger period of the controller must be over 60ms.
Output Principle
When the trigger pin received the falling edge trigger level, the module will emit 40kHz ultrasound, at the same time, the output pin "3.TX/PWM" will be pulled up. when it detected the echo signal, the output pin will be Pulled down immediately. When it did't detect any objects, the output pin will be pulled down to stop detecting after 55ms, and there is no temperature compensation in this process.
Use MCU to judge the time of high level, which also is the time for the ultrasound to travel between the module and the detected object. The distance can be calculated then when we get the ultrasound velocity and the time.
Note: T1=0.1-10ms; T2=4-6ms; T3=1-55ms
Calculation
Distance=High level time×Velocity(340m/s)/2, us/58=cm or us/148=inch; in different temeprature, the velocity of the ultrasound: v=332+0.6t(m/s). If The controller did't detect any objects, the output pin will output constant pulse width for 55ms.
Switch Output
When the trigger pin "2.Trigger" is at low level or grounded, the controller will be in Switch mode, and automatically starts detecting with 250ms working period. Compare the detected value with the pre-set threshold value so as to control the output State of the switch.
Set the threshold value
Step 1: evaluate the threshold distance value, put an object or baffle at the distance equal to the preset threshold distance. For instance, when we set the threshold vlaue to 3m, then we need to place a flat baffle at 3m away. Baffle on the ground to form an open field so as to assure the detection accuracy.
Step 2: direct the controller at the object or the flat baffle, long-press for 3 seconds above. When the LED flashed red and blue alternately, the setting is done. The controller will remember the currently detected distance and take it as the threshold Continue to long-press the button if you need to reset the threshold value.
Output State
Case 1: if the detected value is smaller than the preset threshold, the output pin "4.ON-OFFout" output low value, at the same time, the LED emits red.
Case 2: if the detected vaule is bigger than the perset threshold, "4.ON-OFFout" output pull-up high level and the LED turns off.
Read serial port data Arduino Code:
#include
SoftwareSerial mySerial(10, 11); // RX, TX
char col;
unsigned char buffer_RTT[6] = {};
int Rage = 0;
float Temp = 0;
int Tflag = 0;
void setup() {
Serial.begin(57600); // Enable the serial port and set the band rate to 57600 bps
mySerial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(4);
digitalWrite(LED_BUILTIN, HIGH);
do{
for (int j = 0; j <= 5; j++){
col = mySerial.read();
buffer_RTT[j] = (char)col;
}
} while(mySerial.read() == 0xff);
mySerial.flush();
if(buffer_RTT[0]==0xff){
int cor;
cor=(buffer_RTT[0]+buffer_RTT[1]+buffer_RTT[2]+buffer_RTT[3]+buffer_RTT[4])&0x00FF;//Check
if(buffer_RTT[5]==cor)
{
Rage = (buffer_RTT[1] << 8) + buffer_RTT[2];
Tflag= buffer_RTT[3]&0x80;
if(Tflag==0x80){
buffer_RTT[3]=buffer_RTT[3]^0x80;
}
Temp = (buffer_RTT[3] << 8) + buffer_RTT[4];
Temp = Temp/10;
}
else{
Rage = 0;
Temp = 0;
}
}
Serial.print("Rage : ");
Serial.print(Rage);//Output distance unit mm
Serial.println("mm");
Serial.print("Temperature: ");
if(Tflag ==0x80)
{
Serial.print("-");
}
Serial.print(Temp);//Output temperature
Serial.println("℃");
Serial.println("============================== ");
}
PWM Output Arduino Code:
#include
char col;// for storing the data read from the serial port
unsigned long duration;
int datapin = 10;
int val = 0;
void setup() {
Serial.begin(57600); //Enable the serial port and set band rate to 57600 bps
pinMode(LED_BUILTIN, OUTPUT);
pinMode(datapin, INPUT);
digitalWrite(LED_BUILTIN, HIGH);
}
void loop(){
digitalWrite(LED_BUILTIN, HIGH);
delay(57);
digitalWrite(LED_BUILTIN, LOW);
delay(4); //give level signal
duration = pulseIn(datapin, HIGH);//read the high level pulse on the pin, the maximum pulse interval is 55ms; assign the result to the variable "duration"
delay(3);
digitalWrite(LED_BUILTIN, HIGH);//Pull up the signal pin
duration = duration/ 58.00; //convert time to distance
Serial.print(duration);//serial port print data
Serial.println("cm");
Serial.println("=========== ");
}
Switch Output Arduino Code:
#include
SoftwareSerial mySerial(10, 11); // RX, TX
unsigned char buffer_RTT[7] = {};
unsigned long duration;
int datapin = 9;
void setup() {
Serial.begin(57600); // Enable serial port and set band rate to 57600 bps
mySerial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(datapin, INPUT);
digitalWrite(LED_BUILTIN, HIGH);
}
void loop() {
digitalWrite(LED_BUILTIN, LOW);//give low level
duration = digitalRead(datapin);//read pin state
delay(3);
switch(duration){
case 0 :Serial.println("LOW"); break;//the distance to the object is less than the preset distance, set the defalut to 1m
case 1 :Serial.println("HIGH"); break;//the distance to the object is more than the preset distance
}
}