Front & Rear Bike Lights for Folding Bike

by MatthewH280 in Workshop > Lighting

75 Views, 0 Favorites, 0 Comments

Front & Rear Bike Lights for Folding Bike

P1060588.JPG
Bike Light (111).JPG
Bike Light (044).JPG
P1060474.JPG

In terms of the creative ideas and reasons for making this project:

  1. I purchased a folding bicycle and needed some bike lights, so decided to make some myself.
  2. The lights were to be designed so they fit on mounting holes on the bikes frame (Carrera Intercity folding bike). (If lights are to be mounted on a different bike then design will need to be adjusted to fit that bike's mounting holes)
  3. To use mostly electronic components / strip lights harvested out of WEEE bin at work.

Supplies

Tools used during the construction of this project

  1. Pillar Drill.
  2. Band Saw.
  3. Disk Sander.
  4. Hot Air Rework Station / Hot Air Gun.
  5. Sandpaper.
  6. Hammer.
  7. Small Paintbrushes.
  8. Various Screwdrivers.
  9. Soldering Iron / Solder + Flux / Solder Sucker.
  10. Pliers / Wire Cutters / Strippers.
  11. G-clamps.
  12. Various Drill Bits.
  13. Hobby Drill.
  14. Bench Power Supply.
  15. Metal Ruler + Marker Pen / Pencil.


Materials for Front & Back Lights + Controller Case.

  1. Piece of Oak (35mm x 110mm x 6mm).
  2. 2 piece of Sapele (80mm x 30mm x 8mm).
  3. Piece of Plywood (180mm x 70mm x 8mm).
  4. LED Strip Lights.
  5. 2" Diameter Frosted Plastic.
  6. 15 AWG Electrical Wire. (Various colours as shown in photos).
  7. Wood glue.
  8. Danish Oil.
  9. 2mm thick PCB Material (or an alternative material)
  10. 3x M3 15mm Stainless Steel Bolts / Nuts / Washers.
  11. 6x M4 Stainless Steel Countersunk Rivet Nuts.
  12. 6x M4 15mm Stainless Steel Bolts + Washers.
  13. 4x M5 25mm Stainless Steel Bolts.
  14. 2x M6 15mm Stainless Steel Bolts.
  15. 18x M2 6mm Self Tapping Screws.
  16. Araldite Glue


Components Required for Electronics + Circuit Board

  1. 1x 220R 1/4W Resistor.
  2. 1x 560R 1/4W Resistor.
  3. 1x Single-pole single-toggle (SPST) switch.
  4. 2x PIC10F320 Microcontrollers.
  5. 6x 4pin 2.54mm Female Sockets.
  6. 5x 4pin 2.54mm Male Headers.
  7. 1x 2pin 2.54mm Male Header.
  8. 2x 8-pin DIP connectors.
  9. 1x 3pin Connector / Socket.
  10. 1x LM317 Regulator
  11. 15 AWG Electrical Wire. (Colours as shown in photos).
  12. 22 AWG tinned copper wire.
  13. 9V Rechargeable Battery(ies) (I used 2 as I had more than one in my collection)
  14. 9V Battery Clip(s).
  15. Heat shrink.
  16. Vero/Strip board.
  17. 0.5mm Solder Wire.
  18. Conformal coating.

Construction of the Front Light.

Bike Light (001).JPG
Bike Light (002).JPG
Bike Light (004).JPG
Bike Light (007).JPG
Bike Light (011).JPG
Bike light 02.jpg
Bike Light (025).JPG
P1060364.JPG

A: I found a piece of Oak that was 35mm by 115mm with a thickness of 6mm. I measured and marked a line down the centre of the Oak then marked and drilled two 8mm holes about 30mm apart. The position of the holes were such that they matched mounting points on the front of the bike. Next, the Oak was placed onto some PCB material and a marker pen was used to draw around its edge, a Bandsaw was then used to cut out the shape before it was fixed onto back of the wood with araldite glue. I used PCB material because it was available at work, but is not necessary if you don't have any.

B: For the LEDs I used some LED strip-lights that were in the cupboard at work. I chopped 3x LED Segments off one of the strip-lights, used a scalpel to isolate tracking, then drilled two small holes on either side of each LED. The centre led was removed from each segment, leaving 2 LEDs per segment. The LED segments were then fixed to the piece of wood with a couple of screws as shown in photos.

C: I took some 22 AWG tinned copper wire, twisted it to make it thicker, then soldered it to each LED's Cathode (-). Black wire was soldered to the end of the twisted piece of copper wire. 15AWG multicore wire was then soldered to each LEDs Anode (+), using different colour wire for each segment, and the wires were covered with heat shrink (using hot air gun to shrink). The ends of the coloured wires were soldered to a 4pin 2.54mm female header, the black (Cathode) wire was soldered to a 2 pin header. Finally, the LEDs were coated with conformal coating to protect them from moisture.

Adding Frosted Perspex Acrylic to Front Light

Bike Light (014).JPG
Bike Light (015).JPG
Bike Light (018).JPG
Bike Light (019).JPG
Bike Light (023).JPG
F2Y16O6M4O6TRBR.png
Bike Light (024).JPG

A: A bandsaw was used to cut a 35mm wide by 140mm long strip of Acrylic. A metal ruler was used to mark two lines 15mm in from each end of the strip and a bandsaw used to cut these two 15mm segments off. Waste plastic around the edges was removed using sandpaper. Next I removed the plastic cover from each acrylic piece, applied araldite to the 15mm segments, then attached them (with Clamps) to the ends of the bigger piece.

B: The glued Acrylic piece was then placed on top of the Front light, clamped in place, then a hobby drill was used to drill a hole at each end. The clamp and acrylic cover was then removed and a pillar drill used to increase each holes diameter (in both the Oak and Acrylic) before inserting a M4 rivet nut into each hole. I then used two M4 15mm Screws + Washers to fix the cover in place. A disc sander was used to round both ends of the front light. As shown in the photos.

Making Main Case for Bike Lights

Bike Light (027).JPG
Bike Light (028).JPG
Bike Light Cover (03).JPG
Bike Light (029).JPG
Bike Light (031).JPG
Bike Light (037).JPG
Bike Light (036).JPG
Bike Light (034).JPG
Bike Light (039).JPG
Bike Light (045).JPG
P1060562.JPG
P1060563.JPG

A: For the case, that would house the main electronics + Batteries, I decided to use PCB Material* (2mm Thickness). The material is a waste product from the Electronic manufacturing process and regularly (mostly thin strips) goes in the waste bins at the company I work for.

I used a metal ruler to mark dimensions (see below) on material then used a bandsaw to cut them out.

  1. 2x End pieces 62mm by 30mm (thickness x 2mm).
  2. 2x Side pieces 125mm by 30mm (thickness x 2mm).
  3. 1x Bottom piece 125mm by 62mm (thickness x 2mm).
  4. 1x Battery compartment segment 60mm by 30mm (thickness x 2mm).

B: I made a few box joint style indentations along the edges, then used bandsaw + files to cut them out, so I could fit them together like a jigsaw. Then applied araldite on the inner/outer joints as shown in photos. Made a couple of slots about 50mm along the side of the case for the Battery compartment segment, then used araldite to fix it in place. Initially I made the case about 160mm in length but decided it was to big so chopped it down to 125mm and reworked/glued the end. Drilled holes in the bottom piece that correspond with the mounting holes on the bikes top bar.

C: I drilled a small hole in the side for the toggle switch and cut-out two slots for the wiring.

*Swap PCB material for Plywood, etc if not available. Also, the two metal spacers shown in the photos were to be used to screw the lid on but I decided instead to make a tight-fitting lid held in place with elastic bands.

Microcontroller PCB Module

FI20EQDM7LXE9KH.png
P1060375.JPG
P1060378.JPG
P1060367.JPG
P1060370.JPG
P1060369.JPG
Bike Light (038).JPG
Bike Light (040).JPG
Bike Light (042).JPG
P1060364.JPG

A: The main electronic circuit for controlling the Led Bike lights is as shown in the schematic. The circuit consists of two PIC10F320 Microcontrollers (one for each Light) and an LM317 voltage regulator. Two processors gives the option to control each light independently with a different LED sequence / code for each. For each microcontroller, I took some Veroboard board and 2x 4pin headers and made a small module board with the 10F320 carefully soldered on top. This enabled me to remove each microcontroller from the main PCB and program them separately on a Microchip programmer board.

B: Each LED forward voltage = 3V. I took each bike light and it's attached wires and connected them to a bench power supply with variable voltage control. Initially I set the voltage on the bench power supply to about 3V then gradually increased the voltage level till the LEDs were at the right brightness, this was at about 4.5V. I then calculated the LM317 output using the equation (found in data sheet) Vo = Vref(1+R2/R1); R2 = 560 ohms, R1 = 220 ohms & Vref = 1.25V. Vo = 4.43V

C: I assembled the components onto a piece of Veroboard (as shown in photos) using solder + soldering iron. 8-pin DIP sockets were used for attaching the mini processor PCB's. To allow each bike light to be separated from the main microcontroller module I soldered 4-pin headers onto the Veroboard with corresponding connectors on the ends of the wiring. A 2-pin header was soldered to the ground line to connect with both lights cathode wires. The main module was then fitted into the case and fixed in place with screws, nuts and washers.

D: Finally, I used microchips MPLAB IDE Software + XC8 compiler to write software for each processor. I have initially written the same piece of software (see attached BikeLightSoftware.txt) for both processors. Video of LEDs in operation: https://vimeo.com/1087512381

Construction of the Rear Light.

Bike Light (046).JPG
Bike Light (047).JPG
Bike Light (050).JPG
Bike Light (052).JPG
Bike Light (055).JPG
Bike Light (056).JPG
Bike Light (058).JPG
P1060559.JPG

A: I took found a piece of plywood (180mm x 70mm x 8mm) and calculated the approximate position I wanted to put the two pieces of Sapele (80mm x 30mm x 8mm). The pieces of Sapele were then placed onto the plywood, a marker pen was used to draw around them, then a bandsaw used to cut around the outline and make the shape I wanted. I applied wood glue to each piece of Sapele, positioned them on the plywood and used clamps to hold them in place. The glue was left to set for 24 hours.

B: Two rear mounting points (usually used to attach a bike rake) closest to the bikes saddle were used to attach rear light to the bicycle. A metal ruler was used to mark positions on the bottom edge of rear light, then I used a bandsaw to create four cross lap joints for the four vertical slats. The vertical slats (approx size: 40mm x 30mm x 8mm) had a hole drilled in each to allow bolts to be screwed into the mounting holes.

Adding LEDs and Wires to Rear Light

Bike Light (061).JPG
Bike Light (064).JPG
Bike Light (067).JPG
Bike Light (068).JPG
Bike Light (073).JPG
Bike Light (075).JPG
Bike Light (076).JPG
Bike Light (079).JPG
Bike Light (086).JPG
Bike Light (078).JPG
Bike Light (094).JPG
Bike Light (097).JPG

A: As with the front light I chopped 6x LED Segments off one of the strip-lights, used a scalpel to isolate tracking, then drilled two small holes on either side of each LED. One LED per segment. I fixed each LED to the piece of Sapele with a couple of screws as shown in photos. I measure the position of each led so that they were evenly spaced on each piece of wood.

B: With the LED's removed, I then used a hobby drill / carving knives to create a 8mm wide by 4mm deep groove under the LEDs. To connect the rear light to the wiring from the microcontroller PCB module I found a 9 pin d-type connector, created a suitably sized hole in the centre of main plywood, then inserted the connector into the hole. I used a couple of self tapping screws to fix it in place.

C: I then wired (with soldering iron + solder) all the LEDs to the connector, a single red wire for each anode(+) and black wire for the cathodes(-). I tested the wiring to check all LEDs worked, then applied silicon over the wires on the back of the connector and coated each LED with conformal coating. Finally, I drilled two holes into the corners of each piece of Sapele and then hammered a M5 rivet nut into each hole and rounded both ends of the rear light on a disk sander.

D: A male 9-pin d-type connector was used to connect the rear light with the microcontroller module. Different coloured 15AWG multicore wire were then soldered to each connector pin that corresponded with the LED segments. The wires were covered with heat shrink (using hot air gun to shrink). The ends of the coloured wires were soldered to a 4pin 2.54mm female header, with the cathode wire (I used yellow for rear) soldered to the same 2 pin header as the front light.

Adding RED Perspex Acrylic to Rear Light

Bike Light (083).JPG
Bike Light (080).JPG
Bike Light (085).JPG
Bike Light (100).JPG
Bike Light (101).JPG
Bike Light (103).JPG
Bike Light (106).JPG
Bike Light (090).JPG

A: I measured, then marked out a large strip of red Perspex acrylic that would cover the LEDs on the rear bike light. I then used a bandsaw to cut the strip from the Acrylic sheet, then removed waste plastic with sandpaper. As shown in photos.

B: Then got some small off cuts from the same acrylic and used araldite/clamps to fix them around the edges of the main pieces. This was done in an attempt to make the rear light more weatherproof. Once the glue had set a pillar drill was used to drill 4x 6mm holes in the plastic so that 4 M5 bolts could be used to fix the acrylic cover to the rear light.

C: The wooden surfaces on both the finished front & rear lights were coated with Danish Oil.


Finishing of Rear Light

Bike Light (104).JPG
Bike Light (107).JPG
Bike Light (108).JPG
Bike Light (109).JPG
Bike Light (113).JPG
Bike Light (110).JPG

A: I glued the four vertical slats into the cross joints with wood glue. Glued a couple of pieces at the top of each pair of slats to add more strength then once the glue had set I applied araldite around the edges of the joints to add more strength.

B: I then attached the rear light to the mounting holes on the back of the bike and fixed in place with m4 bolts.

Making Lid for Microcontroller Module

Bike Light Cover (02).JPG
Bike Light Cover (04).JPG
Bike Light Cover (07).JPG
Bike Light Cover (10).JPG
Bike Light Cover (12).JPG
Bike Light Cover (14).JPG
Bike Light Cover (19).JPG
Bike Light Cover (22).JPG
Bike Light Cover (16).JPG
Bike Light Cover (17).JPG
Bike Light Cover (15).JPG

A: For the case lid I again used PCB Material (2mm Thickness).

I used a metal ruler to mark dimensions (see below) on material then used a bandsaw to cut them out.

  1. 2x End pieces 66mm by 30mm (thickness x 2mm).
  2. 2x Side pieces 132mm by 30mm (thickness x 2mm).
  3. 1x Top piece 132mm by 66mm (thickness x 2mm).

B: As with Step 3, I made a few box joint style indentations along the edges, then used bandsaw + files to cut them out, so I could fit them together like a jigsaw. Then applied araldite on the inner/outer joints as shown in photos.

C: I made 3 cut-out slots (18mm deep by 12mm wide) to allow the cover to fit over the toggle switch + wiring. Finally, the lid was fitted onto the Microcontroller PCB module.