รู้จักสินค้านี้
รายละเอียด เซนเซอร์ Ultrasonic Module HC-SR04
Module main technical parameters:
1.Working Voltage : 5V(DC)
2.Static current: Less than 2mA.
3.Output signal: Electric frequency signal, high level 5V, low level 0V.
4.Sensor angle: Not more than 15 degrees.
5.Detection distance: 2cm-450cm.
6.High precision: Up to 0.3cm
7.Input trigger signal: 10us TTL impulse
8.Echo signal : output TTL PWL signal
Mode of connection:
1.VCC
2.trig(T)
3.echo(R)
4.GND
Use method:
Supply module with 5V, the output will be 5V while obstacle in range, or 0V if not.The out pin
of this module is used as a switching output when anti-theft module, and without the feet when
ranging modules.
Note : the module should be inserted in the circuit before been power, which avoid producing
high level of misoperation;if not, then power again.
Module Working Principle:
1.Adopt IO trigger through supplying at least 10us sequence of high level signal.
2.The module automatically send eight 40khz square wave and automatically detect whether receive
the returning pulse signal.
3.If there is signals returning, through outputting high level and the time of high level
continuing is the time of that from the ultrasonic transmitting to receiving. Test distance =
(high level time * sound velocity (340M/S) / 2.
Note : This module is not suitable to connect with electric power, if you need to connect this
module with electronic power,then let the GND terminal of this module to be connected
first,otherwise, it will affect the normal work of the module
ดาวน์โหลด library hc sr04 ที่นี่
Code ตัวอย่างการใช้งาน
ศึกษาเพิ่มเติมได้ที่นี่
- /*
- * Ultrasonic Sensor HC-SR04 and Tutorial
- *
- * by Dejan Nedelkovski,
- * www.HowToMechatronics.com
- *
- */
-
- // defines pins numbers
- const int trigPin = 9;
- const int echoPin = 10;
-
- // defines variables
- long duration;
- int distance;
-
- void setup() {
- pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
- pinMode(echoPin, INPUT); // Sets the echoPin as an Input
- Serial.begin(9600); // Starts the serial communication
- }
-
- void loop() {
- // Clears the trigPin
- digitalWrite(trigPin, LOW);
- delayMicroseconds(2);
-
- // Sets the trigPin on HIGH state for 10 micro seconds
- digitalWrite(trigPin, HIGH);
- delayMicroseconds(10);
- digitalWrite(trigPin, LOW);
-
- // Reads the echoPin, returns the sound wave travel time in microseconds
- duration = pulseIn(echoPin, HIGH);
-
- // Calculating the distance
- distance= duration*0.034/2;
-
- // Prints the distance on the Serial Monitor
- Serial.print("Distance: ");
- Serial.println(distance);
- }
***รายละเอียดและเงื่อนไขการรับประกัน***
- ร้านเราจัดส่งสินค้าทุกวันจันทร์-เสาร์
- หากลูกค้ากดสั่งซื้อผ่านระบบได้สำเร็จ แสดงว่ามีสินค้าพร้อมจัดส่งได้ทันที
- สต๊อกสินค้าอยู่ในประเทศไทย ส่งถึงมือลูกค้าภายใน 1-3 วัน รวดเร็วทันใจแน่นอน
- หากลูกค้าต้องการบิลใบเสร็จ ให้แจ้งที่หมายเหตุถึงร้านค้าหรือแชทแจ้งทางร้านได้เลย
*** เงื่อนไขการรับประกัน***
- หากลูกค้าได้รับสินค้าผิด ชำรุด ให้ถ่ายรูปสินค้าที่ได้รับส่งมาทางแชท แจ้งปัญหาได้ ทางร้านยินดีเปลี่ยนสินค้า/คืนเงิน
- ทางร้านรับประกันสินค้า 1 เดือน หากสินค้ามีปัญหาแจ้งมาทางแชทได้เลย สินค้าจะต้องอยู่ในสภาพที่สมบูรณ์ไม่ถูกงัดแงะ ถูกบัดกรี หรือเสียหายจากลูกค้าเป็นผู้กระทำ
- กรณีคืนสินค้าที่มีปัญหา ลูกค้าทำเรื่องคืนสินค้ามายังร้าน เมื่อร้านค้าได้รับสินค้าคืนจะดำเนินการตรวจสอบสินค้าและคืนเงินให้ทันที
- หากเกินระยะเวลารับประกัน ทางร้านจะไม่รับชอบใดๆทั้งสิ้น ฯลฯ