I love riding my bike , and i also like to be all the time up to date with the details of my, but unfortunatley, most of the bicycle monitors comercially avable are not customisable.
On this project i try to make a a bibycle monitor based on the nRF5340-DK
The code from the github repo from below is based on this example code
Measuring The SpeedThere are a lot of methods of mesuring the speed like: with the help of a GPS or with the help of an accelerometer, but a simpler and cheaper idea is to use a reed switch and a magnet and measure how manny times the RPM of the front wheel.
In this project i chosed the last idea. As shown in the schematics, one side of the reed switch will be conected to GND and another to the P0.23 pin of the DK. On this photo you have an example how you can mont the reed sensor and the magnet (the magnet is mounted on one spoke of the front wheel )
Also , to have good results, you will need to measure your wheel's perimeter (in mm) and write it instead of the default 2325 value (#define WHEEL_PERIMETER 2325 //in mm
line 18 of code from gui.c file)
The gui is verry simple, and it consists of 6 tiles where you can see data (current speed, travled distance , the timer , the last lap time , the angle and bluetooth conection status), and 4 buttons (reset distance, reset time, start and lap) to interract with the device.
Functions of the data tiles and buttons:
-Current speed tile: displays the current speed calculated from the number of impulses recived from the Reed switch
-Traveled distance tile: displays the distance traveled since the last press of the "Reset D" (reset distance) button
-Timer tile: Its just a timer to keep track of your times,you can interact with it with the "Reset T" (reset time, it just resets the timer value) button, "Start" button (it starts the timer) or the "Lap" button (it resets the timer and moves the value to the last lap time tile)
-Angle Tile : it should get the angle value from the accelerometer of the smartphone
-Bluetooth status tile : It should show the bluetooth status with the smartphone ("--", "Ititialised", "Connected", "Sending data", "Reciving data" or "Disconected")
If there are no problems , when you start the DK , the leds should flash in this order LED1>LED2>LED4>LED3
Little demo:Thinks to do:
Since there are not many examples for this DK , i couldnt implemet the bluetooth feature, but when there will be more examples avable, ill implement it
Comments
Please log in or sign up to comment.