Inspiration
A common cause of bike crashes in pelotons, large groups of cyclists, is cyclists not effectively seeing the person in front slowing down, thus causing a dangerous cascading crash. In typical city riding, being predictable and communicating a cyclist's intentions to drivers is key to not getting hit, Having a signal that intuitively tells drivers that a cyclist is slowing down similar to the brake lights on cars would be safer.
What it does
This device monitors forward/backwards acceleration to identify when the user is stopping, in that event it flashes the lights mounted on the rear of the helmet to warn those behind.
How I built it
The system is designed around an Arduino microcontroller, I used a Romeo because it's what I had. The accelerometer is a grove 3 axis accelerometer capable of detecting +/- 1.5 g. One led was scrapped from an old flashlight, while the other is a small segment of RGB strip light with only red connected. The accelerometer is fed into Arduino via I2C then decoded viz a provided library. When it detects a forward/backward acceleration less than -0.5 g then it activates the LEDs. Both LEDs are controled via PWM (pulse width modulation) so that the brightness can be controlled. The red LED is dimed while running, then flashes bright 3 times when deceleration is detected. The white flashlight LED simply turns on when the red starts flashing and off when it stops.
Challenges I ran into
The primary challenges I encountered were connecting to the accelerometer and converting the accelerometer data into a suitable form. Connecting and reading data from the accelerometer was a simple challenge, I was able to use libraries and sample code provided by Grove to get the accelerations I needed. The accelerometer outputs raw acceleration in 3 axis, x acceleration (which I didn't use), y acceleration, ay (forward/backwards) and z acceleration, az (up/down). If completely level, only the az is affected by gravitational acceleration, however, a helmet is rarely level. My first test assumed ay was the horizontal acceleration but would trigger if the helmet was tilted forward due to gravitational acceleration. I had to devise a simple way to remove acceleration due to gravity (g) from the calculated horizontal acceleration ah. I ended up with a simple calculation that made assumptions that would make my numerical methods professor cry. ** if (ay<0){ ah = ay+sqrt(1-pow(az,2)); } else if (ay>0){ ah = ay-sqrt(1-pow(az,2)); } else{ ah = ay; } ** This works well enough for this prototype but must be improved in the future.
Accomplishments that I'm proud of
I came to this event without an idea and not expecting a working prototype, so I am extremely proud to have created something that does work and has expanded my knowledge.
What I learned
I started this project with the goat to how to code using accelerometer data and certainly did that.
What's next for Helmet Mounted Bike Brake Light
The main priority is changing components to reduce the size and increase visibility, the microcontroller should be changed to something much smaller such as an Arduino Nano, and the LEDs, especially the red needs to be much brighter (it's hardly visible in the outdoor test video). Additionally, a more rigorous way to separate forward acceleration from gravity would improve the reliability of this device. This system would be better suited for a fixed light mounted on the seat post of a bicycle, because it would make the accelerometer readings more stable and uniform, with fewer accidental triggers such as head movement.
Built With
- arduino
- grove-accelerometer
Log in or sign up for Devpost to join the conversation.