Final Blog Post – Main Project Completed
Today I have finally finished my main project – The Bike Computer. It required a lot of hard work and I became frustrated many a time, but I completed the project and I am very proud of it. I usually work on big projects with a team, mainly on mechanical building, so this project provided me with a good experience in computer science, electrical engineering and working by myself (of course with some help from the instructors).
I began the main project not knowing much about coding or electronics because I came into the program only knowing how to build things. So I chose a project that would challenge me to the fullest, which was a project centered around coding and electronics.
Now I will explain how the Bike Computer works. I began by first making sure I had all my parts. Once I got that done, I began to work. I was going to use an Altoids tin to hold the complete module, but then I realized that it would not be big enough to hold it. I am going to create my own case using AutoCad and have it either 3D printed or laser cut out of a strong material.
During the project I ran into some hiccups with soldering and wiring. I also ran into problems with my Arduino. I found shorts in many places which allowed me to learn about heat shrink and tinning wires. I also burnt the pin headers while trying to solder wires to the Arduino. Other problems I had included problems with the Arduino itself. Sometimes it wouldn’t upload code or would bring up errors in the code even though there were no errors. So, I did run into a couple of problems that held me back. One thing I learned from running into these mechanical problems is that most of the smallest mistakes end up requiring the largest solutions.
The hardest part of the project was coding. Another thing I learned from the project is that coding is hard. I came into the program not knowing any code at all. When moving through the project, I thought that code that I found online would be easy to use and I could just upload it to the Arduino and be done with it. That was not the case. I ran into many errors with code that I found online and it took me much time to configure and modify the code to my own needs. It took most of my time – about two – three weeks of the six week program. But it was a great experience. Going through the trouble of learning many different coding functions and errors and how to debug has greatly increased my support of computer science as a necessary skill and my interest has also greatly increased.
Here is a brief but thorough description of how the Bike Computer works. Basically, there is a Reed switch (a switch that turns On or Off by sensing magnetic pulses) that senses if a magnetic pulse is present or not and based on what it senses, opens or closes an electronic circuit. The pulse is processed in the code that I uploaded to the Arduino and is displayed on an LCD screen as a speed with a bar graph. The great thing about it is that you can modify the code to display whatever you want on the LCD, such as mileage, instead of speed. By using an Xbee module that is connected to the Arduino, the information processed by the Arduino is used to create an information page that plots your speed in relation to a target speed, time since a magnetic pulse was sensed and your ride distance.
This was a great project to work on. Through it, I have become greatly interested in this field of engineering. I have met other great and intelligent students like myself and the instructors were awesome as well. They didn’t give solutions to you, but they helped just enough to jump start you. I am proud to say that I spent my summer in the BSE 2013 program.
Code (Arduino and Processing):
Third Milestone Complete: Displaying Speed and Bar Graph
Hello, it’s Darrin again. I have completed my third milestone, which is being able to display speed and a bar graph representing that speed on an LCD. This is a pretty large milestone because it’s a marker of how close I am to completing my project. In order to complete this milestone, it was necessary to complete two important steps of my build plan. The first step was to install the reed switch and to make sure that it was functioning properly. I installed it securely by soldering it together with two other wires coming from the Xbee module and Arduino. Then I put the other end of the switch into the A-Zero pin of the Arduino. I used a magnet to see if the switch would read the magnetic pulse coming from the magnet and send the information to the Arduino and display the speed on the LCD. It worked. The next step was to have the Arduino pick up new pulses from the switch quicker to make the speed that would be displaying more accurate. I was able to do that by reformatting the code to do what I needed. It took a long time and it was hard, but I accomplished this feat.
Second Milestone Complete: Wiring and Connecting LCD
I completed the second milestone of my main project. The milestone that I completed today is wiring and connecting the LCD display to the Arduino Uno module. This took a little while and I actually had to debug the system for about two days. When I first started, I had to solder a lot and strip wires which seemed like it was going to be very easy. I actually ended up fraying some wires, which was the beginning of my problems. By fraying the wires though, I picked up some more tricks and tips that had solutions to help me. I learned about ‘tinning’ wires and also about heat shrink. Tinning is a very important method of preventing wires from fraying, which I found out afterwards. I didn’t prevent the fraying, but I was able to palliate some of the damage. The next issue I had was installing these wires that were somewhat already frayed and had solder all over them because of the tinning. It did not go so well. I ended up burning/melting the plastic off some of the pin headers. After I installed all the wires, I realized some of the connections were loose. So I decided to heat the soldered pins which burned them even more and resulted in solder becoming stuck inside the pins. It was a mess. besides that, some of the wires that I was using were messed up and I had to clean up all the connections. It was just a huge mess. But the display works correctly now after I switched out my Arduino board for another, correctly wired the LCD to the Arduino and ran the code. I used a test code to run onto the Arduino and the LCD. The code was simply, in layman’s terms, a couple of lines that stated that when the Arduino turns on, the LCD will setup the number of rows and columns. Then it will print “Hello World”. Next it will reset the cursor and print “How are you?” Alongside this question, the LCD will display the number of seconds since the last time the Arduino has been reset.
My second milestone video:
Milestone Completed: Coding and Installing Arduino
As part of my project, I developed milestones that would provide me with a measure of my progress while working on the project. My first milestone was to finish coding and installing the Arduino Uno device into the Altoids tin that holds it. I faced many difficulties in completing this milestone for many different reasons. Such difficulties I faced were not being able to finish push wire through a PVC tube, which seems pretty simple, but it took a little while. There were some materials that I thought I lost or didn’t have and then found out that I did. Then there were instances where I was actually missing materials. The greatest challenge of all, though, was coding the Arduino. I downloaded the code online and I thought that there would be no trouble in compiling it and uploading it to the Arduino. But there were many errors that I had to debug, which is where the real challenge was. Up to that point, I had been interested in learning how to code, but never have. So, in order to debug the code, I had to sit down, research different errors online, watch videos on Youtube, and learn the some of the basics of the Arduino code. The debugging process took about three or four days, but I finally accomplished my milestone.
My first milestone video:
Starter Project Challenges
Hello, my name is Darrin. My starter project in the 2013 BlueStamp program was to build a ultrasonic sensor. This sensor would detect objects between 5 cm and 150 cm and by sending out ultrasonic waves which, if they hit anything within the 145 cm, would return to the sensors. If the sensors receive the returning waves, a speaker would be set off that would let you know if something was behind you (the point of the device was to be installed on a car). Unfortunately, after completing the hardware build, the device was not functioning to its full capacity. The speaker was going off, but sporadically and was not completely ensuring that the sensors were actually sensing anything. I began to start to debug the device. The debugging process went on for about three or four days. It still continued to not function properly, so I decided to leave it until near the end of the project and make progress on my main project.
If you would like to try and complete the project yourself, the link to the kit is available here: