3d Printed Rear Bike Light

by alex20011 in Outside > Bikes

2403 Views, 28 Favorites, 0 Comments

3d Printed Rear Bike Light

FGSV69WKVI3SQ76.jpeg
DIY rear bike light
20211102_100602.jpg
20211029_085544.jpg
20200929_SB_5DSR_MG_3330-56bca72.jpg

This bike light was created to fit on my wife's tri bicycle. Her seat post is not round but flat so most lights does not fit on it. I did not wanted to just buy a rear light and creating a mount for her bicycle, I wanted to create one from scratch. This is also my first Instructables. :)

The light use Attiny 85 to control the flashing modes. There are 4 different mode: Fast, Medium, Slow and solid. Very simple and maybe in the future there will me other modes. I use PLA black for the body parts and a transparent PLA for the light cover. The 3d printed parts are water resistant but should not be exposed to water for a prolong period of time. If it needs to be more water resistant, the parts should be printed with PETG at superfine resolution.

The design was was done with TinkerCad. The link to the TinkerCad is below.

Supplies

Tools

  1. Soldering iron
  2. 3d printer or someone that can 3d print the parts.
  3. Exacto knife
  4. Wire cutters
  5. Wire stripper
  6. screwdriver

Material

  1. Attiny85 - Aliexpress
  2. Light strip - Aliexpress
  3. Round pan head tapping M2*6 mm screw (x1) - Aliexpress
  4. Round pan head tapping M2*8mm screw (x1) - Aliexpress
  5. Round pan head tapping M2*4mm screw (x2) - Aliexpress
  6. Round pan head tapping M2*12mm screw (x1) - Aliexpress
  7. Hexagon Hex bolt head screw kit m2 (if you don't have any) it will only require 2 screws. M2 4mm and 6mm - Aliexpress
  8. Surgu (for waterproofing button)
  9. Mini usb port - Aliexpress
  10. Battery - Adafruit
  11. Mosfet IRLB8721P - Adafruit
  12. Resistor 2 watt 9.1 ohm - https://www.digikey.ca/
  13. Any 10k resistor 1/4 watt
  14. Capacitor 10uf 25V - Aliexpress
  15. 30 awg wire - for button and charger
  16. 24 Awg wire - for light
  17. PCB with dimensions of 34mm length and 17.2 mm width.
  18. Silicone attachment for the mount. - Aliexpress
  19. 2 pin JST connector - Aliexpress
  20. Crazy glue
  21. Lithium charger (TP4056 mini) - Aliexpress

Print 3d Parts

20211105_114123-2.jpg

The 3D printer that I use was a Creality CR6 SE with stock parts.

Most of the parts are printed at 10% infill at 0.2mm with support touching the build plate. The button holder ( part beside button in the picture above) will probably need light sanding to fit into it's holder.

The only part that needed the support everywhere is the mount that attach to the post. For that part I printed it at 70% infill so it can resist the stress of supporting the light and the elastic attachment to the post.

The light cover need about 30% infill with transparent filament and support touching built plate at 65 degree,.


All parts to print are provided below.

Make the PCB

Schematic_rear_light_V2_2021-11-05.png
Untitled Sketch_bb.jpg
20211018_131840-2.jpg
20211028_151722.jpg
20211106_164922.jpg

The PCB needs to be exactly 34mm in length and 17.2 mm in width to fit snugly into the case. Make certain that the height of all components does not exceed 11mm. I added as much picture to show how to wire the PCB and how it fit into the case.

The white and purple wire in the picture above are the button wires. Do not solder the button to the wires yet, it will be explained in step 5. The 2 Watt resistor and the LED strip are drawn coming out the other way. Assemble the electronics components as shown in picture 3. That is the best way everything will fit into the case. Make certain that the orientation of the JST connector (Battery) is the correct way for the positive and negative.

On the PCB, add 2 more wire on the positive and negative rail to connect the charger to the LED lid in the last step (see picture 3). It can be a wire of any length but for the size I used 30 awg. It is more flexible and can store into the body easily, see last picture.


Add Code to Attiny85

code.jpg

After the PCB is done we need to program out Attiny85 with the program to make it work.

If you have an Arduino handy there is a good Instructables that show you how to do it: How to Program an Attiny85 From an Arduino Uno.

Like me if you use SparkFun USBTinyIsp, there are very good instructions on how to do it on their site: SparkFun UsbTinyIsp.

Attached as a file is the .ino for the sketch.

Downloads

Modify TP4056 (charger)

20211106_205423-2.jpg
20211018_131833.jpg
20211025_135637.jpg

I need to modify the TP4056 charger so it can be smaller and fit inside the lid of the light. The charger is a standard aliexpress charger and you need to get the TP4056 mini or micro.

For the battery it is very important that you only use a LiIon/LiPoly constant-voltage/constant-current charger to recharge them and at a rate of 400mA or less. For that reason we need to change the resistor on the TP4056 to charge at 400mah or less.

To do this we need to unsolder the resistor and replace it with a 3.3k ohm resistor. This will give a charging rate slightly under 400mah per hours. A good website for the TP4056 board.

First cut the charging board at the red line shown in picture 2. Not like I did and attached the resistor before cutting. This caused me problem cutting the board as I had to be careful not to break the resistor.

Then removed the old resistor with a soldering iron or if you have it a Heat gun. Bend and cut the resistor to fit onto the solder pad. Remove the old solder from the pads and apply new one with flux. Usually I also add solder to the end of the resistor to help solder it to the pads. Carefully solder the resistor to the board.

After the resistor is added, solder 2 wire for the input 5v as seen in picture 3. The red is the positive and the black is the negative.

The final board dimensions without the resistor is 16.5mm width and 13.8mm height.

Assembling the Body

20211107_152049.jpg
20211107_152103.jpg
20211107_153058.jpg
20211107_152230.jpg
20211028_151722.jpg
20211104_101634.jpg
20211107_155104.jpg

After the PCB is completed, you will need to solder the button to the white and purple wires. I used 30awg wires for the button and shorten them to about 1 inch. Also try the button box into the button case (picture 2) to see if it fit snugly. If it does not , just sand it a little bit until it fit. Before soldering the button you will need to put the button into the button box and then pass the wires through the button holder, then solder the button (see picture 3 above).

Prepare the LED light with solder on the negative and positive pads. Then solder a 1inch 1/2 or enough wire to reach the PCB onto the positive side of the LED light. Pass the wire through the hole and fix the LED light to the back of the body (Picture 4).

When the light is fixed, solder the 9.1 Ohm 2watt resistor to the PCB and pass it through the hole to reach the light on the other side. Solder the positive wire of the LED to the PCB. Verify that the PCB will fit into the case when the resistor is attached to the LED light. Then plug the battery and do a test to see if everything is working properly.

Fit the button through the button case in the 3d printed body (picture 2), screw the button holder (last picture) with the M2 * 4mm screws. Push the PCB with the battery into the case (Picture 6).

Assembling the Lid

20211108_091629.jpg
20211108_091651.jpg
20211028_202229.jpg
20211029_073749.jpg
20211106_164900.jpg

You will need to solder wires from the TP4056 to the USB part as seen in picture 4. Then add the Mini USB to the USB cover (Picture 2) and glue it to the inside cover. The wires for the USB should be pointing inside and not toward the outside of the cover (Picture 3).

Now solder wires to the charging side of the TP4056 and then glue it to the inside of the cover (picture 4). I attached a small connector to the output of the charger so I can disconnect the lid from the body (picture 5).

That's it , the Lid of the bike light is completed.

Putting It Together

20211104_100645.jpg
20211104_102654.jpg
20211104_103311.jpg
20211104_101634.jpg
20211108_152600.jpg
20211108_201526.jpg

Now we can put the light together and add the waterproof button cover.

To waterproof the button, add some Vaseline on the button top and be careful to not add any to the sides of the case. Then use a small amount of Surgu to shape a button as seen in picture 3.

Now you can use M2 *6 mm and the M2 *8 mm screw to close the lid. On the lid, the 6mm screw is used on the side of the button and the 8mm on the other side.

Now for the holder, screw the holder clamp (Picture 5) to the holder so it will not fall out. Use the silicone attachment to attach the holder to the seat post.

Last step is to glue the Transparent Light Cover to the rest of the light body using super glue.

I have create an Holder for a round seat post (about 20mm diameter) in TinkerCad also if you want to print it out.


There you have it your own 3d printed rear bike light. I am very happy with how this came out, and have no real complaints with it. If I were to make it again the only things that I would change is some of the 3D prints to make the assembly a little easier, but that's it. I hope you enjoyed this build. Thank you so much for taking the time to read.