Go Down

### Topic: Distance Sensor moving objects (max speed object will pass sensor is 40km) (Read 175 times)previous topic - next topic

#### COZZI67

Hi

Iá¸¿ having trouble making my HC-SR04 sensor detect moving objects. Basically, it works fine if the object is moving away or towards the ultrasound but It cant read objects passing in front of the sensors at speed. I.E. If the object is moving from A (transmitter) to B (Receiver) at speed it doesn't have time to detect it...am I doing something wrong or do I need to look at different types of sensors

------
B   |
------

------
A   |
------

thanks

#### jremington

#1
##### Aug 16, 2019, 05:41 pmLast Edit: Aug 16, 2019, 05:42 pm by jremington
Not enough information to even guess.

Post the code, using code tags.
What sort  of objects?
What is the minimum distance from the moving object to the sensor?

#### COZZI67

#2
##### Aug 16, 2019, 05:50 pmLast Edit: Aug 16, 2019, 06:02 pm by COZZI67
newbie snoob so forgive my lack of detail

i downloaded a generic code that shows distance in cm when an object is placed in front of the sensor from about 2cm to 50cm ... it works fine ... however, if i make the object move at speed thru the sensors I get nothing ... the object is a ball about 15cm wide, i just wanted to know if it was possible to detect the distance of an object if it passes in front of the HC-SR04 sensor at speed. The min distance the ball will pass 15cm and the max is just over a metre ...

#### zwieblum

You'll need to do some maths for yourself: measure the time the sensor uses to detect a not-moving object. This is the minimum time the object has to keep in range of the sensor. Now you can calculate the maximum speed for an object with a given diameter.

#### jremington

Quote
i downloaded a generic code that shows distance in cm when an object is placed in front of the sensor from about 2cm to 50cm
But you can't figure out how to post it? See the "How to use this forum" post.

#### COZZI67

But you can't figure out how to post it? See the "How to use this forum" post.
didn't post as its a very simple piece of code, even a snoop like me can figure it out so I didn't want to burden people like you with minor details ...  but thanks for sarcasm  ... my post was more about the sensors themselves, are they reliable enough to measure distance when an object is moving at speed.

#### jremington

Quote
are they reliable enough to measure distance when an object is moving at speed
In general, yes, if used correctly.

Go Up