รายละเอียด โมดูลวัดระยะทางอัลตราโซนิก US-015 Ultrasonic Module
This US-015 ultrasonic module can realize 2 ~ 400cm of non-contact ranging function, has 5 V of wide voltage input range, static power consumption is less than 3mA. Their own temperature sensor will revise the ranging and has many communication modes like GPIO, just like watchdog inside, very stable and reliable.
Specification:
• US-015 ultrasonic module distance measuring sensor
• Working voltage: DC 5 V
• Static current: 2.2 mA
• Working temperature: 0 ~ + 70°
• Output way: GPIO
• Induction Angle: Less than 15°
• Detection range:2 cm to 400 cm
• Detecting precision: 0.3 cm + 1%
• Sensor size: Approx. 45 x 20 x 1.6mm
• Hole diameter: Approx. 1mm
รายละเอียด เซนเซอร์ Ultrasonic Module HC-SR04 Distance Measuring Transducer Sensor
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
โค้ดตัวอย่างการใช้งาน
/* | |
project_QuadX_2560 GY86_PIDAuto_V1 | |
1. Automatic Takeoff | |
2. Landing | |
by: tinnakon kheowree | |
tinnakon_za@hotmail.com | |
tinnakonza@gmail.com | |
http://quad3d-tin.lnwshop.com/ | |
https://www.facebook.com/tinnakonza | |
#include "Ultrasonic.h" | |
Ultrasonic LV-EZ4 AnalogRead | |
every 50mS, (20-Hz rate) | |
from 6-inches out to 254-inches | |
from 0.15-m out to 6.45 m | |
5V yields ~9.8mV/in. , 1 in = 0.0254 m =~9.8mV/0.0254 m = 0.38582 v/m | |
Ultrasonic_HC-SR04 | |
from 0.02 -m out to 1.4 m | |
//Just connect VCC to (+) on D9, trig to D9, echo to D10, Gnd to (-) | |
*/ | |
float hz_Ultra = 0.0; | |
float Altitude_sona = 0.0; | |
float Altitude_sona2 = 0.0; | |
float Altitude_sonaf = 0.0; | |
float Altitude_sonaold = 0.0; | |
float vz_sona = 0.0; | |
float vz_sona2 = 0.0; | |
float vz_sonaf = 0.0; | |
float Altitude_II = 0.0; | |
float Altitude_Baro_ult = 0.0; | |
#define HCSR04_TriggerPin 9 // should be modified to 9 12 in next version | |
#define HCSR04_EchoPin 10 // should be modified to 10 11 in next version | |
volatile unsigned long HCSR04_startTime = 0; | |
volatile unsigned long HCSR04_echoTime = 0; | |
volatile static int32_t tempSonarAlt=0; | |
void UltrasonicInt() | |
{ | |
pinMode(HCSR04_EchoPin,INPUT); | |
pinMode(HCSR04_TriggerPin,OUTPUT); | |
PCMSK0 = (1<<PCINT4); // Mask Pin PCINT5 - all other PIns PCINT0-7 are not allowed to create interrupts! | |
PCICR |= (1<<PCIE0); // PCINT 0-7 belong to PCIE0 //HCSR04_EchoPin_PCICR | |
} | |
// EchoPin will change to high signalize beginning | |
// and back to low after 58*cm us | |
// First interrupt is needed to start measurement, second interrupt to calculate the distance | |
ISR(PCINT0_vect) { | |
// | |
// Here is a routine missing, to check, if the interrupt was raised for echo pin - not needed at the moment, because we don't have any interrupts | |
// for this interrupt group, but maybe later | |
// | |
if (PINB & (1<<PCINT4)) { //indicates if the EchoPin is at a high state | |
HCSR04_startTime = micros(); | |
} | |
else { | |
HCSR04_echoTime = micros() - HCSR04_startTime; | |
if (HCSR04_echoTime <= 25000) // maximum = 4,31 meter - 30000 us means out of range | |
tempSonarAlt = HCSR04_echoTime / 5.8;//to mm | |
else | |
tempSonarAlt = 4300;// max 4.3 m | |
} | |
} | |
void UltrasonicRead() | |
{ | |
//Ultrasonic LV-EZ4 | |
//int sensorValue = analogRead(A0); | |
//hz_Ultra = (sensorValue*5/1024.0)/0.38528;//5V yields ~9.8mV/in. , 1 in = 0.0254 m =~9.8mV/0.0254 m = 0.38582 v/m | |
//hz_Ultra = constrain(hz_Ultra, 0, 6.45);//m | |
//Ultrasonic_HC-SR04 // create a trigger pulse for 10 us | |
digitalWrite(HCSR04_TriggerPin, LOW); | |
//delayMicroseconds(2); | |
digitalWrite(HCSR04_TriggerPin, HIGH); | |
delayMicroseconds(10); | |
digitalWrite(HCSR04_TriggerPin, LOW); | |
Altitude_sona = tempSonarAlt/1000.0;//m | |
//Altitude_sonaf = (Altitude_sona + Altitude_sona2)/2.0;//filter | |
Altitude_sonaf = Altitude_sonaf + (((Altitude_sona + Altitude_sona2)/2.0) - Altitude_sonaf)*0.687;//filter 42 Hz | |
Altitude_sona2 = Altitude_sona; | |
vz_sona = (Altitude_sonaf - Altitude_sonaold)/0.1;//diff | |
//vz_sonaf = (vz_sona + vz_sona2)/2.0;//filter | |
vz_sonaf = vz_sonaf + (((vz_sona + vz_sona2)/2.0) - vz_sonaf)*0.687;//filter 42 Hz | |
vz_sona2 = vz_sona; | |
vz_sonaf = constrain(vz_sonaf, -3, 3); | |
//Altitude_sonano = constrain(Altitude_sonano, 0, 3.0);//m | |
//Ultrasonic max 0.8 m change to Baro////////////////////////////// | |
if(Altitude_hat > 0.8){ | |
Altitude_Baro_ult = Altitude_barof; | |
} | |
else{ | |
float error_Altitude = Altitude_sonaf - Altitude_barof; | |
Altitude_II = Altitude_II + (error_Altitude*0.0095);//0.005 ,,20 Hz = 0.05 | |
Altitude_Baro_ult = Altitude_sonaf; | |
} | |
//////////////////////////////////////////////////////////////// | |
} |
ร้านค้านี้ยังไม่ได้กำหนดวิธีการชำระเงินค่ะ กรุณา ติดต่อกับทางร้าน เกี่ยวกับรายละเอียดในการชำระเงิน
โทรหาก่อนโอนเงินครับ ทินกร T. 086-054-0582
หรือ แจ้งข้อความทาง Line id tinnakonza
หรือ แจ้งข้อความทาง Facebook https://www.facebook.com/tinnakonza
จ่ายบิทคอยน์สกุลเงินดิจิทัล
BTC - bc1qxhmdufsvnuaaaer4ynz88fspdsxq2h9e9cfrtyt
ETH-erc20 - 0xaB6B4b11378a57933333e4Acfdc45567Dd78ddfrer
กระเป๋า SOL = 9AV2cujwKdcUkskv9Vg4vrWT2vfNxRrMTN5fV1FvyiSk
หน้าที่เข้าชม | 315,709 ครั้ง |
ผู้ชมทั้งหมด | 117,658 ครั้ง |
เปิดร้าน | 21 พ.ย. 2557 |
ร้านค้าอัพเดท | 12 ก.ย. 2568 |