I bike daily to work, and sometimes i'd like to have automatic lighting system which would turn on by itself whenever it's getting dark, not forcing me to stop and turn my tail light and second, backpack attached tail light on. That's where this project was born.
Automatic Bike Lighting System - let's call it BLS, will turn on automatically when it'll sense that my bike is moving, and it's getting dark - that's what's most important about it, but there are few other conveniences - BLS is controlled by "central" headlight which incorporates ALS (ambient light sensor) and bluetooth link to other lights - and i am also able to control entire lighting manually by pressing on/off button on main headlight, if for some reason i want to override automatic operation. There can be up to 4 slave lights - tail or auxiliary head lights. System also incorporates a bluetooth beacon attached under the saddle. Beacon let lights know that they are actually attached to the bike, so they will not engage automatic operation when carried in the backpack, or in a pocket, while away from bike. Beacon also contains non volatile system settings such as light sensitivity and idle timeout, which can be altered from smart phone app (currently i use Nordic nRF Master Control app for this, as there is no dedicated application yet) . System of course turns itself automatically off if bike is not moving for defined period of time.
Current version of BLS is retrofitted to Cat Eye Omni 3 lights, and consists of PCB module with Nordic Semiconductor nRF 51822 SoC, accelerometer PCB module, and transistor switch PCB module (all module PCB's are about 1x1 cm size) fitted in lights being part of the system.
I'm fairly sure that this system in it's current form could be retrofitted to most LED based bike lights on the market (provided there is a bit of space to accomodate two 1x1 cm PCB's), and after PCB modifications and making own, 3D printed cases for lights, could be used as entirely DIY automatic bike lighing system.
Regarding nRF 51822 modules used in the project: first i used these modules (aliexpress.com), but i had to make separate accelerometer PCB (i've used LIS35DE), so i switched to these (aliexpress.com) which already have ultra low power LIS3DH onboard and are even smaller 0.8.x1 cm!
Current draw in sleep mode:
head/tail light with LIS3DH: 15 μA
head/tail light with LIS35DE: 0.29mA
beacon: 7 μA
Current draw in awake mode:
head light with LIS3DH: 1.5 mA (BLE scanning) / 1.1 mA (BLE scanning off)
tail light with LIS3DH: about 0.8 mA
head/tail light with LIS35DE: 1.2 mA
beacon: 0.35 mA
When using 1000 mAh AAA rechargeables, BLS allows for about two weeks of daily commuting ( in my case distance is about 14km) before recharge.
In worst case (when LIS35DE is used) system can be idle for a month, and it's still usable (it takes about 100 days for LIS35DE to drain 1000 mAh AAA's).
Ligths are programmed via two wire SWD interface and Segger J-Link programmer. Head light runs S120 Nordic soft device in BLE central mode. Auxilary tail/head lights, and beacon run S110 Nordic soft devices (BLE peripherial).
- work on lowering sleep/awake current draw even more