ROSANNAPAPINI.IT ≡ Accessories Circuitoimpreso Kits Educativos Amplifier
  • Proximity

  • Ultrasonic Ranging Module HC-SR04

Ultrasonic Ranging Module HC-SR04

$19.8 $28.71
If you are sourc­ing a ultra­son­ic rang­ing mod­ule , the HC-SR04 is good choose . Its sta­ble per­for­mance and high rang­ing accu­ra­cy make it a pop­u­lar mod­ule in elec­tron­ic mar­ket .Com­pared to the Shap IR rang­ing mod­ule , HC-SR04 is more inex­pen­sive than it . But it has the same rang­ing accu­ra­cy and longer rang­ing dis­tance.SpecificationsPow­er sup­ply: 5V DCQui­es­cent cur­rent: <2mAEffec­tu­al angle: <15°Rang­ing dis­tance: 2cm – 500 cmRes­o­lu­tion: 1 cmUltra­son­ic Fre­quen­cy: 40k HzDatasheetDS_IM120628012_HC_SR04.pdf    LibraryLib_IM120628012_HC_SR04.zipSim­ple CodeArduino simple code /* 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 12 #define echoPin 13 #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); }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354sim­ple code /* HC-SR04 Ping dis­tance sen­sor] 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 resis­tor to both LED NEG and GRD pow­er rail More info at: http://goo.gl/kJ8Gl Orig­i­nal code improve­ments to the Ping sketch sourced from Trollmaker.com Some code and wiring inspired by http://en.wikiversity.org/wiki/User:Dstaub/robotcar */ #define trig­Pin 12#define echoPin 13#define led 11#define led2 10 void set­up() {  Ser­i­al.begin (9600);  pin­Mode(trig­Pin, OUTPUT);  pin­Mode(echoPin, INPUT);  pin­Mode(led, OUTPUT);  pin­Mode(led2, OUTPUT);} void loop() {  long dura­tion, dis­tance;  dig­i­tal­Write(trig­Pin, LOW);  // Added this line  delayMi­crosec­onds(2); // Added this line  dig­i­tal­Write(trig­Pin, HIGH);//  delayMicroseconds(1000); — Removed this line  delayMi­crosec­onds(10); // Added this line  dig­i­tal­Write(trig­Pin, LOW);  dura­tion = pul­seIn(echoPin, HIGH);  dis­tance = (dura­tion/2) / 29.1;  if (dis­tance < 4) {  // This is where the LED On/Off hap­pens    dig­i­tal­Write(led,HIGH); // When the Red con­di­tion is met, the Green LED should turn off  dig­i­tal­Write(led2,LOW);}  else {    dig­i­tal­Write(led,LOW);    dig­i­tal­Write(led2,HIGH);  }  if (dis­tance >= 200 || dis­tance <= 0){    Ser­i­al.print­ln(“Out of range”);  }  else {    Ser­i­al.print(dis­tance);    Ser­i­al.print­ln(“ cm”);  }  delay(500);}
Proximity

Proximity

  • TF-Luna (ToF) Micro Single-point Ranging LiDAR
    $62.5 $118.75
  • IR Sensor for Obstacle Avoidance KY-032
    $20.7 $26.29
  • VL53L0XV2 Laser Ranging Sensor Time-of-Flight (ToF)
    $22.5 $31.05
  • Ultrasonic Ranging Module HC-SR04
    $19.8 $28.71
  • HB100 X 10.525GHz Microwave Sensor
    $35.1 $48.09
  • Ultrasonic Ranging Sensor Bracket
    $12.6 $16.25
  • Waterproof Integrated Ultrasonic Ranging Module — JSN-B02
    $60.3 $75.38
  • GYVL53L0XV2 Laser Ranging Sensor Time-of-Flight (ToF)
    $17.1 $20.86
  • Sweep Hand Sensor Switch Module
    $21.6 $26.35

© 2026 - ROSANNAPAPINI.IT