GitXplorerGitXplorer
l

bikelight

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
044b945fa0e8f3ba7476a97f346e652bf7961a53

Add readme

llumbric committed 8 years ago
Unverified
60d130d6cd3f34a3225410702efe0198015a88ec

Add method for LED brightness and invert value

llumbric committed 8 years ago
Unverified
4fc1d2bb266c497de40258296fef2fbff583616c

Change parameters

llumbric committed 8 years ago
Unverified
47dbdd1cd36e2d4b2a4b76d6012c967d4e752636

Fix minor typo in unused code

llumbric committed 8 years ago
Unverified
deccb22206fcfde15e9421b6cb48cf263f831663

Fix auto off if no movement

llumbric committed 8 years ago
Unverified
a44d9ae450cc02c56b2bb247749dcaebf3c6882f

Improve interrupt and button debouncing

llumbric committed 8 years ago

README

The README file for this repository.

Planned features:

  • brake light: light up when braking
  • one button on/off: no need to press often
  • advanced blinking modes: not only blinking, support also fading
  • auto off: turn off light after certain time or if no movement for some defined period

Currently for motion a tilt switch is used. This won't work very well. You could also connect it directly to your brakes. In future an acceleration sensor would be fun.

How to upload firmware

How to upload new firmware:

(Details see http://highlowtech.org/?p=1695)

Tested with Arduino 1.8.1.

In Arduino preferences add repository: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

In Boardmanager add "attiny by David A Mellis"

Then select:

Board: ATiny Processor: ATiny 85 Clock: 1Mhz internal

And: Arduino as ISP

Use an Arduino Uno or Mega (Leonardo does not easily work!) and upload the ISP firmware to the Arduino (Examples --> Arduino ISP). Then connect a 10uF capacitor between Arduion reset and GND and the following pins of the attiny85 to the Arduino:

pin name:    not-mega:         mega(1280 and 2560)
slave reset: 10:               53
MOSI:        11:               51
MISO:        12:               50
SCK:         13:               52

...to the bike light:

5 VCC
6 SCK
1 Reset
7 MISO
8 MOSI
4 GND

^--- the pinched off here end

These pins are connect to attiny85:

         ___
RST  1 -|°  |- 5  VCC
AIO  2 -|   |- 6  PIN2,  button on/off
AIO  3 -|   |- 7  PIN1,  brake button
GND  4 -|___|- 8  PIN0,  LED output

Circuits

Reverse engineered circuits of popular USB bike lights:

3 LED bike light

Find it e.g. here

          ___
        -|°  |-  GND 
Button  -|   |- 
        -|   |-  Signal PWM
VCC     -|___|-  ? also signal?

Signal pin is a sink, pull to GND to turn on LED!

1 LED bike light small

Find it e.g. here

      ___
VCC?    -|°  |-  GND 
Button  -|   |-  high?
high?   -|   |-  Signal PWM
VCC?    -|___|-  ? also signal?

Size constraints

Marcel's bike frame: 37.7mm diameter, 14mm - 24mm depth

Arduino sleep

Some links:

vUSB

"V-USB is a software-only implementation of a low-speed USB device for Atmel’s AVR® microcontrollers, making it possible to build USB hardware with almost any AVR® microcontroller, not requiring any additional chip."