KS0376 EASY plug SR01 Ultrasonic Module V2: Difference between revisions
Keyestudio (talk | contribs) (Created blank page) |
Keyestudio (talk | contribs) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[image:Ks0376-1.png|thumb|400px|right|EASY plug SR01 Ultrasonic Module V2 Eco-friendly]] | |||
<br> | |||
==Introduction== | |||
The distance sensor are really common in robotics projects, very useful for automation, interactive art and motion sensing. <br> | |||
This EASY Plug SR01 Ultrasonic integrates ultrasonic transmitter, receiver and corresponding control circuit. '''It uses upgraded N76E003AT20 solution'''.<br> | |||
The module comes with four fixed holes, so that can easily fix it on other devices, such as the servo plastic platform and so on. <br> | |||
It should be connected to the double digital interface with only one line, which is very easy to use and convenient for connection. <br> | |||
Note that this module matches with EASY plug control board. | |||
<br>[[File:Ks0376-2.png|500px|frameless|thumb]]<br> | |||
<span style=color:red> '''Special Note:''' <br> | |||
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface. <br> If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module. </span><br> | |||
<br> | |||
==Specification== | |||
* Operating Voltage: DC 5V | |||
* Operating Current: 15mA | |||
* Operating Frequency: 40KHz | |||
* Max Range: 2--3m | |||
* Min Range: 2cm | |||
* Measuring Angle: 15 degree | |||
* Interface:double digital | |||
<br> | |||
== Technical Details == | |||
* Dimensions: 49mm*25.4mm*28mm | |||
* Weight: 10.4g | |||
<br>[[File:Ks0376-3.png|500px|frameless|thumb]]<br> | |||
<br> | |||
== Connection Diagram == | |||
Connect the EASY Plug Ultrasonic module to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable. | |||
<br>[[File:Ks0376-4.png|600px|frameless|thumb]]<br> | |||
<br> | |||
==Sample Code== | |||
Copy and paste below code to [https://wiki.keyestudio.com/How_to_Download_Arduino_IDE Arduino IDE] and upload. <br> | |||
<pre> | |||
#define echoPin 4 // Echo Pin | |||
#define trigPin 3// Trigger Pin | |||
#define LEDPin 13 // Onboard LED | |||
int maximumRange = 200; // Maximum range needed | |||
int minimumRange = 0; // Minimum range needed | |||
long duration, distance; // Duration used to calculate distance | |||
void setup() { | |||
Serial.begin (9600); | |||
pinMode(trigPin, OUTPUT); | |||
pinMode(echoPin, INPUT); | |||
pinMode(LEDPin, OUTPUT); // Use LED indicator (if required) | |||
} | |||
void loop() { | |||
/* The following trigPin/echoPin cycle is used to determine the | |||
distance of the nearest object by bouncing soundwaves off of it. */ | |||
digitalWrite(trigPin, LOW); | |||
delayMicroseconds(2); | |||
digitalWrite(trigPin, HIGH); | |||
delayMicroseconds(10); | |||
digitalWrite(trigPin, LOW); | |||
duration = pulseIn(echoPin, HIGH); | |||
//Calculate the distance (in cm) based on the speed of sound. | |||
distance = duration/58.2; | |||
if (distance >= maximumRange || distance <= minimumRange){ | |||
/* Send a negative number to computer and Turn LED ON | |||
to indicate "out of range" */ | |||
Serial.println("-1"); | |||
digitalWrite(LEDPin, HIGH); | |||
} | |||
else { | |||
/* Send the distance to the computer using Serial protocol, and | |||
turn LED OFF to indicate successful reading. */ | |||
Serial.println(distance); | |||
digitalWrite(LEDPin, LOW); | |||
} | |||
//Delay 50ms before next reading. | |||
delay(50); | |||
} | |||
</pre> | |||
<br> | |||
== What Should You See == | |||
<br>[[File:Ks0376-5.png|600px|frameless|thumb]]<br> | |||
Done uploading the code, open the serial monitor and set the baud rate to 9600. <br> | |||
Move your hand or a large, flat object closer and farther away from the distance sensor. You should see the measured distance value pop up on the monitor. | |||
<br>[[File:Ks0376-6.png|600px|frameless|thumb]]<br> | |||
<br>[[File:Ks0376-7.png|600px|frameless|thumb]]<br> | |||
<br> | |||
==Resources == | |||
https://fs.keyestudio.com/KS0376 | |||
<br> | |||
==Buy from == | |||
*[https://www.keyestudio.com/newest-keyestudio-rj11-easy-plug-sr01-ultrasonic-sensor-module-v20-n76e003at20-for-arduino-robot-car-p0530-p0530.html Get one now on official website] | |||
*[https://www.aliexpress.com/store/product/Newest-Keyestudio-RJ11-Easy-Plug-SR01-Ultrasonic-Sensor-Module-V2-0-N76E003AT20-for-Arduino-Robot-Car/1452162_33012266703.html?spm=2114.12010611.8148356.15.102f6c0eHvh3Pj Shop on aliexpress store ] | |||
[[category:EASY plug]] |
Latest revision as of 08:49, 8 January 2021
Introduction
The distance sensor are really common in robotics projects, very useful for automation, interactive art and motion sensing.
This EASY Plug SR01 Ultrasonic integrates ultrasonic transmitter, receiver and corresponding control circuit. It uses upgraded N76E003AT20 solution.
The module comes with four fixed holes, so that can easily fix it on other devices, such as the servo plastic platform and so on.
It should be connected to the double digital interface with only one line, which is very easy to use and convenient for connection.
Note that this module matches with EASY plug control board.
Special Note:
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface.
If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module.
Specification
- Operating Voltage: DC 5V
- Operating Current: 15mA
- Operating Frequency: 40KHz
- Max Range: 2--3m
- Min Range: 2cm
- Measuring Angle: 15 degree
- Interface:double digital
Technical Details
- Dimensions: 49mm*25.4mm*28mm
- Weight: 10.4g
Connection Diagram
Connect the EASY Plug Ultrasonic module to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
Sample Code
Copy and paste below code to Arduino IDE and upload.
#define echoPin 4 // Echo Pin #define trigPin 3// Trigger Pin #define LEDPin 13 // Onboard LED int maximumRange = 200; // Maximum range needed int minimumRange = 0; // Minimum range needed long duration, distance; // Duration used to calculate distance void setup() { Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(LEDPin, OUTPUT); // Use LED indicator (if required) } void loop() { /* The following trigPin/echoPin cycle is used to determine the distance of the nearest object by bouncing soundwaves off of it. */ digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); //Calculate the distance (in cm) based on the speed of sound. distance = duration/58.2; if (distance >= maximumRange || distance <= minimumRange){ /* Send a negative number to computer and Turn LED ON to indicate "out of range" */ Serial.println("-1"); digitalWrite(LEDPin, HIGH); } else { /* Send the distance to the computer using Serial protocol, and turn LED OFF to indicate successful reading. */ Serial.println(distance); digitalWrite(LEDPin, LOW); } //Delay 50ms before next reading. delay(50); }
What Should You See
Done uploading the code, open the serial monitor and set the baud rate to 9600.
Move your hand or a large, flat object closer and farther away from the distance sensor. You should see the measured distance value pop up on the monitor.
Resources
https://fs.keyestudio.com/KS0376