Adding USB-C charging to a Skilhunt H03

25 posts / 0 new
Last post
tterev3
Offline
Last seen: 1 week 20 min ago
Joined: 03/28/2014 - 11:22
Posts: 309
Location: NC, USA
Adding USB-C charging to a Skilhunt H03

I had an extra H03 sitting around for a while wanting to be modified, and realized the most useful added feature it could get is USB charging. The H03 is very compact for a right-angle 18650, which makes it difficult to add extra hardware, but it turns out it is just possible to fit a type-C jack in there above the driver. With this new feature it is now comparable to one of my other favorites, the Armytek C2, but more compact. While I was in there I replaced the microcontroller to update it to MELD (single channel) UI with battery and temperature monitoring, with a bit of extra code to handle the charging indication.


To start I cut a slot out of the back of the head to match the size and shape of a USB type C jack. These jacks are simplified versions for USB-PD only and have just six pins.


The slot is positioned so that the jack can be glued in flush to the shelf inside.


I positioned the jack so that it does not protrude past the surface of the outside diameter. It is secured with CA glue on the bottom and then reinforced with epoxy around the edges.


The charging circuit is a TP4056 set to 1A charge current. Here you can also see the resistors added to the CC1/CC2 pins on the jack which allow it to charge from USB-PD (laptop) supplies in addition to standard USB ports. The TP4056 is mounted inverted with CA glue and wired up with 34AWG enamel wire. In addition to the required power connections, the charging signal from pin 7 is broken out so that it can indicate to the microcontroller when charging is occurring.


I had previously reverse-engineered an H03 driver from the first one I bought so taking control of it was a quick project. Here is a photo of the driver with the stock microcontroller removed and relevant points labelled. With the stock part removed, you can take control of the driver by providing a logic signal to enable or disable the buck converter and one PWM signal to control the brightness. Optionally you can connect to the existing voltage divider to monitor battery voltage, and connect to the direct-drive point to implement moon mode. There is also a voltage regulator on board that can be used to power the replacement microcontroller. I later discovered that I was able to dim much lower than the moon mode hardware just by using PWM so I disabled the use of the moon mode pin in firmware.


I added one of my custom breakout boards that holds a PIC16F1575 (which is mounted upside down, so you cannot see the chip in this image) and wired it up to the required signals. As an extra improvement over the stock light I mounted a thermistor on the unused pads on the LED board to more directly monitor temperature.


After wiring up to the switch board and thermistor I temporarily connected to an external LED to test the hardware. At this point I confirmed that charging worked and made necessary tweaks to the firmware for the added features. The standby current draw was measured at 22uA. I forgot to measure the stock standby current for comparison.


Here is a glimpse at all the hardware installed and wired before closing it up. Kapton tape was added over the holes in the jack to keep dust out of the internal cavity. After this photo additional tape was added over the jack and charger to prevent shorts.


Looking from the LED side you can see that there is very little space left after pushing the driver into place, but all the new hardware just barely fits.


And here is the final product charging with a USB-C cable. The firmware is standard MELD-sc (single channel) which implements all MELD features except for UV and colors, but still has a color sub-menu for those that can be done with a white LED only (lightning, random strobe, and two safety flashers). The modifications for the H03 include voltage and temperature monitoring which can indicate error conditions using the red LED in the switch as well as ramp down or turn off the output if necessary. When the charger indicates that it is active, the firmware will turn the red LED on steady and ignore switch inputs (keeping the main LED off) until charging stops.

zeremefico
zeremefico's picture
Offline
Last seen: 43 min 9 sec ago
Joined: 03/27/2012 - 02:44
Posts: 1369
Location: Greece

Great work!

₪₪₪₪ ΟΥΔΕΝ ΚΡΥΠΤΟΝ ΥΠΟ ΤΟΝ ΗΛΙΟ ₪₪₪₪

My YouTube channel

Flashlights & edc gear

K40M F16

Nachtfeuerzeug
Nachtfeuerzeug's picture
Offline
Last seen: 3 days 5 hours ago
Joined: 08/31/2013 - 16:10
Posts: 690

Nice mod! What did you use to cut that hole in the side?

EDC

FW3A, SST20 4000K || S21A, Crescendo Mtn20DD, LH351D 4000K || SP32A, SST40 5000K

Recent/ongoing Mods:

S2+, TexAven 17mm, LH351D | S21A, Crescendo 20mm, XPL HI 5000K | L2 w/Mtn17DD Zener Guppydrv, XHP-50 | C8+ OP, DD XHP-50

SP32A w/SST40 5000K | TIR Upgrades | EagleTac clip | Ultrafire C2 w/6A 20mm & LH351D | S2+, Biscotti, Nichia 219C 2700K |

Reviews:

Sofirn SP31 v2.0 Tactical Flashlight (Cree XPL HI) || Sofirn SD05 Scuba Diving Flashlight || Sofirn SC31 USB Rechargeable (XP-G3) || Sofirn SC31 Pro 5000K

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

Nachtfeuerzeug wrote:

Nice mod! What did you use to cut that hole in the side?


Combination of Dremel, drill, and small files
chadvone
chadvone's picture
Offline
Last seen: 7 hours 28 min ago
Joined: 08/28/2015 - 23:48
Posts: 1870
Location: Iowa

Awesome!

I have misplaced my H03.

MRsDNF
MRsDNF's picture
Offline
Last seen: 2 months 1 week ago
Joined: 12/22/2011 - 21:18
Posts: 13473
Location: A light beam away from the missus in the land of Aus.

Not sure I love black magic but do love your work. Beer

 

djozz quotes, "it came with chinese lettering that is chinese to me".

                      "My man mousehole needs one too"

old4570 said "I'm not an expert , so don't suffer from any such technical restrictions".

Old-Lumens. Highly admired and cherished member of Budget Light Forum. 11.5.2011 - 20.12.16. RIP.

 

Jerommel
Jerommel's picture
Offline
Last seen: 9 months 2 weeks ago
Joined: 01/04/2014 - 13:18
Posts: 6380
Location: the Hague, Netherlands

That’s a pretty amazing bit of modding. Shocked

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

So awesome…

Trail Trek
Trail Trek's picture
Offline
Last seen: 17 hours 51 min ago
Joined: 06/05/2018 - 12:10
Posts: 87
Location: United Kingdom

Absolutely fantastic work!
Makes one of my favorite 90 degree lights even better.

gchart
gchart's picture
Offline
Last seen: 5 hours 49 min ago
Joined: 03/19/2016 - 11:57
Posts: 2884
Location: Central IL

Fine work on that, tterev3!

A couple questions:

  • What was that original QFN MCU? I will likely be reverse engineering the UT01 soon and noticed it has an attiny44 on board, something I wasn’t expecting. I’m not sure if I’m going to replace the MCU (likely with a attiny816) or design a whole replacement driver.
  • Where did you get that simplified USB-C jack? It looks like something I might want for future projects.

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

gchart wrote:

  • What was that original QFN MCU? I will likely be reverse engineering the UT01 soon and noticed it has an attiny44 on board, something I wasn’t expecting. I’m not sure if I’m going to replace the MCU (likely with a attiny816) or design a whole replacement driver.

I’m not sure, it’s a very small 3×3 package that was covered in black silicone potting so it’s hard to make out any markings. I’ll check again

gchart wrote:

  • Where did you get that simplified USB-C jack? It looks like something I might want for future projects.

If you search eBay or similar for “Type C Female 6Pin SMT” you can find them
tterev3
Offline
Last seen: 1 week 20 min ago
Joined: 03/28/2014 - 11:22
Posts: 309
Location: NC, USA

Here’s the original microcontroller. It’s a 3×3mm QFN-20 marked 3AQ20 which seems to be a Nuvoton 8051-based part

Kame Sennin
Kame Sennin's picture
Offline
Last seen: 9 months 3 weeks ago
Joined: 09/24/2018 - 14:38
Posts: 347
Location: France

Amazing work ! http://budgetlightforum.com/sites/all/modules/smiley/packs/Roving/thumbsup.png

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

Just to confirm…H03 has a separate e-switch PCB, right?

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

Agro wrote:
Just to confirm…H03 has a separate e-switch PCB, right?

Yes, with an indicator LED as well
Agro
Agro's picture
Online
Last seen: 1 min 18 sec ago
Joined: 05/14/2017 - 11:16
Posts: 6573
Location: Ślōnsk

thx

djozz
djozz's picture
Offline
Last seen: 43 min 7 sec ago
Joined: 09/07/2012 - 17:04
Posts: 17542
Location: Amsterdam

Very impressive, and a nice inprovement over the stock light! Thanks for posting about it.

Sirius9
Sirius9's picture
Offline
Last seen: 2 weeks 1 day ago
Joined: 03/04/2012 - 19:23
Posts: 4627
Location: South Europe

Wow, very nice work Beer

 

SKV89
Offline
Last seen: 6 hours 5 min ago
Joined: 12/10/2017 - 12:46
Posts: 4273
Location: US

Truly impressive!

djmcconn
djmcconn's picture
Offline
Last seen: 3 hours 29 min ago
Joined: 10/07/2011 - 23:04
Posts: 327
Location: North Carolina

tterev3 No wonder I’m such a doofus. You and Davidef used up all the brains here in NC! Excellent work and well done on illustrating the process.

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

Hi tterev3, hopping over from your D4v2 usb-C thread, how did you wire your tp4506?
The premade boards online all seem to use a whole bunch of capacitors and extra resistors but looking at your build, they seem completely unnecessary?

I’ve analyzed your wiring using your photos and a pdf from online and the best I could come up with was this:

Pin1: Temperature sensor pin- Connected to Pin 3 to bypass temperature limiting
Pin2: Programming pin- Connected to Pin 3 with a 1.2kohm resistor for 1A charging
Pin3: Ground pin- connected to USB-C Ground pins and Battery Negative
Pin4: Vcc- Connected to USB-C VBUS and Pin 8
Pin5: Battery- connected to Battery Positive
Pin6: Standby- not connected in your case. Would be used to to indicate the charging is done (Typically connected to a green LED)
Pin7: Charging (To indicate battery is charging (you’re connecting to your microcontroller, but typically connected to a red led)
Pin8: Enable- Connected to Pin4. Idk what this one does, enables the whole circuit to turn on? I assume connecting this directly to VBUS is enough to enable the charging?

Is my analysis correct? The perspective of your photo confused me a bit, and the documentation online was also a bit difficult for me as a beginner to understand.

Thank you, this was quite a long post for a very specific question and I understand if people don’t want to take the time to read it.

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

Sunnysunsun wrote:
Hi tterev3, hopping over from your D4v2 usb-C thread, how did you wire your tp4506?
The premade boards online all seem to use a whole bunch of capacitors and extra resistors but looking at your build, they seem completely unnecessary?

I’ve analyzed your wiring using your photos and a pdf from online and the best I could come up with was this:

Pin1: Temperature sensor pin- Connected to Pin 3 to bypass temperature limiting
Pin2: Programming pin- Connected to Pin 3 with a 1.2kohm resistor for 1A charging
Pin3: Ground pin- connected to USB-C Ground pins and Battery Negative
Pin4: Vcc- Connected to USB-C VBUS and Pin 8
Pin5: Battery- connected to Battery Positive
Pin6: Standby- not connected in your case. Would be used to to indicate the charging is done (Typically connected to a green LED)
Pin7: Charging (To indicate battery is charging (you’re connecting to your microcontroller, but typically connected to a red led)
Pin8: Enable- Connected to Pin4. Idk what this one does, enables the whole circuit to turn on? I assume connecting this directly to VBUS is enough to enable the charging?

Is my analysis correct? The perspective of your photo confused me a bit, and the documentation online was also a bit difficult for me as a beginner to understand.

Thank you, this was quite a long post for a very specific question and I understand if people don’t want to take the time to read it.


You got it exactly right. Pin 8 is just an enable pin, it needs to be pulled high to turn on the chip. Normally you just connect it to Vbus to make it always on.
As for the capacitors, it’s always a good idea to put one on Vbus and Vbat if you can fit them, but it will usually work without
Sunnysunsun
Sunnysunsun's picture
Offline
Last seen: 2 hours 16 min ago
Joined: 08/09/2019 - 12:51
Posts: 382
Location: Toronto

Great thanks! What would be the purpose of the capacitors? Also what size was your 1.2kohm resistor? I haven’t had any experience with smd resistors and it would be nice to buy the right size the first time.

Thanks again!

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

I am just curious, why did you decide to do small wires in a microscopic way, instead of just making a custom PCB for it? It may be a lot more tidy and more resistant to damage in future. However, big thumb up for the amazing work!

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

Sunnysunsun wrote:
What would be the purpose of the capacitors? Also what size was your 1.2kohm resistor?

Essentially the capacitors are to filter out noise. The charger needs a steady power supply to operate correctly, so the cap will smooth out any noise or AC signals that were induced by the USB power supply, stuff near the USB cable, etc. In this one I used 0603 resistors and in the D4V2 I used an 0402. If you are new to SMD soldering I would recommend starting with 0805 to make it a bit easier.

clientequator wrote:
why did you decide to do small wires in a microscopic way, instead of just making a custom PCB for it? It may be a lot more tidy and more resistant to damage in future.

Do you mean remaking a new driver PCB from scratch? Since I was modifying this driver, there was always going to be hand wiring involved. The charger is only a few connections, so it wouldn’t be worth the time for a PCB for the charger, plus there would be a lot of CAD and design iteration to get the size right to fit in with all the other parts, plus it would have to be a flex PCB to be slim enough to fit, etc.. I don’t think having wires reduces the reliability – there are always wires in lights of this kind, even in stock form. Plus, my microcontroller is on a custom PCB