The speedometer system is divider into three components
Speedometer Circuit - For detecting the revolution of the wheel.
Speedometer Calculation - The process to determine the speed in MPH.
Speedometer Display on our App - Displaying the information to the rider.
This part of the project was done by me. I created the schematic and PCB designs in KiCAD. The code was done in C++. The PCB would communicate with the Pi reporting when the wheel had 1 revolution, and the code would do the rest. Then the data would be sent to a smartphone via bluetooth for displaying.
Speedometer Circuit
The speedometer circuit is a non-latched hall effect sensor. This means it returns to its original voltage value after a magnet passes. The hall effect sensor I chose is specifically for automotive purposes. It operates at 5V @50mA. Below is an image and how I would position the circuit and the magnet on the wheel itself.
Speedometer Calculation
Below is an image of how I do the conversion. In the latest design, I calculate the speed every 5 revolutions.
One thing that became a problem was false readings in reading the revolution. Very rarely, when the magnet passed the sensor, it would be read twice. The code would then think since there was 2 passes, one revolution completed, and the wrong value would be sent. To solve this, I simply calculated the fastest timing between two readings for 25MPH, which was 92.7ms. Then I checked the timing in the code, if there was any timing faster than that, throw it out.
Speedometer Display on App
Below in the video shows a demonstration of the app. The calculated value of speed gets sent to the app. Then the value updates on the app. The colors go from green to red, where green is 0 and red is 25 MPH.