# I need help for measuring a speed of an object

#### sareehy

Joined Mar 11, 2017
9
Hi,

I want to design a circuit for measuring a speed of an object .

My approach is to use two IR sensors and the distance between them is fixed .
once the object passes the first sensor the time starts counting and when it passes the second sensor the time stops counting, the speed measured by speed=distance/time.

I can make this circuit using microcontroller easily but i need to build the circuit without using microcontrolles ?

Any help ?

#### EM Fields

Joined Jun 8, 2016
583
Hi,

I want to design a circuit for measuring a speed of an object .

My approach is to use two IR sensors and the distance between them is fixed .
once the object passes the first sensor the time starts counting and when it passes the second sensor the time stops counting, the speed measured by speed=distance/time.

I can make this circuit using microcontroller easily but i need to build the circuit without using microcontrolles ?

Any help ?

Use the first IR sensor's output to clear and enable a hardware counter, and the second sensor's output to disable the counter and freeze its output state.
that way, since you know the counter clock's period, the number of periods accumulated, and the distance between START and STOP, the known distance divided by the known time will give you the speed of the oject.

1. How far apart will the two sensors be ?
2. What are the minimum and maximum speeds you want to measure?
3. What kind accuracy are you looking for?
4. Do you need a schematic?

Last edited:

#### AnalogKid

Joined Aug 1, 2013
10,222
1. Is this homework?
2. What is the object?

ak

#### sareehy

Joined Mar 11, 2017
9
Use the first IR sensor's output to clear and enable a hardware counter, and the second sensor's output to disable the counter and freeze its output state.
that way, since you know the counter clock's period, the number of periods accumulated, and the distance between START and STOP, the known distance divided by the known time will give you the speed of the oject.

1. How far apart will the two sensors be ?
2. What are the minimum and maximum speeds you want to measure?
3. What kind accuracy are you looking for?
4. Do you need a schematic?

Hi EM fields

1- 50 cm
2-say 1 cm/s - 100 cm/s
3-I don't know what the kinds of accuracy but i need a circuit to do what i need to demonstrate it in the lab
4-yes

1. Is this homework?
2. What is the object?

ak
Hi AnalogKid

1-small project for instrumentation lab
2- my doctor didn't determine any thing .
only he want a system counts an object numbers and measure its speed

regards

#### wayneh

Joined Sep 9, 2010
17,201
There are lab timers that accept an external trigger for start and stop. Using that would spare a lot of work in building a clock, a display and so on.

It sounds like you need to also counter the objects going by? I see this like the assembly line scenario - you need to show the total count and the speed of the last item counted. So both displays need to update when each object passes. Sound right?

#### Dodgydave

Joined Jun 22, 2012
10,685
Without a microcontroller you're counting Time taken, in milliseconds or microseconds, so you're looking at clocking a counter with a 1Khz clock this will give you time in milliseconds, your sensors are the start and stop for the counter.
For more accuracy use a 10Khz or 1Mhz clock.

#### AnalogKid

Joined Aug 1, 2013
10,222
Measuring and displaying the time between two sensor signals is pretty simple, and there are many single-chip examples on the web. Inverting that data to show the velocity is an entirely different problem, and difficult to do without a microcontroller (or just purchasing an industrial device that does it). The problem is that as the time increases linearly, the velocity decreases exponentially. All-hardware numeric inversion is hard. Are you sure a velocity display is required?

ak

#### sareehy

Joined Mar 11, 2017
9
There are lab timers that accept an external trigger for start and stop. Using that would spare a lot of work in building a clock, a display and so on.

It sounds like you need to also counter the objects going by? I see this like the assembly line scenario - you need to show the total count and the speed of the last item counted. So both displays need to update when each object passes. Sound right?

yes ^^

Without a microcontroller you're counting Time taken, in milliseconds or microseconds, so you're looking at clocking a counter with a 1Khz clock this will give you time in milliseconds, your sensors are the start and stop for the counter.
For more accuracy use a 10Khz or 1Mhz clock.
thanks a lot for your help

Measuring and displaying the time between two sensor signals is pretty simple, and there are many single-chip examples on the web. Inverting that data to show the velocity is an entirely different problem, and difficult to do without a microcontroller (or just purchasing an industrial device that does it). The problem is that as the time increases linearly, the velocity decreases exponentially. All-hardware numeric inversion is hard. Are you sure a velocity display is required?

ak
my doctor needs to measure the speed

tomorrow i will see if he can ignore the speed display and display the time instead of it

#### sareehy

Joined Mar 11, 2017
9

thanks a lot for your comment

#### EM Fields

Joined Jun 8, 2016
583
Hi EM fields

1- 50 cm
2-say 1 cm/s - 100 cm/s
3-I don't know what the kinds of accuracy but i need a circuit to do what i need to demonstrate it in the lab
4-yes
Here's the schematic:

Do you need a circuit description?

#### sareehy

Joined Mar 11, 2017
9
Here's the schematic:
View attachment 122262
Do you need a circuit description?

I will be grateful to you if you give me the description
and how can display the value on 7-segments

regards

#### EM Fields

Joined Jun 8, 2016
583

I will be grateful to you if you give me the description
and how can display the value on 7-segments

regards
And what do I get in return?

#### wayneh

Joined Sep 9, 2010
17,201
And what do I get in return?
A warm fuzzy, just like in your avatar!

#### EM Fields

Joined Jun 8, 2016
583
A warm fuzzy, just like in your avatar!
So far , That warm and fuzzy feeling is for the kitties who like my music.

#### hp1729

Joined Nov 23, 2015
2,304
Hi,

I want to design a circuit for measuring a speed of an object .

My approach is to use two IR sensors and the distance between them is fixed .
once the object passes the first sensor the time starts counting and when it passes the second sensor the time stops counting, the speed measured by speed=distance/time.

I can make this circuit using microcontroller easily but i need to build the circuit without using microcontrolles ?

Any help ?

Measure the time and create a chart relating time to feet per second.

#### EM Fields

Joined Jun 8, 2016
583

I will be grateful to you if you give me the description
and how can display the value on 7-segments

regards
CIRCUIT DESCRIPTION:
V2 and V3 are beam-break IR detectors and are assumed to output a low when the moving object traverses their field of view and breaks the beam. R1 and R2 are pullups to +5V and are needed if the detectors have open-collector outputs.

At the beginning of a run, STOP\ will be high and START\ will go low, forcing the output of U1B, (INHCP\) high. V4 is a free-running clock, (CLK) and when INHCP goes high, That high will enable CLK to pass through U1C and U1D and become GCLK, the clock input to U2, a 12 bit binary ripple counter.
INHCP\ is also differentiated by C3R4, which produces a short, high-going spike (START) which resets U2 when it goes high and enables U2 to start counting GCLKs when it decays.

U2 will then count GCLKs continuously until STOP\ goes low. When that happens, INHCP will be latched low, which will force GCLK low and freeze U2's outputs.

Now, knowing the period of GCLK and the number of GCLKs accumulated by U2, the time between the leading edges of START\ and STOP\ can be determined and, knowing the distance the moving object traveled during that time, its average speed can be calculated.

In order to display the number of GCLKs accumulated between START\ and STOP\, using seven-segment displays, the easiest way I know of is that instead of using binary counter(s), one would use a chain of BCD counters (74HC4510s for example) and BCD to 7-segment decoder-drivers like 74HC4511s, like this:

EMF

Last edited:

#### AnalogKid

Joined Aug 1, 2013
10,222
The part in post #7 is perfect for your application. It has two-sensor period gating logic built in, all digit driving and multiplexing built-in, and can display 1 microsecond resolution in a 100 second time interval. Read the Time Interval section on page 9. A conceptual schematic is on page 14.

If your requirement is to design an equivalent system from scratch, then this chip does many more things than you need. It can be used as a starting point for a discrete design, but there are more simple ways to go.

ak

#### BR-549

Joined Sep 22, 2013
4,928
Give him 2 - 10 velocities.
Think Yuge. Mount 3 or 4 or 10 sensors and plot acceleration.
An A+ in lab looks good.