ST1099

Reichelt ST1099 Operating instructions

  • Hello, I have reviewed the user manual for the Ultrasonic Sensor ST1099 ME140, which explains how to use the HC-SRF04 sensor for distance measurement with Arduino. The manual covers the sensor's features, pin connections and provides an example code for displaying distance on the Arduino's serial window and for triggering LEDs based on measured distances. I'm ready to answer any specific question you might have.
  • What is the power supply required for the sensor?
    What is the ranging distance of the sensor?
    What is the trigger input pulse width?
DualUltrasonicSensorModule(ST1099/ME140)
1.Instructions
TheHC‐SRF04isaninexpensiveultrasonicsensorthatcansensenotonlyifanobjectpresentsitself,
likeaPIRsensor,butcanalsosenseandrelaythedistancetothatobject.
Features:
PowerSupply:+5VDC
QuiescentCurrent:<2mA
WorkingCurrnt:15mA
EffectualAngle:<15°
RangingDistance:2cm–400cm/1"‐13ft
Resolution:0.3cm
MeasuringAngle:30degree
TriggerInputPulsewidth:10uS
2.PinInstruction
PinName Description
“Vcc”Power(5V DC)
“Trig”Triggerthetransmitsignal
“Echo”Echothereceivedechosignal
“Gnd Gnd
3.Example
ThisexampleallowsyoudisplaythedefectdistanceonyourARDUIN’sSerialwindow.
Pinconnection:
Vcc==========Power(5VDC)
Trig==========12
Echo==========13
Gnd===========Gnd
Pictureconnectionasbelow:
Examplecode:
*********Codebegin*********
#definetrigPin13
#defineechoPin12
#defineled11
#defineled210
voidsetup(){Serial.begin
(9600);pinMode(trigPin,
OUTPUT);pinMode(echoPin,
INPUT);pinMode(led,
OUTPUT);
pinMode(led2,OUTPUT);
}
voidloop(){
longduration,distance;
digitalWrite(trigPin,LOW);//Addedthisline
delayMicroseconds(2);//Addedthisline
digitalWrite(trigPin,HIGH);
//delayMicroseconds(1000);‐Removedthisline
delayMicroseconds(10);//Addedthisline
digitalWrite(trigPin,LOW);
duration=pulseIn(echoPin,HIGH);
distance=(duration/2)/29.1;
if(distance<4){//ThisiswheretheLEDOn/Offhappens
digitalWrite(led,HIGH);//WhentheRedconditionismet,theGreen
LEDshouldturnoff
digitalWrite(led2,LOW);
}
else{
digitalWrite(led,LOW);
digitalWrite(led2,HIGH);
}
if(distance>=200||distance<=0){
Serial.println("Outofrange");
}
else{
Serial.print(distance);
Serial.println("cm");
}
delay(500);
}
*********Codeend*********
/