特價

HC-SR04P 超音波測距模組 HC-SR04 Plus 寬電壓 3.3-5V 輸入

NT$85 NT$76

50 件庫存

描述

HC-SR04P  超音波測距模組 HC-SR04 Plus 寬電壓 3.3-5V 輸入 HC-SR04+ 本模組為升級版

 超音波測距/避障模組 寬電壓3-5.5V , 超聲波傳感器

HC-SR04P 超音波測距模組。這款經濟型傳感器提供2cm至400cm的非接觸式測量功能,測距精度可達3mm。每個 HC-SR04P 模塊包括一個超聲波發射器,一個接收器和一個控制電路。在HC-SR04上只需要四個引腳:VCC(電源),Trig(觸發器),Echo(接收)和GND(地)。你會發現這個傳感器很容易設置和使用你的下一個測距項目!

  1. HC-SR04P 超音波測距模組是 HC-SR04的升級版
  2. 寬電壓的輸入範圍:DC3V~5.5V
  3. 解決了Arduino 5V輸出不夠用的窘境
  4. HC-SR04+升級版超音波測距模組,出廠都經過嚴格的測試老化試驗,品質有保障。
  5. 本模組性能穩定,測距精確。媲美SRF-05,SRF-02等超音波測距模組。
  6. 具備高精度測距能力,盲區僅有2公分(2cm)超近、超穩定的測距性能。
  7. 完全謙容GH-311防盜模組

 

HC-SR04 HC-SR04P Ultrasonic Module Distance Measuring Sonar Sensor 3 V-5.5 

Description

The HC-SR04p ultrasonic sensor uses sonar to determine distance.  It gives excellent non-contact range detection (2cm-400cm or 1’-13’) with high accuracy and stability in one inexpensive component. With only four pins (Vcc, trigger, echo, and ground, this sensor is very easy to set up and use for range-finding projects like a sonic tape measure or an obstacle avoidance mechanism for a robot.

This sensor works by sending a pulse to the trigger pin. Once triggered, the sensor will send out a pulse of sound and listen for the echo. When it detects the echo, it will output a pulse equal in length to the time it took to hear the echo. The distance can then be calculated as half the time to echo divided by the speed of sound (Pulse Time / 2*Speed of Sound).

Technical Specs

  • Supply Voltage: 5 V
  • Supply Current: 15 mA
  • Operating Frequency: 40 kHz
  • Range: 2 – 400 cm
  • Input Pulse: TTL >10 μs
  • Output Pulse: TTL Proportional to Distance

Application : Computer

Dissipation Power : standard
Condition : New

/*
 HC-SR04 Ping distance sensor]
 VCC to arduino 5v GND to arduino GND
 Echo to Arduino pin 13 Trig to Arduino pin 12
 Red POS to Arduino pin 11
 Green POS to Arduino pin 10
 560 ohm resistor to both LED NEG and GRD power rail
 More info at: http://goo.gl/kJ8Gl
 Original code improvements to the Ping sketch sourced from Trollmaker.com
 Some code and wiring inspired by http://en.wikiversity.org/wiki/User:Dstaub/robotcar
 */

#define trigPin 13
#define echoPin 12
#define led 11
#define led2 10

void setup() {
  Serial.begin (9600);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
}

void loop() {
  long duration, distance;
  digitalWrite(trigPin, LOW);  // Added this line
  delayMicroseconds(2); // Added this line
  digitalWrite(trigPin, HIGH);
//  delayMicroseconds(1000); - Removed this line
  delayMicroseconds(10); // Added this line
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  if (distance < 4) {  // This is where the LED On/Off happens
    digitalWrite(led,HIGH); // When the Red condition is met, the Green LED should turn off
  digitalWrite(led2,LOW);
}
  else {
    digitalWrite(led,LOW);
    digitalWrite(led2,HIGH);
  }
  if (distance >= 200 || distance <= 0){
    Serial.println("Out of range");
  }
  else {
    Serial.print(distance);
    Serial.println(" cm");
  }
  delay(500);
}