Bike Lights
Objective of the project
Design and construction of a front and rear lighting device for a bicycle comprising :
- Front lighting lamp.
- Presence light and direction indicator (flashing) at the rear.
Project Constraints
- Single power supply.
- Removable power supply.
- Powerful front and rear lighting.
- Visible in full light.
- Battery protection against discharge.
- Vibration damping.
- Simple integration into the bike.
- Expandable project for additional features.
Principle of operation
The power is turned on by plugging in the battery cord.
The system starts. An alternating flashing of two LED arrays appears.
Two push buttons to display a flashing arrow indicating the direction on the LED matrix for a few seconds. At the same time a two-tone sound is emitted from a active buzzer.
The front light of the bike has an independent switch to turn it on.
Electronic Components List
- Ceramic capacitor 10n (2)
- Elecrolytic capacitor 3,3µF
- Elecrolytic capacitor 1000µF (2)
- Resistance 1K
- Resistance 10K (2)
- Resistance 33K
- Resistance 1M
- Resistance 33M
- Amplifier circuit LM10
- Arduino mini Pro or Elegoo nano V3
- Screws and plastic spacers
- Zener diode 2,5V
- Mosfet transistor BUZ21
- Quadruple led matrix max7219
- Printed board 30x70mm
- Pin header
List of Accessories for Bike Integration
- Sealed plastic housing for controls
- Momentary activation push button(2)
- 5-pin cable Led lamp
- Battery 18650 1500mAh (or more capacity)(2)
- Waterproof connectors
- Plastic case
- Active buzzer
- Retro-reflector
- Plexiglass plate for cover
- Screws, washers, nuts (4)
- Insulating tapes (various thickness)
Technical Description of the Electronic Part.
The electronic part consists of 3 modules:
- Current regulator 5V
- Battery discharge protection circuit
- The control of the display of the LED matrix display
Current regulator 5V
The system's power supply uses two 18650 batteries in series. The Arduino Pro Mini controller delivers a regulated voltage of 5V which will not be used to power the LED array. During the tests, the current draw from the LED array connected directly to the controller destabilized it.
The regulator is a MCP1700 with a low voltage drop. Not having a regulator supplying 5V, I use a 3.3V regulator whose output voltage is increased to 5V by using a Zener diode (instead of the Zener one can use diodes in series).
Battery discharge protection circuit
To prolong the life of the batteries it is advisable not to discharge them completely. The mounting used cuts the power supply when the battery voltage is below 6V.
The LM10CN circuit is a differential amplifier that has an internal reference voltage of 200mV which can be compared with the battery voltage. For this purpose a 1M-33K divider bridge is used which gives a voltage of 200mV when the battery voltage is 6V. At this voltage the Mosfet BUZ21 is deactivated which cuts the power supply of the assembly.
The control of the LED matrix display
The schematic is simple and requires few components. Other controllers from Arduino or Elegoo (Uno R3, nano range, Mega 2560 R3, etc...) can be used.
The controller is monitored by two push buttons. A 10K resistor and a 10nF capacitor protect from bounce voltages.
At system start the LED matrix flashes. It is the default state. By pressing one of the buttons the controller will switch to “direction indicator mode” for a few seconds and the mini loudspeaker will emit a sound while the LED matrix indicates the direction.
Remarks :
The Led lamp is directly connected to the protected power source. It is not controlled by the Mini Pro unit. 1000µ capacitors protect the controller and the LED array from current surges when the LED lamp is switched on or from current variations related to the operation of the LED array.
The use of a 1500mAh power supply allows an operation of 3 hours (at 530mA).
During the day without the Led lamp the consumption is 210mA with an autonomy of 7h (power supply 1500mAh).
The use of a 5000mAh power supply extends the operation to 10 hours (LED lamp on).
Program Description
The program is quite simple and is based on the LedControl.h library. Everything can be loaded here.
A few hints:
The intensity of the leds display is done through the variable "intens". You can choose a value between 0 (low) and 8 (high).
The "long" variable indicates the duration of the display of the direction arrows. By pressing one of the push-buttons, the direction arrows will be displayed for the time indicated by the variable (in this case 5 seconds).
The "blink1" variable allows the blink effect when no button is pressed. It supports left-to-right or right-to-left scrolling depending on the button pressed.
The "setRow" and "setColumn" functions are used to give effect to the display. The "setColumn" function is used to accentuate the lateral movement of the arrows.
An active buzzer is activated by the tone function on port 6. The sound emitted is different depending on the direction. The sound emitted during the 5 seconds allows you to know the status of the display.
The program runs in a loop. Due to the high CPU load, the display speed is shown as the program runs. In this way, a certain visual fluidity is obtained. The loop end delay (100 and 300 ms) allows the scrolling speed to be accelerated or slowed down.
The video made during the mock-up gives a preview of the rendering. To download here.
Assembly and Mounting
The assembly does not pose any problem.
The printed circuit board supporting the components is attached to the back of the LED module with spacers.
All wires are soldered to avoid bad contacts.
The housing is padded with self-adhesive foam strips. This avoids the use of screws and allows the assembly to withstand the vibrations of the bike.
Thus designed (with the multi-stranded wire connection) the system can be easily assembled and disassembled.
The battery fits in the pocket of my jacket that it does not leave. In the evening it will be recharged to be operational again the next day.
I have several versions of power supply including one with 4 batteries of 2000mAh (2x2). Autonomy then passes up to 8 hours. In this case the complete recharging can last all night long. It is thus judicious to have several sets of batteries.
It should be noted that the light intensity of the matrix affects the power consumption. The "intens" variable of the program can be reduced to prolong operation.
Conclusion
It's an easy project to carry out provided you have the patience to get the right material (multi-stranded cable, push buttons...).
I will now complete this assembly with a gyroscope module in order to adapt the display according to the acceleration of the bike.