Starting as a junior engineering class project and continued by myself, I built a bike light that can automatically adjust its brightness using an accelerometer and custom firmware that I wrote. In the class, we built a few early prototypes but never got into the firmware and electronics due to COVID. Over summer and into the next year I continued working and refining the bike light.
The LED driver board has be to able to boost the 12V battery to the 18 or 36 volts required, carry the MPU (Gyro+Accelerometer), drive the LED at a constant current and voltage, and carry the microprocessor.
To boost the voltage I used the design of the common XL6009 voltage boosters that are all over Amazon. These use the traditional boost converter layout with a large inductor and a few large capacitors. The XL6009 inherently produces a lot of noise so I tried to physically isolate it from the sensitive digital signals of the MPU.
I used other relatively standard parts that I could easily find reference designs of for the other sections like the MPU6050 or the Seeed Xiao. The LED is driven by a Meanwell LDD-H driver that takes a PWM dimming signal from the microcontroller.
The microcontroller can measure the accelerometer, gyroscope, battery voltage, ambient light through an external photoresistor, a button, and displays status through an integrated RGB led.
Most of the PCB was assembled by JLC PCB. I tried to put all large, easily solderable parts on one side so that I could essentially avoid the problem created by the fact that JLC will not assemble parts on two sides. By doing this I was able to maximize board space.
The LED Driver, XL6009 and the microcontroller board were hand soldered.
I taught myself the circuit design and PCB layout by reading online guides and by looking at refrence designs.
The entire light is designed to be machined out of aluminum. I tried to keep the bolt mounting patterns are similar as possible because of fixturing for machining. Aluminum is a great metal for this because it is light, easy to machine, and is also a good heatsink. By having the entire light made of aluminum, the entire light becomes a heatsink for the LED.
Gaskets were used on the joints.
All parts were machined on a Haas Mini Mill at my school and programmed in Fusion 360.
To start, I machined a fixture plate that was eventually added to. This fixture plate has integrated stops and rests so it can be repeatably located on the machine. The precision in which the plate repeatably relocates defines the precision I can achieve in all parts machined on it. The probing point is the bottom center of the through-hole shown. When I flip the part I created a virtual point with the same coordinates.
I taught myself how to run the CNC mill by a combination of experience on a manual machine and by reading programming tutorials and best practices for machining.
Fixture plate
Large part uses splines and deep grooving to mount.
Large part uses the standard 6 bolt mounting
Special clamping for thin part.
Machining lense holder/ heatsink
Machining Rear Shell
Overall, the light did what I wanted it to do. Next time I would improve both the PCB and the mechanical design.
On the board, I did not put any connectors forcing me to solder every connection directly onto the microcontroller. This created clutter inside the electronics tube and made it extremely difficult to pack the electronics inside. Next time I would put a few pin connector onto the back of the board.
I designed the enclosure for the light to rely on extreme tolerances and did not account for how I would actually put it together. The bolts that hold the rear shell onto the front heatsink are recessed two inches deep and have the board in the way. It is not a problem to reach them, but it is hard to hold them in place while soldering the LED or the board. To solve this I would space the rear mounting flanges back by the height of the M3 bolt heat to capture the bolt between the rear shell and the heatsink.