Scratch building a replacement LED microscope light
I got a nifty stereo boom microscope off eBay years ago, and it is revolutionary for doing small work. It shipped with 5x and 10x lenses, and that’s more than enough to clearly see rework on 0201 components, or find and remove tiny glass fiber splinters from my hand.
My only complaint is that a couple months after I got it, the incandescent lightbulb that lights up the object I’m looking at failed, and quite shortly thereafter so did the replacement they sent along with it.
It’s a little weird: an odd sized edison-style screw base, with a roughly 17 volt AC supply. (I think the bulbs are 12V bulbs and that’s why they’re dying fast.)
So I went for a couple of years using a gooseneck lamp as illumination, and that worked fine, but then I need to have that plugged in and cart it around along with the scope if I’m working somewhere else, and bleah.
I decided, well, since my job is testing LED driver chips, I might as well make an LED driver.
In part, I decided this because I found a cut-off snippet of a reel of LED’s, that had two lonesome LED’s in it. These are square, 1.6mm on a side, which, curiously, is the thickness of a standard PCB.
So I can put one on the _edge_ of a bit of copper clad FR4 and if I twist it a little bit with respect to the PCB, I can solder one lead to each face of the FR4. As a result, I use both sides of the PCB as both conductors and heatsinks. For tiny high power LED’s like this, getting the heat out of the LED body is the major determinant of how long they’re going to last.

I have a LPKF circuit board plotter at home. It’s glitchy and doesn’t always work well because one of the stepper motors is damaged. But when it does work, it does a lovely job of cutting PCB’s in copper.
I did an initial layout in KiCAD, to provide a bridge rectifier, some ripple caps, and a little constant current asynchronous buck regulator. The regulator I chose, the LM3414, is a bit old, but it handles an amp and is very simple. In addition to needing the typical inductor and diode of a buck regulator, it needs a capacitor for the boost voltage to drive the internal FET, a resistor to set the switch frequency, and a resistor to set the current it’s providing. The only annoying bit is it also needs to have its enable pin tied high, but the enable pin has a max voltage of 5.5V, so I have to derive 5.5V from the 20-ish volts of the rectified transformer voltage.
Here are two layouts, illustrating one of the reasons milling pcb’s can be useful: on one side, exactly what KiCAD says, on the other, redesigned with copper floods around the footprints for the FWBR and inductor. This lets me use the (salvaged from a failed LED bulb) bridge rectifier I have, which is a weird package, and the only 1000uH inductor I could find, neither of which was even close to any of the KiCAD footprints. But with big fat copper pours, I could stick on anything.

So I populated the FWBR and the caps and figured before I did anything more I’d test it to make sure there was enough cap to handle the ripple. There’s a formula for this, although it’s dependent on the load, and I didn’t know the load precisely.
I also learned that KiCAD 5.0 or newer has ngspice integrated right into it, so I can draw a schematic (if I choose parts from the spice library) and simulate it and see the result, and ensure that the ripple never drops below the amount the chip needs. Which, again, is dependent on load, so I provided enough cap to ensure a less than 200mV ripple into a 1 amp load, because nothing succeeds like excess.
Here’s a screenshot of a FWBR and what ngspice has to say about the ripple voltage. You can see the red trace showing the rectified signal. In the schematic, you can see the spice directives showing the voltage source characteristics, and in blue below that a graphics-text directive to set the transient parameters. Things I learned: you have to know where to put the spice reference ground. If it’s over on vin- you get nonsense results, with no warning, but if it’s on the ground of the load you get the output you wanted. (This may be why vin shows as all positive numbers rather than an ac signal centered at 0V.)

And then I tried measuring it at the Mad Scientist Hut and my cheap harbor freight multimeter gave me nonsense numbers, so I put an oscilloscope on it, which is hilarious overkill.

And that showed me that the FWBR output was identical to its input because I’d only soldered down the positive rail on all the capacitors and they were ungrounded. Sooooo I soldered down the ground pads and got a fantastic output with no ripple… into an empty load.
Then I put on the rest of the parts and powered it up and nothing happened, so I measured the output of the 5v linear regulator, and it showed 0V, and I remembered that I got a weird reel of 5v regulators that has an inverted pinout so I was shoving 18VDC into the regulator’s output. Well, phoo. But luckily the logic level input is extremely low current so I flipped the regulator over and stood it up on end, leaving the tab of the SOT223 leaning against the adjacent inductor, and then it worked just fine.

I trial-wired it to the LED.

and turned it on

and that is waaaaaaaay too much light, and that’s running at like 150mA, which is like a quarter of what the regulator and the LED are rated for.
But that’s okay. It’ll do just fine.
I let it run for a while with a cheap harbor freight non-contact thermometer measuring the led pcb temperature. Those rotten little things aren’t accurate, but I don’t need accuracy: all I need is to make sure it’s not heating up near 125C. It isn’t. Whatever it is doing, the cold-hot temperature rise was less than 5F.

I 3d printed a neato little adapter to hold the LED pcb colinear in the optics tube. The cylinder is 2 nozzle widths wide, and the fingers that hold the board are 3NW. They’re canted inwards: at the outside edges of the board the gap between them is 1.8mm, but at the center it’s 1.4mm. That way when I press the board in, they spring outwards 0.1mm each way, holding the board very securely.

Here’s a closeup of the sketch with the bowtie nature somewhat exaggerated to show what it’s doing. Flexures dramatically simplify 3d fixtures.

I’ve gotten much more confident about designing items that have flexures built-in so they hold things. PLA creeps over time so this isn’t a great idea if you really need something important to be held solidly. But for little who-cares items like this, it’s a great design technique.
Then I wired the regulator into the transformer (making sure to check continuity to the LED’s cathode through the wiring) and printed a little 2NW slide-on enclosure for the PCB to prevent it shorting against something.

So now the board’s soldered into the transformer, driving the original wiring up to the head, and the LED carrier’s soldered into the wiring up there and sitting in its little adapter in the optics mount, and I have a usable microscope again.
