On door to my room there is HC-SR04 that triggers led-wave. The shorter the distance, the faster the led-wave (8 leds).
The circuit works fine in synthetic tests – moving hand or flat object towards the sensor generates gradually accelerating wave.
However, when placed on door to detect approaching persons it generates short correct (<=170 cm) impulses and the wave starts and immediately stops, again starts, etc. I guess HC-SR04 isn't good enough to detect people.
Are there any alternatives to this sensor that will correctly detect human approaching?
pulseIn()
with a default 1 second timeout. If there is nothing for the sound to reflect off in range (i.e., a wall within a couple of meters) thepulseIn()
will cause massive delays in your operation.