Mod - GarryBunk's SecurityIng HD-016 (It's Finally Done!) - Pic Heavy

You are correct wight. That was my idea if we used a pin for temperature monitoring. Although 2 emitters at 2.6 amps does not sound like much, the light is very small and the bike may not always be moving. Also, Garry could decide to increase current in the future. So it seemed true thermal protection would be worth pursuing and that it should trump voltage indicator lights (but that is Garry's decision).

Hi all,
Have just discovered this forum and have been hooked on it for the past few evenings. I am an apprentice electronics engineer and find it all very fascinating. I have one of these lights and am planning on resistor modding then having a stab at an mcu. I’ve only ever used PIC mcu before and the attiny is completely new to me but when you come up with something that works I will most definitely be attempting to reproduce it. Thanks very much for all the work that you guys have shared thus far and please please see this project through to completion.
Regards Jacob

Welcome to BLF Jacob! We might be scrapping the idea of the custom driver and instead utilizing the newly available KD2 10 Step programmable driver. Well it will still be custom work as the KD driver is not a direct fit.

-Garry

Hi 180jacob. Sounds like you bring a very needed skill set to the hobby. Looking forward to seeing what you eventually set out to do. We only have a couple PIC programmers here. Some of the PIC's seem have some nice advantages over the Attiny's. It would be nice to see the hobby branch out that way. Right now, all the momentum seems to be with the Attiny13a. I don't know if we have any electronics engineers here on BLF.

This build be be completed. We're currently trying to figure out the best MCU/FW to use to give the light the most desired functionality. I really hope we develop a nice open-source FW/Hardware solution. One option, as Garry mentioned, would be to transplant the MCU (and I think eeprom chip) from the KD2 to the host driver. Garry will be evaluating the UI, mode separation, etc and then will make a decision if we will go that route. It does seem like a very attractive route as the KD2 driver can be had for about 8 bucks. If we go that way, I'm thinking of using the brainless KD2 driver to drive a couple off-road lights on one of my cars.

Garry has opted to utilize the MCU from the KD2 10 Step programmable driver. For any not aware, he requested KD make the driver available separately from the light. Last I checked it was $8.

After playing with the KD driver a bit, I have to say it is a pretty cool driver. Programmable levels, thermal and low voltage protection, and indicator lights basically cover all the features Garry wanted. I really like how it smoothly ramps to the next level.

I've spent a good amount of time trying to map out the circuits on the KD driver so that I can determine what needs to be done to transplant the MCU to to the HD-016. It's been frustratingly difficult due the black masking and traces running under components. I finally had to resort to sacrificing the KD driver by sanding off the masking.

This will be a pretty involved driver mod because it will require at a minimum that the MCU, EEPROM chip, and some resistors be transplanted. Another complexity is that the pin outs are completely different and almost every pin of the KD's MCU is used. There will be a lot of air wiring. There are some other circuit differences that may need to be addressed as well. I also hope to transfer the Red, Yellow, and Green indicator LED's as they have different meanings for programming and voltage indication. Not sure what the HD-016's green GITD cover will do to the colors.

Here is the driver with the toroidal inductor removed:

Driver with mask partially sanded off:

Here is a first draft of the KD circuit. It was written down as I studied the sanded driver and compared to pictures of the unstripped driver. It doesn't include some of the buck portion of the circuit as the HD-016 will provide that. I still need to verify the accuracy of the diagram. Once verified (hopefully tonight), I will compare the the HD-016 circuits and formulated a transplant plan.

Hopefully all goes smoothly. I will update the OP with a summary of all the mods once completed.

I’m glad to hear it’s moving along. I’ve been sick for about two weeks and barely managing to keep up with work, so I haven’t really stayed in the loop.

ImA4Wheelr, great job. I like that KD2 driver much and it's nice to see the drawing of it. Hopefuly you'll do it like this at DX forum (pic.source http://i.imgur.com/WzPgF8g.gif). It has identical user interface, but it's boost driver for 3 to 6 leds in series.

Maybe this drawing would help you somewhat.

Thank ledoman. That may be very helpful. Do you know if there is a free program out there that would enable me to create a diagram like that for the this KD driver?

Unfortunately not. I'm not EE, just end user of those driver.

Maybe Eagle can do that for me. I need to study this thread by Mattaus.

Your diagram will be good for verifying mine for the relevant parts of it. Thanks again ledoman. :)

Glad to see progress ImA! Sorry this project has become so difficult! I didn't intend to torture you when I asked you to take this on!

-Garry

No worries. Learning a lot. Hoping to wrap this baby up this or next week.

Eagle can do the diagram. IMO using a CAD program like Eagle is much less frustrating than attempting to map out an unknown circuit on paper.

I think jotting down observations on a piece of paper seems much easier than burning time searching for library elements for an unknown MCU and other components. Maybe for a more complex circuit, but for our drivers a sketch seems adequate.

Would be nice to document all tidy and all for future reference though.

One factor is how well you understand the circuit to start out with. The better mental image you have of the circuit, the easier it is to draw in either format.

There’s no reason to go running around looking for library components. Just pick something that uses the same package and go with that. It’s not like someone is going to flip a power switch on your Eagle schematic: it’s just a representation. More experienced Eagle folks may normally just make any missing parts, but I don’t usually bother for a schematic.

Number of components that will be swapped over is 15. Actually, 13 swaps and 2 additional components (EEPROM and a 30K resistor) will be added. Six of the ten swaps will be resistors, three the colored indicator LEDs, then the MCU, EEPROM, thermistor and the tantalum capacitor. I'm not crazy about tantalum capacitors, but since it is part of the MCU's and the EEPROM's power supply circuit, I will error on the side of caution and swap it over.

Heaps of air wires will be needed. Some traces will need to be cut and new "traces" laid down for the indicator LED's. They are feed a positive charge from the MCU on the KD driver, but a negative charge from the MCU on the HD-016.

If I was handy with Eagle and Gerber files, I would make an adapter PCB for the MCU. Well, maybe not. I don't think I would want to wait for an order to be fulfilled. I'll air wire and secure wires/mcu/eeprom with a little silicone.

I noticed my diagram does not show the tantalum capacitor connection to B-. I will eventually make a nice diagram for future reference and post it. I'll try to do it in Eagle.

Hi, I’m new to his forum and first I would like to thanks ledoman for his great review of this light, ImA4Wheelr for his reverse engineering job and others for their contribution to this thread. I’m engineer in electronics, hobbist and embedded systems programmer, and I’m the recent owner of a HD-016 from Gearbest that I bought for my mtb. I’m very interested in modding this light, and I would like to add my “little grain of sand” to this thread. It seems to me that the stock MCU is an Attiny 24, (VCC and GND pins match Attiny pins, OC1A and OC1B, (ATtiny PWM outputs), are tied to led1 and led 2 PWM controllers, maybe Aref is VCC and not internal ref…), so maybe the best solution would be to reprogram the stock MCU using ISP pins. I will try to read it’s firmware,maybe it is not protected, but even if I couldn’t, it would be very easy to program a new custom firmware.

This weekend I will try to make some photos of my semi-modded light.I have improved thermal dissipation using thermal compound and two pennys attached to the back of the pills.

Ledoman, I like your idea of connecting both pwm’s in parallel and use a combination of Rsense’s, but I’m not sure if current regulation will be stable. I will give it a try.

Sorry for my bad english,

Jose Luis

Welcome to BLF Jose! Glad to have your contributions. Feel free to post up pics of what you've done.

-Garry

Jose Luis, welcome to the club ;-). it would be nice to have some EE here helping us (and yourself) solving electronics issues. We are mostly lack of that knowledge.Please see my post 100 with plan of another driver with same user interface as KD2 driver has and there should be the same chip IC4 regardless it is a boost driver.

Please rethink about my idea using both output circuits combined. Probably there can be some interference, but since there should not be any PWM this should not be an issue. It is just if the current from one circuit can interfere to another. Diodes should prevent that, but please take a closer look. Thanks. Of course I would also use different sense resistors in the case this idea should work. This would eliminate a lot of hassle to reprogram IC.

Hi, I have tried to communicate with MCU by using both TPI and ISP modes, but with no luck :frowning: ,may be it is a PIC, and I have no experience working with pics, only with AVR’s. Next step will be combining Rsense resistor and put leds in parallel, but I need to find SMD resistors with low values.