UPDATE 20170716: fixed library and PCB to produce correct solder stencil
UPDATE 20170713: added more info about the battery holder and inductor substitutions, with links to the original parts, and info about the case screws.
UPDATE 20170712: added assembly instructions
UPDATE 20170712: added the 3D printed case design
I should have done this months ago - V2.2 fixed the reversed MOSFET of V2.1, and is basically a complete design, so here it is.
I was going to re-do this in KiCAD, but I got frustrated with it again (third or fourth time), and just paid the $100 for a years worth of Eagle. The hardware and software design is in the GitHub repo.
You can order TritiLED V2.2 boards and V2.x programmer boards from OSH Park. If you have an SOIC-8 programming socket, an SOIC-8 test clip, or don't mind temporarily soldering wires to the ICSP pads on the boards for programming, you don't need the programmer boards - they just let you connect the ICSP lines with pogo pins.
The V2.2 circuit adds a 100-ohm resistor in the battery supply before the reverse-protection MOSFET as discussed in a previous log:
I need to add a BOM in the GitHub repo, but here are the components listed out
The inductor and battery retainer are substitutions from the original parts I used. The battery retainer is a slight upgrade, being gold instead of nickel. The original nickel part is also available:
(1) Linx BAT-HLD-001-TR CR2032 battery holder. DigKey part # BAT-HLD-001-TRCT-ND $0.73 each.
I have not received any of the gold battery holders yet; from the datasheets they appear to be exactly the same except for finish material.
The inductor is simply more expensive, but with the same size and specs: the old one is not stocked at DigiKey anymore. They are in-stock at Mouser:
(1) Bourns SRR6028-102Y 1mH inductor Mouser part #652-SRR6028-102Y $0.68 each
Again, I haven't tried the Wurth inductor on boards yet, but they appear to be identical parts from the datasheets.
This adds up to $8.35 in materials for single-unit quantities (battery not included: add $0.29 for that). If you build 100 of them, you can get it down to around $6.27 (batteries included :) The older inductor was only $0.68, but DigiKey has 0 in stock with a 22-week lead time - that would save almost $1. The MOSFETs could probably be substituted with cheaper parts, too.
You could save some money by removing the P-channel MOSFET. Reversing the battery might harm the PIC then, but wouldn't cause anything to overheat because of the 100R resistor. You could substitute a shunt diode as a reverse-battery protector, too. After the resistor, it would conduct with a reversed battery to spare the rest of the circuit. You just need a diode with low reverse leakage - even the 1N4148 has a 50uA maximum leakage! The B-E junction of BJTs is supposed to make a better diode for this kind of thing. Still, maybe you shave 10% off the parts costs, not that impressive.
Here's where all the parts go on the board. There are only a few you can screw up: the two MOSFETs, and the 1206 R and C, so watch out for those.
You can check out this other log for ways to program the PIC. You need a programmer (PICkit3's are available cheap on ebay), and some way to attach to the IC or board.
I put together an experimental case design in OpenSCAD. A case is important to protect users and the environment from the battery. Without a case, the battery might become loose and be a hazard to children or pets, or the contacts could short on nearby conductors. You must not leave these devices anywhere as markers if the battery is not secured in an inaccessible manner. The case uses screws to keep the battery where it belongs.
Here is what it looks like in OpenSCAD. You can see the details better in the rendering, because I usually print them in black, which doesn't photograph well:
The V2.2 design works well, and I think 5 years on a CR2032 is probably "good enough." What I'd like to see is smaller and/or cheaper designs. I can imagine forking the design to move in both directions: a cost-is-no-object tiny version, and a cost-reduced, but maybe bulkier one.
Moving back to a chip-on-board LED would help with the size, although the Luxeons I like (Z and C) are $2.74 each in single quantities.
Using a smaller inductor would reduce size and cost and increase efficiency. The problem is that the PIC, in its lower-power 500 kHz oscillator mode, isn't fast enough to produce the short current pulses required of low-value inductors.
What I'd like to try next is using the PIC running at 31kHz, which is the lowest-power clock it can do, still waking from sleep periodically using the WDT. This should dramatically reduce the PIC overhead current drain. To shape the short pulses for the MOSFET drive, I'll try using the 74AUP1G14/differentiator trick from the previous log. That part of the circuit had negligible current drain even with a 3V supply. Moving to an external pulse shaper will allow shorter current pulses than the PIC can do at low clock speeds. Shorter current pulses will, in turn, allow lower valued inductors which are cheaper, more efficient, and physically smaller. In this way, you still retain the flexibility of a programmable part but may be able to reduce the current overhead.
I think I feel a V3.0 coming.