制造商零件编号 A000066
ARDUINO UNO R3 ATMEGA328P BOARD
Arduino
所订产品一般在 7-10个工作日 内送达中国,具体时间取决于收货地点。
最低订购金额为人民币 300 元,顺丰快递免运费配送。
当用人民币下单时,按照国际贸易条款 DDP(DigiKey 支付关税、海关费用和当地税款)方式结算。
电汇预付
更多来自全授权合作伙伴的产品
下单后,从合作伙伴发货平均需要时间 1-3 天,也可能产生额外运费。可能另外收取运费。 实际发货时间请留意产品详情页、购物车和结账页面上的说明。
国际贸易结算方式:CPT(交货时支付关税、海关费用和适用 VAT/应付税金)
有关详情,请访问帮助和支持
License: General Public License Ultrasonic Arduino
As we know ultrasonic sensors use sound waves to detect objects in their vicinity, making them perfect for applications like distance measurement, obstacle avoidance, and even robotics. If we look at the most popular ultrasonic sensor among the DIY community it is the HC-SR04, which is very easy to use and cheap to acquire. So let's start by looking at how the sensor actually works.
An ultrasonic sensor comprises several essential components that work together to measure distances or detect objects using high-frequency sound waves. At its core is the transducer, typically made of a piezoelectric crystal, which both emits and receives ultrasonic waves. The sensor's operation begins with the ultrasonic transmitter, which sends out bursts of high-frequency sound waves into the environment.
On the back of the Ultrasonic sensor, we have the MAX232 sensor on the right side, which converts the electrical signal received from the trig pin. Converts it into an ultrasonic pulse and sends it through the transmitter side.
These waves bounce off objects in their path and are detected by the ultrasonic receiver. The two LM324 ICs on the left side take this ultrasonic pulse convert it into an electrical signal and send it to the echo pin.
The receiver converts the reflected waves into electrical signals. The time it takes for the sound waves to travel to the object and back is precisely measured by signal processing circuitry within the sensor. This time measurement is then used for calculating distances and determining the presence of objects in proximity to the sensor.
To Interface the Ultrasonic Sensor to the Arduino. You need to connect the sensor's TRIG (trigger) pin to Arduino pin 4. The sensor's ECHO pin to Arduino pin 5. Sensor’s VCC (power) pin to Arduino's 5V output and sensor's GND (ground) pin to Arduino's GND.
Once the connections are made, upload the code to the Arduino and open the serial monitor to see the result.
For more information check out the Ultrasonic sensor interfacing tutorial.
Code
const int trigPin = 4;
const int echoPin = 5;
long duration;
int distance;
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(1000);
}
谢谢!
敬请关注收件箱中的 DigiKey 新闻与更新!
请输入电子邮件地址