Inspiration

Biking is an incredibly underutilized form of transportation across Canadian universities and colleges. University students need to regularly travel short distances across campus quickly which suits the ideal use case for a bike. However, rampant bike theft across university campuses hinder the adoption of bicycles as a more frequent mode of transportation. Bike locks are very susceptible to lock pickers as manufacturers must balance the cost and inconvenience of higher security with the effectiveness of the product. Also, bike sharing programs revolve around a hub to always return the bike and is accessible to the entire public which reduces individual incentive to maintain its condition. The solution is loc8r, a decentralized bike sharing and tracking Android Application.

What it does

This project is broken into five distinct parts; the charging circuit, the Arduino-based module, the server side application, a Firebase project, and a client side application.

Our project relies on an Arduino with a GPS module and a SIM module. The 66-channel GPS module can track the bike to within less than 3 metres. The module then communicates the exact coordinates to the Arduino, which uses the SIM module to SMS the coordinates to our server. The server is an Android phone running an app we developed which could be scaled. The unique identifier is a phone number associated with the SIM card in the bike.

The server side application receives the GPS data in the form of at latitude and longitude pair. The phone number is a unique identifier which is contained as the sender of the SMS message. The server parses the latitude and longitude into a double data type and sends them to Firebase with the phone number and a timestamp of when it was sent.

The Firebase project stores a list of users with the unique phone number acting as the key for each individual user object. The user object itself has a list of timestamps and the latitude and longitude doubles as children.

The client side is an android application that presents a view for the user. The user is allowed to log into the application with their google account. This google account can be used for future improvements to sharing the bike identifier with select people and enable bike sharing. After logging in, if the user has no bike ID linked to their phone, the application will prompt them to link the bike to the phone by typing in the phone number associated to the arduino component of the bike. Once linked, the client saves the phone number in Firebase and links it to the google account. The client then pulls the latitude and longitude values from the Firebase database and sends it to a Google Maps Activity. This activity displays a red point which shows the location of the bike within the last 5 minutes, the intervals between pings from the arduino.

How we built it

Our final design uses a stepper motor-based charging circuit. A stepper motor attaches to the bicycle chain using a sprocket, and hence rotates while the bike is moving. The 5 wires of the motor are then run through a diode rectification circuit to convert the current produced to DC. The current is then passed through an overvoltage protection circuit, which contains a resistor and a zener diode. The current is then passed through a voltage regulator which fixes the output voltage to a set value. These safeguards ensure that the remaining components aren’t damaged in any event. The resultant current then charges the battery while it is still plugged into the Arduino.

The battery chosen consists of two 3.7V 350mAh wired in series, for a combined 7.4V 350mAh battery. The voltage was chosen to exceed the minimum suggested voltage for the inbuilt Arduino voltage regulator (i.e. 7V).

We used Adafruit’s Ultimate GPS System based on the MTK3339 GPS module to provide accurate location data. SIMCOM’s SIM900 quad band module provided the cellular access, and an Arduino Uno put these modules together, and contained all the low level programming. We used the Arduino IDE to write our code, compile it, and upload it to the Arduino. The charging circuit is composed of a 5-wire unipolar stepper motor, 10 IN4004 diodes, a 10K Ohm resistor, an IN5233B zener diode, and an LED. This connects to the battery, thereby charging it.

The server and the client were both written in Java as Android Applications and implemented the Google Firebase API for authentication, and reading and writing to the database in real time.

Challenges we ran into

A major hurdle we wanted our project to overcome was battery life. Any GPS based system requires copious amounts of power - as you may have experienced when using Google Maps to route you to your destination. To overcome this, we considered multiple solutions like using a large battery, or attaching a solar panel. These were rejected to ensure that the product remains concealed (and hence less likely to be disabled), inexpensive, and effective. We also determined that sending information by SMS is the most cost and energy efficient way to send information.

Accomplishments that we're proud of

1) Implemented Firebase Authentication and Real Time Database as a bridge between server and client side to handle syncing information across all devices. 2) Used low cost and low power solution to sending GPS information to a server in a small volume. This is very viable proof of concept that we can integrate into the frame of a bike for form and security improvements.

What we learned

Our programmers had never worked with Firebase before which presented numerous problems during the implementation on both the server and client side. Thankfully, the Google Firebase representatives were incredibly helpful in helping our programmers understand how to implement Firebase to achieve our goals and present a very valuable learning experience in real time database management and user authentication.

On the hardware side, we had to deal with the massive challenge of running two modules that both rely on the serial port for communication. Arduinos possess only 1 hardware serial port, and since both modules prefer communication over that, it required some clever programming and streamlining to make the GPS functional over software serial without massive lag. It was our first time working with these modules, and we spent a lot of time poring over the datasheets to discern the quirks of each. Another challenge was designing the charging circuit. We had to take into account that LiPo batteries tend to be unstable, and since the GPS module requires a very "clean" source of power, we had to work hard to smoothen the current obtained from the charging circuit.

What's next for Loc8r

For the future, we aim to expand the bike sharing aspect of the application and scale through Firebase. We aim to allow users to form groups with their friends by sharing the bike unique ID. This would allow bike sharing as everyone can see the location of the bike and request to use it up to a maximum period time. This would complete and automate the process of sharing a person’s bike to their friend group.

Built With

Share this project:

Updates