From being a green transportation option, to helping people get exercise, to being much more affordable than driving a car, biking has a number of advantages. However, in a recent survey, when asked why they did not bike to work, over 65% of respondents cited 'safety concerns' as the most important factor. This is not unfounded -- in 2016, nearly four thousand cyclists were killed in road accidents.
When our team looked at addressing this issue, we learned that visibility or unsafe road conditions played a role in over 85% of the crashes recorded.
What it does
MOJO is an integrated solution for making bicyclists safer. A raspberry pi-based bike attachment functions as an ultra-bright weatherproof taillight, adding convenience and improving safety through the use of multiple strobe modes and intelligent turn and brake signals. Using MOJO's turn and brake signals allows bicyclists to keep both hands on the handlebars, increasing controllability and braking authority compared to traditional signaling methods. MOJO's built-in GPS makes bikes nearly impossible to misplace, as parking locations can be recorded and pushed to the cloud. Additionally, MOJO's website combines GPS data with public safety records, enabling users to view their bike routes in the context of recorded road conditions and traffic accidents and thus plan safer commutes.
How we built it
MOJO's bike attachment consists of a raspberry pi running raspbian stretch-lite and Circuit Python. Circuit Python scripts are used to interface with the GPIO header for controlling an external GPS, a strip of ultra-bright SK6812 RGBW LEDs, a magnetometer/gyro/accelerometer, and a remote used for controlling turn signals. Accelerometer data is used to create a "brake light" effect on the LED strip when the bike slows down, and gyro data is used to implement intelligent turn signals that automatically turn off after a turn is completed.
The remote control for the bike attachment mounts to the handlebars, and consists of two buttons for triggering the left and right turn signals and a status LED. The status LED indicates what mode the taillight is in (turning left, turning right, hazard lights, brake light, etc), allowing the user to confirm that their signal is functioning without taking their eyes off the road. The GPS is used to log position information to the Raspberry Pi's SD card, and a Python script pushes GPS logs to the cloud using the Azure IoT suite as soon as an internet connection is detected. Position updates can be quite frequent in urban areas or universities with public wifi networks, or can be scheduled to run only when the bike comes within range of a home or work wifi network at the end of a commute. Optionally, an external cellular module can be added to the Pi for round-trip connectivity from just about anywhere. MOJO's position data allows users to keep track of where they parked their bike, and can be used with MOJO's web suite to analyze road risks and plan safer routes.
All of the external components of MOJO's bike attachment are waterproofed with silicone, and the housings are constructed from durable PETG plastic and sealed with TPU gaskets. MOJO is IP64 water resistant and capable of handling the outdoor weather.
MOJO's web suite allows riders to visualize the riding risks in their local area in order to better plan their routes. Public safety data ranging from local crime rates to pavement quality to traffic accidents is compiled and rendered as a heatmap, allowing MOJO users to see the riskiest parts of their commutes and plan accordingly, whether it's slowing down to keep an extra close eye on a certain blind intersection or taking a different street altogether.
Challenges we ran into
Some of our web integrations had difficulty working with third-party apps, and building hardware was extremely resource and time intensive.
Accomplishments that we're proud of
We are proud of the level of polish that we were able to build into our hardware prototype. No breadboards, no duct tape, and basic waterproofing proved to be a challenge, but we think it looks pretty good!
What we learned
Despite not running Real Time Operating Systems, Raspberry Pi's are fantastic for embedded systems development! Their incredibly high clock rate when compared to many embedded devices removes many of the issues with timing resolution, at least for basic tasks like I2C / SPI / UART communication, and there are ample tools for interfacing with a large variety of sensors.
What's next for MOJO
We'd like to continue improving our hardware and web platform; adding cellular connectivity to the bike attachment would allow it to upload data from more places, and solar panels could extend the life of the bike's battery while running MOJO. The web platform could be expanded to auto-generate safer bike routes from the data it already has, making safe biking easier than ever.