Analog Speedometer Using Arduino And Ir Sensor

Photo of hIOTron

Made by hIOTron / Security / IoT

About the project

The project describes an analog speedometer where we have used IR Sensor to calculate speed.

Project info

Difficulty: Moderate

Platforms: Arduino

Estimated time: 1 hour

License: GNU Lesser General Public License version 3 or later (LGPL3+)

Items used in this project

Hardware components

Standard LCD 16x2 white on blue Standard LCD 16x2 white on blue x 1
Arduino Uno Arduino Uno x 1
stepper Motor, Bipolar stepper Motor, Bipolar x 1
L298n Motor driver L298n Motor driver x 1
IR sensor IR sensor x 1
Resister 2.2k ohm Resister 2.2k ohm x 1
Connecting wires Connecting wires x 1
Power Supply Power Supply x 1

View all

Software apps and online services

Arduino IDE Arduino IDE

Story

About Project

Here we have used IR Sensor which can recognize the presence of an object in front of it. We have also utilized two-blade rotors and put the IR sensor near it in a way that when the blades rotate every time the IR sensor recognizes it. We employ the support of timers and Interrupts in Arduino to estimate the time taken for one entire rotation of the motor. Here it is a two-blade rotor, which means the function will be ordered 4 times in one revolution.

We can measure the RPM by utilizing the formulae, Where 1000/time taken will give us the RPS and multiplying it with 60 will give us the RPM.

rpm = (60/2)*(1000/(millis() - time))*REV/bladesInFan;

From this we get RPM then speed can be estimated by below formula:

Speed = rpm * (2 * Pi * radius) / 1000

Before putting the values, we need to convert radius from inches to meters

radius = ((radius * 2.54)/100.0) meters

Speed= rpm * 60.0 * (2.0 * 3.14 * radius)/ 1000.0) in kilometers per hour

Here we have worked with a 4 wire bipolar stepper motor for analog meter, which is having 200 steps per revolution.

Now we need to show 280 Kmh on the speedometer. For this stepper motor requires to move 280 degree

Here we have maxSpeed = 280 so the steps will be,

maxSteps = 280/1.8 = 155 steps

In the Arduino code, a map function is used to map speed into steps.

Steps = map(speed,0,maxSpeed,0,maxSteps);

After counting steps we can easily apply these steps in stepper motor function to drive a stepper motor.

Here Internet of Things Course Training will give a thorough view of such IoT Projects with its practical implementation.

Code

Run a program

Credits

Leave your feedback...