What do you need to build an Arduino Speed Sensor
How to Build a Speed Sensor using Arduino?

Have you ever wondered how speed guns measure the speed of moving vehicles or how an athlete’s sprint speed is recorded? Normally these speed sensors work with radar or laser technology to bounce back radio waves or IR light from objects and calculate speed based on time taken for the light or wave to reflect. In this article, we will learn how to similar speed sensor using Arduino and IR sensor.
By setting up the two IR sensors at a fixed distance from each other, we can track the time it takes for the object to travel between them. With the recorded time and the known distance between them, we can accurately calculate the object’s speed using a formula.
What makes this project even more interesting is its applicability. Not only we can measure the speed of moving cars or other objects, but we can also utilize this Arduino based speed sensor in scientific experiments to study motion, acceleration, or friction by measuring the speed of different objects in a controlled environments. So let’s get started
Table of Contents
What do you need to build an Arduino Speed Sensor
Building an Arduino speed detector using IR technology to measure the speed of a moving object is much more cost-effective, and it is also very simple to build. All you need are a few basic parts, which are listed below.
-
Arduino UNO R3 development board
-
Two IR Sensors
-
16×2 LCD Display with I2C module.
-
Breadboard
-
Connecting Wires
-
12V Power Adaptor with DC Barrel Jack
These simple components are essential for us to get started on building our own Arduino speed sensor system.
Arduino Speed Detector Circuit Diagram
A simple breadboard based circuit diagram is shown below to help you with making the connections. As you can see the circuit is very simple and only consists of two IR sensors, an Arduino Uno, LCD display and a breadboard.
Also note that, to power this circuit you will need an external 12V power adapter. Because this setup consumes more current, and ordinary PC USB ports can’t deliver it. The power adapter simply has to be connected to Arduino UNO and is not shown in the above circuit diagram.
In the below image, you can see the actual hardware setup developed by using our Arduino sensor circuit diagram as a reference. Here you can see that I am powering this whole setup from the external power adapter through a 12V DC jack. We have also marled the parts to make the connections easy to understand. Also note that we have covered the IR LEDs on the sensor with a black tape to make it point only forward, we will discuss more about that later. If you are completely new to IR sensors and wish to learn more you can check our Arduino IR sensor tutorial, where we have explained the basic working of the IR sensor module and how to use it with Arduino.
You can see our main controller, the “Arduino UNO R3”, is responsible for handling signals from IR sensors and doing some computation to calculate the speed of the object.
Here in the below picture, you can find our 16×2 LCD display unit, where users can able to see the speed of the moving object on it. If you are completely new to 16×2 LCD and wish to learn more about it you can check out our tutorial on Arduino 16×2 LCD display to understand the basic pinout layout and working of the 16×2 LCD display.
The below image shows the bottom view of our display unit, where you can see it uses an I2C IO Expansion module. It means we don’t need to rely on complex parallel communication; we can simply control the display through the I2C serial protocol.
By using this kind of display, we can totally avoid the wiring complexity. This kind of I2C expansion boards for 16×2 LCD display is easily available in any electronics hardware store. It is recommended to use one to make the building processes easy.
How to Place the IR Sensor in the Right Position to Measure Speed
Next we want to ensure that the distance between the two IR sensors is in multiples of 10 or in such a way that the microcontroller does the division operation without any errors. Because in general, the Arduino UNO R3 doesn’t have sophisticated hardware support for floating-point operation. For that, I decided to keep a 10 cm spacing between two IR sensors.
we can also make sure the spacing between the actual IR sensor should be bigger than the actual moving object’s size as shown in the below image. It’s not mandatory, but it helps in making our system work precisely.
In the next section, we are going to see some hardware hacks to overcome the IR sensor false trigger due to environmental factors.
u to learn and build easily