Aj Sr04m Datasheet ((hot)) -

For tank level sensing, ensure no obstructions inside the beam cone. For obstacle avoidance, mount multiple sensors to cover blind spots. 6. Temperature Compensation & Accuracy The datasheet specifies ±1% accuracy at 20°C. However, sound speed changes with temperature:

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"); aj sr04m datasheet

while GPIO.input(ECHO) == 0: pulse_start = time.time() while GPIO.input(ECHO) == 1: pulse_end = time.time() For tank level sensing, ensure no obstructions inside

AJ-SR04M is the best all-rounder for outdoor/wet applications needing short-range detection (2 cm blind zone). JSN-SR04T has longer range but larger blind zone (20 cm). HC-SR04 is indoor only. 10. Application Circuit & Code Examples 10.1 Arduino (Standard) #define TRIG 9 #define ECHO 10 void setup() Serial.begin(9600); pinMode(TRIG, OUTPUT); pinMode(ECHO, INPUT); HC-SR04 is indoor only

Porównaj oferty