I'll describe the process by which I designed and built the electronics. The plastic enclosure I built wasn't anything special and I would redesign it if I repeated the project. Schematics, layout and SPICE simulation are in the attached ZIP file.
Parts are detailed in the schematic in the next step.
Tools & Supplies:
- Laser cutter (at the TechShop)
- Soldering iron
- Helping hands
- Toaster oven
- Spackle knife
- Painters tape
- Fine (<#70) drill bits, chuck and drill
- Dremel (or other tool capable of cutting PCB)
- Wire snips
- Needle nosed pliers
- Black spray paint
- PCB etchant
- Solder paste
- Electronics solder
- Li-Po charger
Step 1: Circuit Design
- Support on/off toggle via a single button
- Flash the taillights
- Allow battery charging in-circuit without damaging other components
Toggle is handled by a 3 transistor latch controlling an NFET. It is based on this EDN article. Note I used the NFET since I had it lying around, you could just as easily used another BJT. Flashing is handled by a simple 2 transistor astable multivibrator. You can find other examples here and here. Neither circuit is sensitive to in-circuit charging.
I simulated the circuit using LTspice to adjust the values for the various components. I would recommend adjusting the multivibrator values a bit to slow the flashing rate. The switch might also be more responsive with a smaller capacitor in the latch section.
The final design is in the LTspice ASC file. A slightly outdated version of the design (using different transistors) is included in the DCH file.
Step 2: PCB layout, mask and etching
I also used the laser cutter to make a solder paste mask for my SMD components. I used the paste image (attached) to etch a sheet of thin clear mylar from TAP plastics. The result was imperfect due to some melting but acceptable. Unfortunately I wasn't able to get a good photo of the clear mylar stencil.
NOTE: Sending out for professional PCBs and stencils isn't particularly expensive and would save a lot of time / increase quality.
Step 3: Placement and assembly
Next I attached the larger components (taillights, switch, jumper wires) to the board. A decent soldering iron goes a long way to making this process easier.
Finally, I attached the off board components (headlights and battery) and fired it up!
I won't cover the case in detail since the design was relatively poor. It consisted of glued together acrylic that was ugly and impossible to service. Hopefully this can serve as a jumping off point for something much better!