Bike Odometer & Speedometer – Code

We wrote code for the project for both the Atmel Xplained board in Atmel Studio and an Arduino Uno (has the same processor as the Xplained Board). Originally, the Arduino was used just for proof-of-concept testing and for a user friendly testing platform to iron out any unforeseen kinks with the program flow or mathematical computations. Once that was completed, development switched to Atmel Xplained board. The end functionality of the code written for both boards is fairly comparable except for the speedometer module. A critical component to the speed calculation is the elapsed time between the voltage drops of the Hall effect sensor. For the Arduino Uno this was no problem as an external clock source separate from the Atmega 328p is integrated into the board. In addition to build in functions that make interfacing with the clock extremely easy. On the other hand, the Atmel Xplained board has no external clock source. So all timing had to be done utilizing timers based off the CPU clock speed. Overall, this created a more complex piece of code with worse functionality.

 

Bike Odometer and Speedometer – Schematic

For the Hardware portion of the prototype, we used a variety of objects.The largest of these was a standard bicycle that we used as a base for the odometer and the speedometer to sit upon. Next we used two breadboards to start, however this was later slimed to one breadboard to hold the wiring and transistors for the project. We also used an ATMEGA328P Xplained mini board to process the inputs and outputs we needed for the project. Miscellaneous electrical components include some resistors, wires, potentiometer, an LED display and a capacitor. The most unique component used would be the Hall effect sensor, which is in layman’s term a magnet sensor. As a magnetic field gets in range of the sensor, the total output voltage of the Hall effect will be changed due to the strength of said field.

Image

 

Image

Bike Odometer & Speedometer- Big Picture

The chosen task by Team 14 was to create a bicycle odometer & speedometer for use in everyday life. This would allow the hard working men and women of America to stop getting into accidents while calculating the velocity they are traveling with rate and distance. This could potentially save many lives and it is the honor of Team 14 to do this great work. Team 14 hoped that by creating this project, they would learn more about real world applications for the material learnt in the class. The project was performed by first creating the code for the odometer and speedometer, and next was the task of creating a stable mount for attaching the components to the bicycle itself. Lastly was field testing to guarantee it works. The equipment used by Team 14 for the project includes: A bicycle, an ATMEGA328P Xplained Mini, a Hall effect sensor, an LCD display, as well as a few miscellaneous electrical components such as resistors.

Image

 

Image