Measuring speed

In this article we look at using a light-gate to measure speed, if you’ve not already read the article about building a light gate then I suggest you start there first.  A video is also available showing the light gate build and measuring speed:

What is speed?
(Please skip this if you are up to speed with speed!) Speed is, as you might think, how fast something moves. But what does that mean? What makes an athlete who completes a 100m sprint faster than one who comes second? Obviously the winner did the distance in a shorter amount of time.  What if one athlete runs for 250m and another for 273m and they did it in the same time, how do we know which one actually went faster?  It seems obvious it’s the one that went the further distance in that given time. Obviously distance is a very important factor to speed as well as the time travelled. So the equation used to calculate a speed is the distance an object has travelled divided by the time it took to travel the distance and the equation is:

Speed = Distance/time

Why use a Light-Gate?
So in essence all we need to do (if we were measuring someones speed at a sports day for example) would be to start a stop watch when they start running and stop it when the cross the finishing line. We know how far they’ve run (say 100m) and we now know how long it took them, so we can calculate a speed. But there is some inaccuracy to that system due to the human pressing the stopwatch. For a children’s sports day over a 100m it’s probably not that important but if we want to measure objects over a much shorter distance – say a few cm’s – then those human reaction times make accurate results almost impossible. We need something with extremely fast reaction times and able to time to hundreds if not thousands of a second. This is where a Light-Gate comes in. Electronics have a much better reaction time than humans and can count time to incredibly small amounts, perfect for out uses.

Measuring speed – scenario 1 – don’t do it this way!
So we need to start a timer when the object goes past a certain point and stop it when it reaches another. If we know the distance between those two points then we can calculate its speed whilst it travelled from point 1 to point 2. Look at the diagram below:

When the car goes past the first light-gate, cutting the beam, we start a timer. When it cuts the second beam stop the timer. We know the distance between the two gates so we can calculate the speed of the car. BUT we have used two light gates to do this, we can do the exact same speed calculation using just one light gate, read on…

Measuring speed – scenario 2
Look at the diagram below

We have stuck a piece of thin card on top of the car which we know the length of, in this case 5cm. Obviously the card must be the only thing to pass the beam, so the beam must be higher than the car body.  When the card first cuts the beam we start our timer, when the card clears the beam we stop our timer. In that time the car has travelled the length of the card, in this case 5cm. So we know how far it’s travelled and the time it’s done it in, we can calculate a speed. And we did this with only one light gate.

Here’s my set-up from the real world, with the light-gate and car.

The code
The code below will perform the speed calculation for you reporting it back in the serial monitor. Note your card length must be 5cm, if you want anything different then alter the #define at the start of the code to whatever your card length is.

 

Next article
In the next article we will look as calculating acceleration