Final Project: Bike Computer

Idea

My project is to build a smart bike handle. One thing I enjoy in life is taking my bike for aimless rides, explore hidden parts of the city, take picture there and document my route. One problem I always face is my phone running out of battery. Running Strava, which I use to track my route, uses location, mobile data which are the most extensive things in term of power. On another side, I always wanted to make a drop handle. Using the handle will allow me to use the hollow space to store the electronics and make my design seamless.

The purpose of this project is to build a first iteration of this. This will be part of a bigger quest as I am building my own bike during IAP.

Previous Designs

There is only one smart handle option in the market, which are the Helios Bars . While I understand why since you can attach a bike computer to any bike handle, I appreciate seamless designs that integrate things inside them. For the scope of this project, I am only making the bike computer. While there exist many computers out there, I wanted something simple and cheap. I wanted to simply control the functionalities in my bike, record GPX files and send my rides to Strava. Most computer bikes are more complicated or much simpler, with no balance in between.

Schematic of the big picture

Here are the functionalities that I want to implement. For this project, I focused on programming and making the front panel, while I had side quests for the making the handlebar, the heater, the back panel.

Questions that I am interested in

UI: How would someone use it?

Summary of what has been accomplished

Front panel

I was able to get the GPS and the SD card integrated to create GPX files. I created a menu for the user. I got the acccelerometer and hall sensor to work. To have better readings, the hall sensor needs to be replaced with a more sensitive one. The accelerometer should be replaced with IMU to use the gyroscope and have a more accurate magnitude of the accelration vector. The module connect to wifi to setup Strava connection, however, the https requests while being implemented successfully on POSTMAN, it had some diffculties on Arduino due to some certificaiton issues.

Back Panel

The circuit is designed in Fusion 360

Handle Bar Fabrication

I learned how to bend tubes using a pipe bender, designed the CAD around the existing tools avaliable diameter. I designed the flat sheet cut for it to be cut in FabCreator.

BOM

No components were purchased specifically for this project. All parts existed in lab. Thus, the cost of this project is zero. I have included the parts for the components that has not been implemented to use this page as a bigger reference

Electronics

Materials

Project Sections

Electronics and Board Designs

Main Board

Files

schematic
pcb

Final Board looks like the picture below. While designing it, I tried my best to fit all the wiring and headers in a small footprint. Thus, I went through multiple of iterations until I reached this design. I decided to make the sensors facing the board, so it protects the board from any mild external damage. One thing I could have improved on why with to put the sensors on the back, not necessarily with a double-sided board, but created a thorough header on the other side. Another point to improve is to use terminal screw connector for the screen, to avoid using jumpers and their large bending radius.

First Board

Final Board

Button Signal/Control Panel

Files

pcb

Initially, I thought of keeping one board for both signals and control buttons. Eventually, I divided them to do to have the freedom into placing them in different places.

first board

Accelerometer

For this measurements, I assumed that the ground is always flat as I don't have a gyroscope to fix the acceleration vector measurements. One thing I will add is replacing this with an IMU unit system, to have more accurate data. More details are in week8

Files

schematic
pcb

SD Card and GPS

As I wanted to save the routes of the user, I checked the size of GPX files, which is one of the formats Strava accept and it is commonly used. Comparing the size with the available memory in Pico W, I realized I have to use an SD card. Since I am getting the GPS data at relatively low frequency, I decided to immediately write to the SD card every time we get a measurement point to avoid crashing the memory of the pico W. More details are in week9

Files

schematic
pcb

Hall Sensor

The hall sensor uses ADC pin. Testing the hall sensor on the bike showed that the sensitivity of the hall sensor was not as strong, thus, I needed to use a stronger sensor or oversampling the signal to see the different in the signal. This will be fixed in the project.

Light Board (Not fully implemented)

This board is connected to the front signal buttons. The goal is to be able to signal to the cars without using the hands. Also, a ESP32 CAM is used in this board as I wanted to take picture or time-lapse while riding. For this board, I was able to create and partially populate. However, I was not able to fully integrate with the main project.

Physical Design

Case

Files

The design of this case was to demo the functionality. I wanted to build as small of a box where I can protect the circuit. The top has an opening for two screens along with some buttons. The back has an opening for the wires to come through.

Hall sensor housing

Files

I needed a stable strong housing to connect the sensor and magnet to the bike. For this part, I used TPU for it to absorb some shocks from the road and make the components more stable. In this design, I used clamping force along with the rubbery trait of TPU to hold the components in place without it sliding. This part was tested as I biked without them sliding or falling.

Buttons

Cables

One of the main lessons I learned is to take wires radius and profiles into account. As I was designing the housing, I didn't take the header length, the wire bending radius into account while I was making it as small as possible. This, the top did not close because of that. The quickest fix was to print an extended wall and super-glue it to the housing which was strong and held together well. Here, I encountered a problem that exists a lot in industry, along with connection and cable vibrations. In the next iteration, I will balance between screw terminals, headers, and soldering better so the cable connections can withstand the vibrations of the road.

Handle Bar

Files

Designing the handle bar was interesting, as there are multiple of aspects to take into consideration. First, I needed to know why bending radii are available for what tube diameters and design my CAD around the tool. Once that has been done, I have flattened my tube shape with the needed cuts and added some engraving to guide me when bending. This flattened shape was exported as DXF file to use it in FabLight. I used FabCreator to adjust the setting for tube cutting, then went to fablight device for cutting. Right before cutting, we realized that the dimension of the Fusion 360 exported files is distorted. As we were running out of time, I decided to make this housing as the next stage of my project.

Programming

State Machine

Headers Organization

Files

Pico W Common Connection Problems

Starting with Pico W, I had to get used to the problems with its connection and bootloading it a lot at the beginning. Example of the errors I get

Right before testing the menu code to add a user interface in the arduino for the user to use, my pico stopped responding.

Reflections

Since this is part of a bigger project, I evaluated this project based on how many functionalities and I can incorperate and how many pathways I can explore. I think I explored a good amount of aspects of this project while still focusing on making something functional. One mistake is though I tried my best to make my project modular, I was distributing my attention on the difficult tasks before building the basic UI or the foundation, and kept it last. Thus, unfortunately my project broke before I was able to shoe the full funcitonality.

Would you like to get in touch?

Email me!