Adding a LASER to my D4 (and CCT adjustment, and USBC charging, and UV, and RGB...)

Here’s my Emisar D4 that now has a green laser, adjustable CCT, USB-C charging, UV, RGB, and voltage/temperature monitoring:

(I had to temporarily program it with alternate firmware that just lit up everything for this picture, ha)

I’ve been carrying my D4v2 with USBC charging for a while and decided it was really missing one feature - I needed to upgrade to include a green laser like my smaller Min/Max lights. Once I got to the point where I was confident the laser would fit, I went a little crazy and decided to throw in every possible feature to make the swiss army knife of 18650 lights.

I started this by getting the USB-C port installed the same way I did in my last rechargeable D4 (although I did a much rougher job of the metal work this time):

On this build, I knew I wouldn’t have room on the driver for the charger IC like last time, so I put together this assembly to tuck the charger into a gap below the USB jack:

This is a sealed waterproof jack with the 5.1k resistors (for using USB PD sources), a TP4056 charger IC, decoupling caps, and the current set resistor. That whole assembly can tuck into the pocket I cut out in the LED shelf in the head, and it gets epoxied in place:

In the above picture you can also see the hole drilled for the laser assembly. I prepared the green laser diode and collimating optics the same way as in my Nitecore Tube green laser build. Then I took progressively larger drill bits to the LED board, TIR optic, and light head until the laser could fit.

Aside from the hole for the laser, the LED board was prepped in the same way as I did in my CCT-adjustable D4v2 with an XM-L RGBW, a 365nm UV emitter on a copper bridge, and MOSFETs for individual control of the white emitters. This one also has a thermistor added to monitor the LED board temperature:

The laser optical assembly was epoxied into the head along with the charging module like this:

The driver for this one was another one-off handmade PCB just like I did for the last two D4 projects. I cut out the 22mm circle from blank 1.6mm PCB material, and started with the 8 MEL7135 regulators for the white output that go on the bottom:

The regulators get soldered directly to a ring for the output and to ground around the outer edge of the board. The Vcc pin of each one is isolated from ground by a small cutout in the copper, to later be connected by small wire. Here you can also see the slot I cut out to be able to access the programming header:

On top of the driver there’s a PIC16F1575 on a small breakout board, and around it I laid out the other components, sketched the necessary cuts into the copper, and cut with a blade to isolate the segments:

The four regulators on top are for red, green, blue, and UV. The other circuitry on top is a boost regulator using the MT3608 which provides power to the laser diode. This is necessary because the green laser diodes need about 5V to operate. The laser output is regulated by a series resistor and I just set the output voltage of the boost converter to line up with the diode current I wanted. Here’s the top side with all components mounted:

And then I wired up all the parts on the driver:

At this point I had these two parts with a mess of wires (there were 18 in total that needed to be connected):

All the wiring to the charger, laser, and switch I had to do like this before installing the driver board:

And then I could thread the other wires in, install the driver, install the LED board, and terminate the remaining wires up top:

The optic had two holes drilled for the UV emitter and the laser:

And then it was on to firmware. Implementing the laser mode was simple since I had other lights that used this already. It is added as a secondary mode after UV (sort of the “utility” group), and this time I also added a triple-click shortcut to laser from off.

CCT adjustment I had also written before, although I had to modify it this time to use only two emitters instead of three. This light adjusts from 6500K to 3000K:

USB charging had been written previously as well, so once again it was just a matter of pulling all the code chunks together:

One last thing that was a bit tricky to include was the temperature regulation, which I did the same way as I had in my Skilhunt H03 mod. The issue was that with all these features, I had run out of I/O pins, so I had to do some pin sharing by making the “charge done” signal from the charger share a pin with the low-side enable on the thermistor divider. During normal operation, the firmware continuously monitors battery voltage and LED temperature and can reduce or cut the output as needed to maintain safety.

I am pretty proud of the microcontroller utilization on this project - I used all 16 I/O pins and 99.5% of the 14KB of memory in the PIC16F1575.

So there you have it, the most full-featured D4 ever made: laser, CCT adjust, USB charging, RGB, UV, and voltage/temperature monitoring running on MELD UI. Thanks for reading!

1 Thank

That’s insane! All that small custom stuff, respect.
Awesome!

Amazing.

That’s the first time I’ve seen a custom PCB cut by hand! The complete assembly is just awesome!

This is just… wow. I am speechless…

Ok, how about adding:

  • power bank functionality to the USB-C port
  • an LDR to sense pocket activation and to program via a computer screen
  • fan for active heat dissipation
  • accelerometer for… I have no idea but I think you need one

Excellent work! I knew this was you as soon as I saw the thumbnail on r/flashlight. :+1:

When is the group buy? :partying_face:

Absolutely mad!

And the tweezers fingers are back on business :smiley:

Impressive work! :o

Nice job, especially regarding the soldering :smiley:

:+1: :+1: :+1:

Now this is cool!

Sign me up, if ever you decide to sell these bad boys.

Your custom builds continue to inspire awe. I’m stunned just to see all these features together in one flashlight, but to squeeze it all into a D4 is amazing. Really great work!

You really excelled yourself. :sunglasses: :person_with_crown: I have never seen such a small charging circuit. I also admire your self designed and programmed driver PCB.

18 wires inside the D4 driver cavity must be a new record.

This build is awe inspiring. Well done. :person_with_crown:

Next stop: Now time to add aux LEDs inside the bezel and switch. :smiling_imp:

This is probably the coolest thing I’ve ever seen.

I’ve wanted a low power 520nm laser in a small flashlight for a while, but the closest I’ve found are the 532nm DPSS weapon lights.

Did you use another 30mW PLT5 diode?

Yes exactly. Those have made it way easier to make green lasers small compared to how it used to be with DPSS

Wow super cool dude. I have a 1 watt pocket green laser and the beam is gorgeous.

You could also do a blue which don’t have as beautiful a beam but are a lot more powerful for burning things and lighting stuff on fire. I have a 6 watt

You guys/gals really crack me up and amaze me.

I knew a guy on AudioAsylum, who whenever he bought a new electric/electronic device, would completely disassemble it and see what was up and then he would put it back to together.

You all remind me of him.

Touche’.

Chris

Absolutely incredible work!