Introduction

Cycling, increasingly popular both as a recreational activity and as a means of transport, has led cyclists to seek technological solutions to optimize their experience. Among these advances, the odometer stands out as an essential tool. This device not only provides accurate data on the cyclist's performance, but also significantly contributes to the safety and efficiency of cycling. The growing demand for odometers reflects the need to solve a series of problems faced by cyclists, ranging from speed monitoring to time and route management.

Speed monitoring is one of the main incentives for using odometers. Knowing the current, average and maximum speed allows cyclists to adjust their pace as needed, whether to improve performance in training or competitions, or to ensure a safer journey in urban environments. Furthermore, time management is crucial, especially for those who use bicycles as a means of daily transportation. With an odometer, cyclists can accurately estimate the time needed to cover certain routes, improving the organization of their routines and commitments.

Another relevant problem is controlling the distance traveled. Cyclists training for competitions need to closely monitor their distances to achieve specific training goals. Finally, the continuous recording of performance data allows a detailed analysis of progress over time, encouraging continuous improvement and motivation of cyclists.

In this article we will show you step by step how to build the electronic circuit of an odometer to calculate average speed, instantaneous speed and distance covered. In addition, we will make the control code available to perform these calculations.

The electronic project is available and you can download all the files and electronic schematics.

Electronic Project Operation

To present the operation of the odometer, we developed the circuit below. The Nokia 5110 display shows the instantaneous speed and distance traveled by the cyclist.

The calculation of instantaneous speed and distance traveled is done using a reed switch sensor and a magnet. This calculation is based on the radius of the bicycle tire and the number of revolutions the tire rotates when the cyclist is moving.

To detect the number of rotations, it is necessary to install the magnet on the bicycle tire. The reed switch must be installed in a region close to the tire to be activated when the magnet passes close to its structure. Below we have a simulation of the magnet movement in the face region of the reed switch sensor. From this simulation it is possible to observe the value of instantaneous speed (km/h) and distance traveled (km).

After all, how does the calculation work to detect the instantaneous speed and distance covered by the cyclist. We will explain this in the next topic.

How to calculate instantaneous speed and distance traveled?

The principle for calculating these two variables is directly related to the radius of the bicycle tire. The radius of the bicycle is the parameter used to first measure the distance traveled. This calculation is carried out when we know the length of the tire.

The length of a circle is defined by:

C = 2*PI*r

The user needs to measure the radius of the bicycle wheel. With this value, it is necessary to enter it into the system. For this, there is a functionality in the code that allows the user to enter and save this information in memory.

From this, the system will calculate the distance traveled and the instantaneous speed.

Calculation of distance traveled

The distance traveled is calculated based on the number of laps that the sensor detects. Therefore, we can take the number of laps from the starting moment and multiply it by the length of the wheel. This way, we can know the distance covered by the cyclist.

Calculation of instantaneous speed

Instantaneous speed is calculated based on the length of the wheel and the time difference between the current full turn and the...

Read more »