BLF17DD Info Thread - Reference

Ouch - this hurts Cry. All I know is that the zener mod drivers I built all had my firmware with voltage monitoring and I had thought it worked, but found out later it's all off. So, I thought it was fixable by using different threshold values based on 2S or 3S cell inputs.

I'm afraid if I look at voltage divider circuitry, I won't understand a damn thing about it. Think I'm lacking some of the basics here... Sorry Richard, I have no idea where this leaves my understanding of this issue. No possibility or add a compensation? I'm 110% confused...

For starters, here is the voltage divider math you use to figure out which ADC value to tell the software:

ADC = ((V_bat - V_diode) * R2 * 255) / ((R1 + R2 ) * V_ref)

IF DIODE PRESENT

So for our typical 125 or so ramp down at about 3V at the battery, we get this:

126 (rounded) = ((3V-0.25V)*4700*255)/((19100+4700)*1.1)

OK, now take a look at a picture of your standard 105C driver or even the regular BLF17DD. You will see that the voltage divider circuit positive input runs through this sequence:

BATTERY-->SCHOTTKY DIODE-->VOLTAGE DIVIDER-->MCU

The Schottky diode drops the voltage by about 0.25V (it's forward voltage). So, we compensate and tell the software that we want to ramp at about 0.25V lower than what the divider seeing and converting into the lower voltage for the MCU to check against its 1.1v internal reference voltage.

If you take the diode out, you get this sequence:

BATTERY-->VOLTAGE DIVIDER-->MCU

There is no longer the 0.25V drop across the diode, so no compensation is needed.

With the zener mod on the normal circuit, here is what we get:

BATTERY-->RESISTOR-->ZENER DIODE (parallel)-->VOLTAGE DIVIDER-->MCU

Since the zener diode is going to be regulating at a constant 4.1V (the 2S input voltage will always be far above that) the voltage divider will only ever see 4.1V. If you bypass and just go BATTERY-->VOLTAGE DIVIDER-->MCU you don't have that problem.

Again, voltage cut off really isn't a big deal on anything except for buck drivers as long as you are monitoring the light, since you will see it getting very dim before the batteries get too low.

You can use a wide variety of divider resistors, as long as the ratio is correct for what you want. Higher value resistors are generally better. Let's do a quick example for 6V with a R1 of 30K and R2 of 4.7K:

188 = (6V*4700*255)/((30000+4700)*1.1)

The higher the value of resistor the less loss you get through the divider. You also want to end up at a higher ADC value such as 180 vs. a value like 50 for better resolution.

I agree with RMM, he is pointing out the same problems I’ve brought up in other threads. Running the voltage divider from behind the D1 placement is a bad thing. I only did it on the 22mm 7135 driver because I didn’t feel like having the conversation about either adjusting resistor values or ADC values or both. This will be a struggle for a while.

To be 100% clear: Tom E, you CANNOT get voltage monitoring to work with the traditional “zener mod” layout. Period. Modifying the voltage divider’s WIRING can get voltage monitoring to work. Modifying the values alone (of the resistors or of the ADC threshold) will not make anything work.

A voltage divider has 3 points: Vin, Vout, and GND. Proper wiring for a voltage divider is like this:

  • Vin is connected to the high voltage which we need to measure
  • Vout is connected to our MCU or other measurement tool
  • GND is connected to GND

Unfortunately the default layout of a Nanjg 105c hooks up Vin to the back of D1 rather than to Battery+. In the case of a stock Nanjg 105c this just results in a lower and possibly inconsistent reading. Once the traditional Zener mod has been performed however Vin is now connected to a semi-regulated voltage source: the voltage the Zener produces. This will tell our measurement tool nothing.

The proper place to hookup Vin is Battery+.

EDIT: grammar, oops.

Ok fixed (along with the 15, 15.17 and 20).

To answer Tom’s initial qestion, I am using all of the 3.0’s, I am running the 15, 17 and 20 (with the vdivider downstream of D1), the only change I made was that one thing, changing R1 to input VCC directly from BATT+. I have more of each ordered (tho I’m 100% sure its fine)

I was one of the people that just didnt feel like messing with it on the zener mod’s I did with the old drivers…

edit: sorry it took so long to answer (tho Wight and RMM definitely had it under control), I have been having an extremely busy week and today was the worst so far, I still have 3 threads on totally different subject’s I’ve promised people I’ll have posted by today.

I'm sorry - I studied the classic Nanjg layout, re-read posts #125 and #126 above several times. another biq Q: where is the VOLTAGE DIVIDER??? All we have is resistors, a diode, and a capacitor, and the MCU? It can't be done in a classic layout, then what's the magic layout it will work with? And if it exists, why doesn't it exist in our custom boards?

I think I need pictures or something...

The Voltage divider are the 2 resistors 1912 and 4701. Together they determine what the voltage drop is over the cell. Is that right?

Tom. I hate to say it, but it has been right under your nose the whole time...

Yeah, I am gonna link to Wikipedia.

What are the chances of that- today I neded a 22, boards ordered, if they run I’ll share them in about 2 weeks.

Ok - "think" I understand this better. The C_K (Dan) BLF 3.1 version here on OSHPark is now 100% - no objections? I see he's got the "voltage divider", i.e. the R1 and R2 resistors, totally independent of the diodes, either standard Nanjg or zener. So to do proper voltage monitoring, you will have to remove the 0.25v subtraction because it's no longer in the monitoring circuit. So this will effect all voltage monitoring that was previously based on the standard Nanjg layout, but in theory you should be able to do voltage monitoring with the zener mod configured.

Another issue I see is the e-switch is wired to pin #3 (PB4) of the ATtiny13A where previously we mostly used PB3. But you don't have to use his provide labeled SW+ pad, so I don't see a big problem there.

Also, there is no reverse polarity protection coming in on pin #7 of the ATtiny13A as there was before - I don't "think" this is a problem. Anyone care to comment?

Well I need to order more boards in all sizes, so, I think these latest from C_K are the best way to go. I was hoping for some feedback/comments before ordering... What he has listed in post #114 sounds awesome.

Ok - just order 3 of 15's, 6 of 17's, 3 of 20's.

Hey you think you could update with a digikey parts list for those new boards? Wonder if RMM will sell a updated kit soon too. I’m going to start making these too- looks like slapping lipstick on a pig really. Too expensive having them reflowed but I like supporting mountain.

My in-law is a contractor and does a lot of soldering. He had something else to do one day and asked one of the other guys to solder some boards up. He came back and the guy didn’t even solder the base- like big solder balls on all the ics xd Nothing was soldered. I thought that was funny- he called other day.

Wait - what do mean exactly by these new boards? The C_K boards, rev 3.1 shown as 3.0? (Confusing to say the least...)

The C_K boards are just a different layout than the standard BLF v1.0 boards, so it's the same exact parts list.

As far as I know, the parts list I link to in the OP at the very top (4th line) under the July 12th comment is the latest parts list and will apply to the C_K 3.1 boards as well. comfy re-posted the identical parts list link in post #92 for some reason, but he's got a very good explanation and description of the parts and the OTC option (OFF Time Capacitor) listed in that post #92 - please refer it to for more details.

Richard (RMM), as far as I understand now, does not use the same BLF 17DD or C_K boards - he's got his own versions, to his preferences, but they are close to the same thing, same parts list I believe.

I think the current state is 3 current sets of boards:

  • the standard BLF DD 1.0 boards as listed in the main OSHPark thread, by Mattaus, Comfychair, and Warhawk-AVG
  • RMM's versions, layout to his preferences
  • C_K's versions - latest rev is 3.1 but pictured as 3.0 on OSHPark

In my opinion, it looks like C_K's are the best, but the latest 3.1 versions are not actually tested, but C_K is very confident (100%) in them. I ordered C_K's boards but won't know of any issues or details til I get them and work with them.

Just to point out- yes I forgot to change the silkscreen on the board (still says 3.0) but the OSHPark upload is titled 3.1.

As Tom says I’m totally confident these work (Obviously I’ve designed a few other pcb’s, this is actually one of the simplest designs). I also still have a large quantity of 1.0’s left on hand- if anyone ordered a set of 3.1’s and they don’t work perfectly I will swap you for 1.0’s (one final time- you’ll never have to take me up on this).

Ah ok… Thanks Tom and CK- It does get kind of confusing because reading posts and you said something about voltage spikes using 100 ohm resistor over 130. It looks like the one from RMM is 100 ohm. I didn’t know if the parts actually changed. So the divider will allow you to run a MT-G2 with voltage monitoring. That sounds pretty cool to me :slight_smile:

Well there’s not a lot to give feedback on, BLF17DD is already pretty well established.

  • The GND plane work makes sense. Overlapping a plane with thermals for the low-power components with a plane which does not use thermals for the power components is a sensible way to handle things. The dirty secret is that leaving off thermals for the power components is really more of a style thing than anything else anyway. I think that you could use thermals for the entire board and not find a measurable difference in output. Still, nice work.
  • I don’t like R1, R2, C1, D1/R3, or OTC. They are all 0603 size (except D1/R3) and I’m not down with that. D1/R3 is just using that tiny SMD diode footprint, eww. I know a lot of us do reflow, but there’s plenty of space to use fullsize pads IMO. Hand soldering, rework, etc suffer with unnecessarily tiny pads.
  • The implementation of stars is misrepresented by the OSH Park render, but I think it looks like a good idea. That said, and without having used it, I’m not sure how functional this implementation of the idea is. Both exposed copper areas are very small which may make it difficult to deposit enough solder to get it to bridge cleanly. The placement of the circle is not really consistent across the 3 points where it is present, and since it’s such a small area on one side of star 2 and 3 there may be a risk of one side not being present at all due to manufacturing tolerances. Since there is space for it it would be more ideal to implement these jumpers in this way: Solder Jumpers
  • As has already been pointed out, I don’t know why there is a SW+ on Pin3. It’s not an issue though, AFAIK, because the OTC cap pad gives the appropriate Pin2 connection for SW+. Maybe Cereal_killer is thinking of a modification of the Dual Switch firmware which I’m not aware of.
  • All the connectivity tweaks seem reasonably well thought out - large GND via, adjustable BAT+ spring pad, doubled vias for BAT+ and LED-. Nothing that interferes with anything, all potentially useful in one way or another.
  • I find that all components have been set back a reasonable distance from the edge of the board. The next big tweak is to stop using an off-the-shelf library part for the FET. I find the existing library parts to be much larger than necessary. This would save a lot of space on top and make it easier to support a 0805 sized OTC without interfering with driver ledges or an SOIC8 clip.
  • I prefer C_k’s C1 placement in his “dd V3.1” board versus Mattaus’s C1 placement in the latest “DD V1.0” board. It’s not a big deal and it’s probably inconsequential in this case, but I’d say it’s definitely superior.
  • That reminds me - Cereal_killer: you forgot to update the silk, the boards still say V3.0!

Overall I see no show stoppers. I wouldn’t expect any either, so no surprises. Some here are proponents of setting 0805 sized components on 0603 sized pads, I’m not. That’s my biggest beef by far (since I rarely/never use stars).

eh, guess I’m a little late to the party in mentioning that :wink:

Cereal_killer’s board does not use either resistor (100 Ohm or 130 Ohm). Neither do the “DD V1.0” versions which Mattaus and Warhawk-AVG put up.

It’s worth pointing out that the RMM boards you refer to were both designed before the FETs and gate resistors - scope images thread where the new cap position was worked out. That’s why both boards are positively littered with unnecessary resistors - it’s also why “RMM17DD_V2” still has the old cap position and after-diode voltage divider. On the “RMM17DDZ_V2” board the voltage divider is fed directly from BAT+ but the C1 location is still behind where the diode would be if you built it as a regular (non-Zener) driver. Anyway my point is only that RMM’s versions were laid out to his preferences several months ago. I could be wrong, but I assume his current preferences would be very similar only without all the unnecessary resistors and with the C1 position change.

Yeah I see that difference from CK version here. Well I have a couple of RMM boards here. It looks like the voltage divider is put after the diode on this one. CK it’s strait to batt like you said wight. Ok I get it now. So wight what if you just put in 0805 in there. Would that be a better solution. I just want something that doesn’t break. Had the FET go out on one of my 17DD recently. I dunno how it just got stuck open at ~50% to ground. The gate doesn’t work anymore

EDIT I think after some reading… Just going to replace that 100 with the 130ohm on mountains driver. That spike Tom is talking about is interesting to me. There’s no other reason I can see why that would happen to the fet other than the gate was bombed?

thanx wight for the info and review! Didn't know the pads are for 0603's, not 0805's. His OSHPark listing indicates to use 0805 size parts. I see the RMM version boards listed under Mattaus's project listings on OSHPark but not sure where else they were described - maybe buried in the RMM sale thread.

I’m sure that Cereal_killer’s intention is still for you to use 0805 sized components. They will sit on those smaller pads and can be soldered to them. I would use 0805 sized pads for those components. (An alternative would be simply transitioning to 0603 sized components to place on those 0603 sized pads, but I don’t see why I’d bother. I’d rather just use 0805 on 0805 pads.)

It’s not really clear what is going on with your malfunctioning driver. What do you mean 50, is the LED about 50 as bright as normal? Do you no longer have modes? Is there continuity between LED- and GND while the driver is turned off?

I’m not certain what you mean by “bombed”. That resistor is in place to protect the MCU from FET, not the other way around. What spike are you referring to? Please link me and provide a post number.

I have a thread on it lemme get… BLF17DD Troubleshooting

It’s the FET but I haven’t tried measuring LED- to GND when off… I tried a few other things though including a new driver wired to the FET to eliminate the mcu