Ultrasonische afstandssensor HC-SR04

Ultrasonische afstandssensor HC-SR04

Artikelnummer : CMP-102
Dit artikel is tijdelijk niet leverbaar.
Uitverkocht

_Self (id: 15274)

Stock: 0 Price stack count: 1 Stack #0: Amount 3 = 1

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

Aanbevolen producten

Arduino Uno R3 ATmega328p (CH340G)
Uitverkocht
Gewichtssensor 50kg (Load Cell)
66%
OFF
Op voorraad
€2,95 €1,00