Aj Sr04m Datasheet [repack] -

def get_distance(): GPIO.output(TRIG, False) time.sleep(0.05) GPIO.output(TRIG, True) time.sleep(0.00001) GPIO.output(TRIG, False)

delay(60);

| Pin | Name | Function | |-----|------|-----------| | 1 | VCC | +5V DC (regulated) | | 2 | Trig | Trigger input (active high, 10 µs min pulse) | | 3 | Echo | Echo output (PWM width = time of flight) | | 4 | GND | Ground | aj sr04m datasheet

long duration = pulseIn(ECHO, HIGH, 30000); // timeout 30ms (≈5m) if (duration == 0) Serial.println("Out of range"); else float distance = duration / 58.3; Serial.print("Distance: "); Serial.print(distance); Serial.println(" cm"); def get_distance(): GPIO

1. Overview & Key Differentiators The AJ-SR04M is an improved, industrial-grade variant of the popular HC-SR04. Unlike the standard HC-SR04, this module is enclosed in a waterproof, IP67-rated housing , making it suitable for outdoor, dusty, or humid environments (e.g., tank level sensing, outdoor robotics, car reverse sensors). void loop() digitalWrite(TRIG

void loop() digitalWrite(TRIG, LOW); delayMicroseconds(2); digitalWrite(TRIG, HIGH); delayMicroseconds(10); digitalWrite(TRIG, LOW);