Mountain Bike Data Logger




​
Reason for Project
​
Continuing on from my STM32F4 Library, as part of my quest to learn embedded software, I wanted to apply my skills to a real world project and get experience writing application level code. It was important to me that the project I chose cover a range of embedded topics but also be something I could use in my everyday life. As a result I chose to make a data logging system for my mountain bike.
​
The general idea is I could collect information from my bike and use that to gain a better understanding of how I ride and my bike setup. From a software perspective I could learn how to handle large amounts of data, manage and schedule tasks, and interface with a user. From a mountain biking perspective I could observe how my suspension is behaving and how I'm using the bike. Recording and analyzing data is not necessarily needed to understand how to set up a bike, however I went with this method for the sake of learning new skills.
​
My goal for this project was to simply collect data from my bike as opposed to collecting data then doing an in-depth analysis of it. Doing analysis would help to make sense of the data but I felt that would take time away from my over-arching objective of learning embedded software development. Using the raw data and some basic interpretation I would still be able to observe the following:
-
Geographical location
-
Ground speed
-
Suspension position
-
Bike orientation
​
However, if a proper analysis was to be done, a list of some things that could be determined include:
-
Dynamic sag - average suspension position while riding.
-
Bike balance - front vs rear axle compression distance and rate.
-
Grade - how steep the trail is.
-
Time spent not in contact with the ground
-
Impact force - how hard the bike makes contact with various obstacles.
​
Design and Build
​
The data logger was designed to fit entirely on my bike and be as non-invasive as possible. The system consists of a main enclosure mounted where the water bottle normally goes, user controls placed on the handle bars, and sensors placed at different points on the bike. The main enclosure houses an STM32F4, GPS, IMU, SD card, screen, Bluetooth module, and one 12V 1500 mAh battery along with some power distribution and circuit protection. The user controls consist of buttons to navigate the system and LEDs for visual feedback. Rotary potentiometers are mounted in such as way to determine the front and rear suspension position/travel and a Hall Effect sensor is mounted to the fork to record wheel RPM. All sensors are wired back to the main enclosure.
​
While riding, the bike moves quickly to accommodate changing terrain. This means that to properly capture the bikes movement, data must be collected at a high frequency. It must also be captured at known intervals to understand how the data changes in time. The system software is designed to collect and record raw sensor data on a predefined schedule. Due to the high volume of data and speed at which data is recorded, any interpretation is left for post processing. Using this collection method and the setup described above, the system is able to record suspension position, wheel speed, geographical location, bike orientation, acceleration, and points of interest on the trail (input via user controls). For each data logging session, a log file is created on the SD card where all data gets compiled and stored for use later. System information such as suspension compression and damping setting are saved internally and get included along with each log file to provide context for a data set. Using the onboard Bluetooth module, the system can connect to an external device to update system information and offload data logs. The user is able to navigate all these actions using the buttons as input and the screen and LEDs for feedback.
​
Rides
​
Due the rough nature of mountain biking, I was worried that I'd have issues with parts moving around or potentially getting damaged while riding. I made sure this wouldn't happen by testing the system in increasingly more stressful situation until I was confidently riding with it on intermediate trials. So far the system has worked really well, but due to it's size and weight I'm hesitant to push it to the extreme. I believe I would need to make the whole system smaller and lighter to be able to withstand any situation I could throw at it.
​
Next Steps
​
This project is in the process of being completed. The build of the main enclosure and user controls is done and data logging is fully functional, however mounts for sensors to record suspension position and wheel speed are still being designed. In addition, as mentioned earlier, no work has been invested into analyzing the data in detail as this was not the main goal of the project.