Ultrasonische afstandssensor HC-SR04

Artikelnummer: CMP-102
6 Stuks op voorraad Direct leverbaar
50% Korting
€2,00
1,- (€0,83 excl. BTW)
stuks
Minimale afname: 3 stuks

Slim combineren

Bracket voor Ultrasonische Afstandssensor HC-SR04
Bracket voor Ultrasonische Afstandssensor HC-SR04
€0,50
stuks
Minimale afname: 4 stuks 7 stuks op voorraad

Introductie HC-SR04 Ultrasonische afstandssensor

De HC-SR04 ultrasonische afstandssensor is een module waarmee je contactloos de afstand kunt meten tussen de module en een object. Met deze sensor stuur je een geluidssignaal de ruimte in, en wacht totdat de reflectie van dit signaal terug is ontvangen. De tijd die het duurt van zenden tot ontvangen kan vertaald worden naar een fysieke afstand.

Afstand meten met de HC-SR04 ultrasonische sensor

  • Sluit VCC aan op 5V
  • Sluit GND aan op de ground/massa
  • Sluit de pin TRIG aan op een digitale output van de Arduino
  • Sluit de pin ECHO aan op een digitale input van de Arduino
  • Download de 'NewPing.h' library (zie hieronder) en voeg deze aan Arduino toe

Downloads & Code

Download Arduino Library <NewPing.h>

#include <newping.h>

#define TRIGGER_PIN  12  
#define ECHO_PIN     11  
#define MAX_DISTANCE 200 

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

void setup() {
  Serial.begin(115200); // Start serial communication.
}

void loop() {
  delay(30);  // Wait 30ms between pings
  Serial.print("Ping: ");
  Serial.println(sonar.ping_cm()); // Send ping, and receive in the Serial Plotter
}


Technische specificaties

  • Voedingsspanning: 5V
  • Meetbereik: 2 tot 450cm
  • Meetfrequentie: Maximaal 20x per seconde
  • Aansturing: 1 output, 1 input
  • Detectiehoek sensor: ca. 15 graden
Er zijn nog geen beoordelingen voor dit product geplaatst.

Aanbevolen producten