Arduino Project - Social distance detector

smsebna:
did you see ultrasonic HC-sr04 sensor with 2cm to 400cm range and with 3mm accuracy?
this is enough?
datasheet
arduino project of this sensor

Hi! I'm making a project for a social distancing sensor and this is the link that I'm using. A Device Which Help Us To Maintain Social Distancing | Arduino Project Hub. However, for some reason, the sensor won't stop beeping no matter how far away it is from an object. Is there any way I can fix this? Also, is there a way to track the number of times it beeps internally and can the sensor only sense moving objects/heat instead of everything in front of it?
Thanks!

the sensor won't stop beeping no matter how far away it is from an object.

The sensor operates at 40kHz; I'm surprised you can hear it at all.

TheMemberFormerlyKnownAsAWOL:
The sensor operates at 40kHz; I'm surprised you can hear it at all.

Yes I can definitely hear it. It is very loud. Can you please take a look at the link that I had posted before? I followed the drawing made at the bottom of the site and used that code. However, the 5v buzzer won't stop beeping/being loud. I found the problem. When I go to serial monitor, the distance is always 0. I don't think the sensor is coded right.

The code looks ok.
It could use some formatting, and the style is a little naïve, but it ought to work, I guess.

Edit: it pings too frequently; add a "delay (50);" to the bottom of loop().

Why don't you post your code?

@hello1138

Could you please take a few moments to Learn How To Use The Forum.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.