Riding a bicycle at night can be dangerous. Having lights on your bike can help, even better if they come on automatically!
Step 1: Video:Video goes through some of the finer points on this build, including my first try at it using primarily through hole components. Surface mount components is a new animal to me, and it really opens up a lot of possibilities.
Step 2: Supplies- PCB - KiCAD project available on GitHub, PCBs produced by NextPCB
- ATtiny85-20SU [eBay]
- Low Sensitivity Vibration Sensor [eBay] or [Adafruit]
- 0805 resistors (4) a sample book [Amazon] can be extremely useful
- 0805 LEDs (4) [Amazon]
- CR2032 Battery
- CR2032 Battery holder [eBay] [Amazon] - as seen in video, had a hard time with either one
- Solder paste [Amazon]
- DIP switch (1 position - optional, can use wire instead)
- Capacitor (2200uF used, could likely go smaller)
- Zip ties (4)
- Hot air gun [Amazon] - extremely useful with SMD parts as well as heat shrink.
- Solder squid (optional) - my concrete design.
- Programmer [Sparkfun] and chip clip
Apply parts, melt solder paste, solder on surface mount components.
Step 5: ProgramProgram the ATtiny85 using a programmer and chip clip. More info on programming this chip is found here. Code is based on this previous project, and simply cycles from one LED to another.
Note that while ICSP headers seem to be available, I made an error or two here–best to use the clip.
Step 6: Zip Up!The PCB is designed to attach to a bike's spokes via zip ties. Loop the ties as appropriate and tighten.
Step 7: Ride!With this in place, when your wheels go above a certain speed, power is applied the lights will start flashing. An earlier revision started flashing by hooking the sensor up to the reset. This worked at lower speeds, but at high speeds the reset is simply triggered all the time.
Step 8: Next StepsWhile this build works, there are a few things that could be improved:
- Battery life isn't great - larger resistors, or more efficient LEDs could be used. Also, one might consider taking out the ATtiny85 altogether and running it off of a blinking capacitor.
- Blinking happens only at certain speeds depending on the revision. Ideally a device would do both, so I wouldn't rely on this as a primary safety device. I still have a light on my bike that I turn on manually.
Thanks for reading!
Note that Amazon links on this tutorial are affiliate, meaning I get a small percentage of purchases executed after clicking those links.
Comments