A small 17mm led battery guage, *first pcb design*

  • I’ve spent the last few evenings trying to sort through different circuits and figure out voltage dividers and this is where I am.
    Copied here for reference:

EDIT Note: each opamp turns on when the voltage on the + pin is higher than the voltage on the - pin.

.p If I change R1 from 15K to 6K then by the formula for a voltage divider all of the + inputs would see (10K/6K+10K)Vbattery or .625Vbatt.

.p If I use a 5V Zener for D1, then with an 8.4V supply D2 lights at Vbatt> 8.0V since .625 x 8 = 5.

.p If I then adjust the 10K pot to 5731 ohms, with the remaining resistors unchanged, the other trip points become: 7.3V, 6.6V, and 5.9V respectively.

.p QUESTION Could R1 and D1 be replaced with an LD7981 5V 100mA voltage regulator that also controls the input voltage to the LM324?

.p If that were the case then I could maintain 2mA to each led as it lights regardless of battery voltage.

.p The current consumed would be 4 x 2mA + 2-3mA for the LM324 + .4mA for the 7981(or 1-3mA for Zener + R2) +…64mA across R1 & R7 = 12-15mA.

.p How I got here:
I wanted all the LEDs To be on down to 8V and I wanted to use an LD7981 5V. That provided me with the ratio .625 to recalculate R1. I the chose my trip points .7V apart and used that voltage drop to figure the current through one resistor R3 at EDIT(.7V x .625 / 680) =~.64MA.Then I divided the Zener voltage by this current to get the total of R3-R6 and from this total subtracted the 3 x 680 ohm R’s to get R6. -EDIT-To get the most accurate value for R6 I should probably use a 5.5KR and a 500 ohm linear pot.

I’m going to wait a bit or until someone with a clue can verify ALL^ before I do more just in case I have it all wrong.

I’d probably try to do that in the MCU, just like the NANJGs do it, but with a matching voltage divider. With the 3 unused pins you could control 3 LEDs easily or up to 6 LEDs with some more effort. How abour a duo-LED or a RGB-LED?

I like that and it would be great but seemed above my current ability. Since this is in parallel with that OTHER idea (which works due mostly to your suggestion of the 7805) I was just taking a baby step in that direction. What would be really nice would be to replace the tailcap switch pcb and 105C(or like driver), and this gizmo with a single board. I know it saves wire but it just seems like poor design to put both heat sources(LEDs and 7135’s) back to back in one pill. I think it might be fun to share the development of that idea(or another) with a few others as a sort of BLF family letter both to share the cost and pool skills while sharing the knowledge in the forum.

  • Back on thread I chose 4 LEDs initially to give trip points for switching out drive resistors and to let me know when I should switch to low mode and when to replace the pack. 3 LEDs just limits the amount of info displayed.

I am probably misunderstanding this but the max Vdrop across R2 is 14V - 5.6V = 8.4V, divided by R2(1.2K)= 7mA.

  • Across R1 + R7 = 14V/25K = .56mA plus some nanoA input currents.
  • The ratio for this circuit is 10K/(10K + 15K) = .4. .4 x 14V = 5.6V hence 5.6V Zener. D2 wont be on for long. .4 x 13V = 5.2V which is .4V less than ZenerV so R3 = 680 ohms dropping .4v has .4V/680 = .59 mA plus some more nanoA bias current.
  • 5.6V drops across R3-R6 is .000588A so R6 = (5.6V/.000588A) - 3(680 ohms) = 7480ohms hence 10K ohm pot.
  • Total losses not including LEDs and quiescent supply is < 9mA.
  • The choice of R8-R11 will determine Io and the LM324 is rated at 3mA or less(don’t know if this is per opamp or for the whole IC). So the whole could easily be less than 50mA.
  • EDIT- You are quite correct that 50 mA is much to high a drain to leave on the battery all the time. I had assumed but not stated that this gizmo would only function when the light was in use. I know that voltage dividers are only accurate when the output urrent (in this case the bias currents) are small relative to the divider current. How small is small enough? I read that errors can occur when the ratio approaches 1/10. Is 1/100 enough? This would in essence reduce the power consumption to that of the LM324 and LEDs alone as the rest would be less than 1 mA

I just found a site Oshpark that will make three copies of a two-sided board for $5/sq inch. They “batch” different orders together to save set up cost on each. That’s $5 for three copies, wow! By varying the resistors I could make one for 1s, 2s, and 3s li-ion. I assume shipping would be extra.

The question now is do I use Eagle or Gerber. Any recommendations?

If you have a modernish inkjet or laser printer and are planning on using eagle CAD program i am sure you could make the PCB’s yourself with this stuff

http://www.ebay.co.uk/itm/12xA5-6x8in-Dry-Film-Photoresist-Developer-Remover-Kit-for-PCB-Photo-Resist-/300706676221?pt=Vintage_Electronics_R2&hash=item460383bdfd

i bought some (from china tho the same)and its awesome stuff, even if you are not doing them yourself buy some anyway i love it!
I consider it better than the toner transfer method and cheaper than sensordised pcb’s. plus if you heat it above ~160c it turns dark blue/black and goes really hard which is handy for lettering panels etc.

I am using the free eagle but couldnt make it work at first, so started watching the beginner tutorials on youtube and have got the the stage i can make simple surface mount pcb’s no problem, this is how i do it with that great dry film mask stuff.

I dont use all the fancy laminater and exposure stuff a halogen light bulb exposes it just great.

Good luck with your project.

Sweet find on the oshpark thing. Wish I could contribute more to your apparent progress man- you are really moving here. Love to follow your work and progress like this so thank you for sharing this stuff :-)

I’ve used them for many boards. They do excellent work.

Eagle is a schematic capture and PCB layout program. Gerber is a standard format for generating images of the PCB traces. Eagle (and most other PCB laybout programs) can produce Gerber format files (and drill files). The nice thing about using Eagle with this service it you don’t need to go through the steps of making the Gerber files, they can do it directly from the Eagle files. Producing Gerber and drill files can be a bit tricky and error prone… every board production house seems to have their own requirements for what they expect.

I love this forum. You guys are the greatest.

  • Major, I have an HP Photosmart C4680 printer, scanner, copier. Will that work? Thanks for the links. I’ll watch them.
  • Texas, thanks, that’s the sort of detailed info that leads me on and helps me grow. Like a QB leading a receiver. I understand enough to reach for more. So you’re with Major and would reccommend learning to use Eagle?
  • Ledsmoke, I get so much info and entertainment from all the threads here, from the daily joke thread to the welcoming committee plus all of the fantastic mod work done that its nice to find a gap where I can tuck my shoulder in and push. It’s pretty slow going most of the time but that’s how I work. Read and learn up front, then apply and learn some more by doing.

I think the HP is an inkjet not laserjet so may just try Oshpark if I can generate a decent file in Eagle. The rest of the parts are pennies.

I’ve loaded Eagle freeware onto my laptop and have read the tutorial from end to end. I’m taking it on faith that after 2 or 3(maybe 4 or 5) more read throughs it will start making sense. There are quite a number of terms that are not part of my vocabulary and it will take a while to burn in my organic eprom. While its possible to make a pcb with a pen, in order to get the board size I want I’ll need to learn some kind of software to generate the narrow traces and ic footprints needed. Unless someone expresses an interest (or I get stuck) I will avoid posting the gory details and stick with pictures and short sentences like: Is there an Eagle for Dummies anywhere? And Why is there no glossary in the tutorial pdf. The circuit above is certainly not complicated so as soon as I get a handle on the toolbars and commands it should go quickly(dream on McDuff). :Sp

I’ve been sadly neglecting my homework with eagle however instead I drew it up the old fashioned way to see how the pieces would fit. I started by blowing up the scale by 10:1 and laying out the footprint of the quad op-amp and going from there. Right away it became obvious that I would have to use the resistors as jumpers to generate a one sided board. This is desirable so that I can stack this board on a 105C and put the battery spring on the bottom of this board. After dinner I will edit this post to include a picture of my artwork. I’m pretty certain that I will be using Oshpark to make the boards as my minimum trace width is 16 mil and the minimum spacing is 12mil and I’m not confident this can be done with photo resist and for the price it’s not worth trying. Maybe another board but not this one.
There are some extra lines in the middle where I decided to add copper to the input and ground traces. The Zener diode has been eliminated in favor of a 5 volt regulator chip and I’m using 1% resistors instead of a pot.

very inspiring! I may end up going a similar route for a wireless remote receiver if I can’t find what I want commercially. The 5V chip you mentioned - this is to provide the 5V power supply for the board, right? What’s the input voltage (higher, I’m guessing)? Getting the right voltage to a receiver from a 2S li-ion battery is proving quite a challenge.

Dr Jones was kind enough to clue me into the 7805 chip in my other thread 7135 drivers at higher voltages
It works from ~7V-30V and looks just like a 7135. For a 2s battery I’ll use a similar chip, the ld2981 which should work from 5.2V-16V. The dropout voltage is much lower (.2V@100mA-.007V@1mA) on the 2981 which allows it to work down to full discharge. The 7805 has a 2V overhead so it works with 3s or more. Both chips are available from Mouser but I bought the 7805’s off eBay. The 2981 also requires capacitors that the 7805 does not. They are available in different output voltages.

interesting, thanks!

Making progress. I’ve managed to do the schematic capture part and now need to turn it into a board file. One neat thing about this design is only 2 resistors(R1&R6B , see paper pcb layout) need to change for different battery voltages. I think I’ll change the orientation of R6B to make it easier to access. I think I may increase board diameter to 17.5mm to give me room for I/O capacitors. This might give me room for a second ground ring via to better connect/support the pcb on the driver pcb. I’d remount the + spring on this pcb. The most current working idea is to set this board up so it stacks on a 105C board. The LEDs are in a 90 degree arc so would all be visible at the same time.

Stayed up into the wee hours plunking away. The good news is that the software seems to work properly. The bad news is that my soft tissue is slower on the uptake so I keep doing things over as I learn. I’d show the progress but I haven’t figured out how to copy the board file page. The 0805 solder pads are too large and I need to either resize them or create a new library device that has the size I want. I wonder if an 0805 jumper has smaller pads.

You sure are tenacious Scott.

Though I don't completely follow what you are saying here I do understand that you are still making progress. Personally I'd love to learn about this but I figure that I'd never get to use it anyway. Already I never have any time for simple mods so this? Way beyond me. But when you get it to work it sure will be something else. I can't help but wondering how I might incorporate it into my beloved X7.... :-)

Although I’m not designing this to sell, I am trying to make it possible to add it to an existing light if anyone wants one. Hence the small diameter. Last year I spent way too much time on Sudoku puzzles and spider solitaire. This is much harder and I Learn something new as well. That OTHER mod, the one with 7135’s is ready to go. I’d like to have this ready before I actually build a light even though I already have an idea cooking: quad XTE or XPG on a 25mm Cutter board 2s2p from 2s 18500’s using a 105C with each side of the board pushing 1.2A to each pair all in a copper headed host. I need to finish before post #1000. What a mouthful. I just found out I need to create my own “library” chips in order to make all the solder pads fit on this penny sized board. 12 resistors, 4 LEDs, a quad opamp, and the VR chip. Single sided of course.