Adding USB-C recharging to a D4V2

17 posts / 0 new
Last post
tterev3
Offline
Last seen: 1 week 1 hour ago
Joined: 03/28/2014 - 11:22
Posts: 309
Location: NC, USA
Adding USB-C recharging to a D4V2

I modified a D4V2 to add recharging by USB-C:

After carrying and using my tint-adjustable D4V2 for a few months, I realized the one thing that would make it a better EDC would be if it had on-board charging. I ordered another D4V2 to try this on, and as always I planned to also do a full MELD implementation with red, green, blue, and 365nm UV. The tint adjustment was an interesting project on the last one, but I didn’t end up actually using it much, so for this build I didn’t implement it again. However, everything else about the optics setup from that light was great so I kept all those improvements (as compared to my original D4 MELD, seen on the left):

The head of this one now includes this waterproof USB-C jack on the side opposite the button:

To start this mod, I found a very compact and waterproof jack. This is an Amphenol part that is internally sealed and uses a rubber gasket around the outside edge to seal into an enclosure. Fortunately it also is shorter than most, which you can tell by how far the internal contacts protrude from the shell:

I was able to carefully peel off the outer shell, which was only used for mounting, to further reduce the size, and then I could plan where it would fit into the head:

I then carefully cut out the slot for the jack. This was done by hand by first drilling 3 holes and then using a 1/8th endmill in a Dremel to finalize the shape.

The jack is positioned in a cutout in the LED shelf so that it doesn’t take up any driver cavity space. This setup also provided a strong mounting position.

Because I did the cutout by hand it wasn’t perfectly aligned, but I got it to fit and keep the jack entirely within the outer diameter of the head so it won’t get damaged. I didn’t trust the gasket to seal on my hand-cut slot, so I filled all around the jack with epoxy on the inside to both hold it and seal the hole:

Wiring the jack was time consuming because of the tiny pin pitch. I ended up breaking off the pins I wasn’t using to make it easier. I only needed the four ground pins, four Vbus pins, and the CC1 and CC2 pins. In the gap behind the jack I mounted the two 5.1k resistors that are connected to CC1 and CC2, which allows this to negotiate with USB-PD supplies (like laptop chargers) to get 5V:

I left flying leads for ground a Vbus and moved on to the next part:

To add RGB I used the same technique as my last D4: replacing one of the emitters with an XML-RGBW with the dome trimmed to fit in the TIR optic. This gives really nice color beam patterns, much better than the mule-style RGB implementation from my first D4. The XML is mounted on a small piece of flex PCB to insulate it from the LED board and provide contacts on the top side:

This gets mounted to the LED board with superglue. With just the right rotation it can fit between the solder point and the mounting screw while being centered under the TIR lens:

I also added UV the same way as the last one, by making a 4.25mm-high bridge out of 0.5mm copper sheet:

The bridge is soldered to some scraped spots on the positive connection, and the UV LED is soldered to the bridge on its thermal pad. The UV part is a Luminus 365nm part in 3535 package. The bridge provides heatsinking, mechanical mounting, and carries the positive electrical connection.

The dome of the UV part has to come through the TIR optic (since it will block 365nm), so I drilled a small hole in the center. This lets the UV part shine directly through the front glass only:

With the LED board done, I moved on to the driver. Just like with the last D4, I made a new driver from scratch using blank PCB material. The driver has a PIC15F1575 microcontroller (on a breakout board), the TP4056 charger IC, 4 MEL7135 regulators for RGBUV, and 8 MEL7135 regulators for the white channel (for 2.8A drive). After planning out the component placement I came up with this pattern to cut into the copper:

The eight regulators for the white channel are mounted on the back. Around the outside a large ground plane is left, and inside of that there’s a ring to parallel all the outputs. The enable pin of each regulator was isolated from the ground ring by just cutting out a square – these are connected by enameled wire later. Building a board like this by hand actually lets me pack these parts in even tighter than a PCB would allow. There’s also a circle in the center for the spring, and a slot that allows access to the programming header.

The top of the board has the microcontroller, 4 regulators, and the charger IC. There are also a few decoupling capacitors and the current set resistor for the charger. The connections between the top and bottom of the board are formed by drilling 0.8mm holes in strategic locations and soldering short pieces of wire in to form a via.

I then added flying leads for all the external connections. The white LED wires are 28AWG silicone, and the rest are 34AWG enameled.

After soldering the power wires from the USB jack and the wires to the switch board, I could install the driver.

And then the LED connections were all made from the top side:

After testing that all the hardware worked, I added a bit of UV-cure adhesive on the edge of the driver to keep it from spinning. It didn’t need much glue since it is a tight fit into the threads. Here you can also see the battery spring and the wire that connected the regulators’ enable pins:

I made a modified version of the MELD firmware that watches the /CHRG and /STDBY pins on the TP4056 charger to detect when it is charging and fully charged, which causes the light to turn on the red or green emitters dimly to indicate the status. I also added a state that lets it operate while charging at a reduced brightness level that won’t significantly disrupt the charging process. The charger is set to run at 1.0A (here it is pulling only 900mA because the battery is almost full):

zoulas
zoulas's picture
Online
Last seen: 39 sec ago
Joined: 06/01/2020 - 08:35
Posts: 605

You must be an electronics technician, your average flashlight enthusiast could not do all that. Nice work.

pennzy
pennzy's picture
Offline
Last seen: 10 hours 23 min ago
Joined: 12/10/2017 - 19:45
Posts: 2921
Location: United States , Pa.

Yeah, kudos. Way over my head.

Yokiamy
Yokiamy's picture
Offline
Last seen: 13 hours 40 min ago
Joined: 10/18/2016 - 15:47
Posts: 2835
Location: Netherlands

Very nice job!
Respect for your skills to work with such tiny leads, i would have made a mess of it

WTB: Jetbeam TCR-1 or Sunwayman V10R Ti

nick779
nick779's picture
Offline
Last seen: 54 min 59 sec ago
Joined: 03/09/2018 - 15:46
Posts: 409
Location: Pittsburgh, PA

This is beyond incredible for a handwire/handmade pcb job in such a small space.

Kos70
Offline
Last seen: 3 hours 56 min ago
Joined: 03/23/2020 - 09:30
Posts: 27
Location: Kiev

Maintain: good work, and useful mod …

EasyB
Offline
Last seen: 8 hours 58 min ago
Joined: 03/09/2016 - 15:24
Posts: 2140
Location: Ohio

Awesome mod again. Thumbs Up

I really appreciate all the tiny soldering and handmade circuit boards. I also like to do small soldering because it is a good satisfying challenge and enables mods that wouldn’t otherwise be possible. But partly I do it because I haven’t developed the capability to design and order custom PCBs like from oshpark. Do you or have you considered going that route?

clientequator
clientequator's picture
Offline
Last seen: 19 hours 10 min ago
Joined: 12/05/2018 - 15:42
Posts: 247

This is a complex and microscopic mod, very amazing and big thumbs up!

gchart
gchart's picture
Online
Last seen: 5 min 9 sec ago
Joined: 03/19/2016 - 11:57
Posts: 2884
Location: Central IL

You always manage to impress! Well done sir.

Sunnysunsun
Sunnysunsun's picture
Offline
Last seen: 3 hours 14 min ago
Joined: 08/09/2019 - 12:51
Posts: 382
Location: Toronto

Neat! This is inspiring me to see if I can add usb-c to something like the SP40. Something like this might be the way to go for USBC charging. I’m not too familiar with it (still doing some research) and there’s not much material to go around. I haven’t really found the pinout chart but it appears the two middle pins are cc1/2, the two outside pins are gnd, and the other two pins are vcc. A 6 pin usb-c connector would be much friendlier than trying to fiddle with a 24 pin one just to implement charging on a light.

I don’t know what the difference between 1.6 and 0.8mm mean but they’re cheap enough that I’ll just buy both and see what fits

Microa
Offline
Last seen: 12 hours 58 min ago
Joined: 06/29/2011 - 21:20
Posts: 241

These two USBC receptacle are sinking type. Sink 0.8mm and 1.6mm under the PCB surface.

Sunnysunsun
Sunnysunsun's picture
Offline
Last seen: 3 hours 14 min ago
Joined: 08/09/2019 - 12:51
Posts: 382
Location: Toronto
Microa wrote:
These two USBC receptacle are sinking type. Sink 0.8mm and 1.6mm under the PCB surface.

Nvm I see.

On another note, this is the type of USB C connector I see after taking apart my FC11. Just 6 pins as far as I can tell

tterev3
Offline
Last seen: 1 week 1 hour ago
Joined: 03/28/2014 - 11:22
Posts: 309
Location: NC, USA

EasyB wrote:
order custom PCBs like from oshpark. Do you or have you considered going that route?

Yes, I do custom PCBs any time I plan to build more than one, like for my MELD driver , but for one-off projects like this I’ll make it by hand if possible to speed things up

Sunnysunsun wrote:
A 6 pin usb-c connector would be much friendlier than trying to fiddle with a 24 pin one just to implement charging on a light.

Yep those 6 pin jacks are easier, they’re what I used in my H03 rechargeable mod , but for this one I needed a waterproof jack
Brawny
Offline
Last seen: 9 hours 9 min ago
Joined: 02/15/2021 - 09:51
Posts: 35
Location: South Carolina, USA

Just ordered a D4V2, won’t get it for weeks, but boy do I want this mod.

"Shall we indeed accept good from God and not accept adversity?"

Agro
Agro's picture
Online
Last seen: 2 min 40 sec ago
Joined: 05/14/2017 - 11:16
Posts: 6574
Location: Ślōnsk

Brawny wrote:
Just ordered a D4V2, won’t get it for weeks, but boy do I want this mod.

Are you going to try to replicate it? Smile
Brawny
Offline
Last seen: 9 hours 9 min ago
Joined: 02/15/2021 - 09:51
Posts: 35
Location: South Carolina, USA
Agro wrote:
Brawny wrote:
Just ordered a D4V2, won’t get it for weeks, but boy do I want this mod.
Are you going to try to replicate it? Smile

Absolutely not!

"Shall we indeed accept good from God and not accept adversity?"

flightless22
flightless22's picture
Offline
Last seen: 6 hours 29 min ago
Joined: 11/19/2018 - 12:07
Posts: 402
Location: California

You never cease to amaze. Love Love Seeing the internals and how you did it is always fascinating.