The red LED is actually part of an RGB Piranha, just to see how it compares to an as-yet-unbuilt version with a single red LED in the same package.
The LED drops 1.9 V of the 2.75 V from the mostly used-up AA cells:
The original 33 Ω ballast resistor showed a peak current of 11 mA in a 30 ms pulse:
Replacing it with a 12 Ω resistor boosts the current all the way to 12 mA:
The 2N7000 gate sees a just bit more than 2 V, barely enough to get the poor thing conducting, which makes the ballast resistor mostly decorative. The MOSFET datasheet puts its 1 mA threshold somewhere between 0.8 and 3 V, so it could be worse.
Keep in mind the DSO150’s 1 MΩ input impedance sat in parallel with the 1 MΩ gate pulldown resistor forming the RC differentiator when I measured the gate voltage; I’ll leave the simulation as an exercise for the interested reader. The blinks were noticeably dimmer and perhaps a bit shorter, although eyeballometric calibration is notoriously hard.
The slightly revised schematic-layout doodle stacks the transistors along the negative bus bar:
Flipping the bottom transistor over to snuggle the two timing caps next to each other would eliminate the long jumper wire and probably look better.
The torchiere floor lamp in the sewing room suffered a catastrophic failure:
Contrary to what you might think from seeing the shattered plastic base, we didn’t use the lamp as a club or battering ram. Apparently the designer expected the thin plastic surrounding the hole to withstand all the torque produced by the long pole against the cheap concrete / mortar / grout / whatever lump in the base. As we can recall, this lamp came to us from either a yard sale or a roadside debris harvest, so I suppose the hardware outlasted any reasonable expectation.
The Basement Laboratory Warehouse disgorged the pole and base from a similar lamp, albeit sporting black paint and a smaller rod connecting its pole to its somewhat larger weight. Not being too fussy about decor, I embiggened the hole in the black base to fit the white lamp’s threaded rod:
The dust on the base shows why you shouldn’t stand motionless in the Basement Laboratory for very long.
The alert reader will have noted the cord passing through a strain relief grommet in the white base. Rather than dismantle the entire lamp, I just cut the cord, ran it through the new base weight, reinstalled the washer + nut, then crimped on a pair of solderless connectors:
The new base doesn’t offer much in the way of attachment points, so I added a cable tie to keep the strain off the connectors:
If you had different hardware, you could specify the driver with a WS2812_DRIVER option.
QMK can also control single-color LEDs with PWM (a.k.a. backlighting), and per-key RGB LEDs (a.k.a. RGB Matrix). These functions, their configuration / controls / data, and their documentation overlap and intermingle to the extent that I spent most of my time figuring out what not to include.
The first two lines describe a single WS2812 RGB LED wired to pin B2 (a.k.a. MOSI) of the Atmel 32U4 microcontroller. The default Reset duration and Byte Order values work for the LED I used
Protip: swapping the order from GRB to RGB is a quick way to discover if the firmware actually writes to the LED, even before you get anything else working: it’ll be red with the proper setting and green with the wrong one.
Dialing the maximum intensity down works well with a bright LED shining directly at your face from a foot away.
Turning on RGBLIGHT_LAYERS is what makes this whole thing happen. The RGBLIGHT_EFFECT_RGB_TEST option enables a simple test animation at the cost of a few hundred bytes of code space; remove that line after everything works.
The last two lines remove the debugging facilities; as always with microcontroller projects, there’s enough room for either your code or the debugger required to get it running, but not both.
With those files set up, the keymap.c file does the heavy lifting:
This being the season of lights, I deployed some outlet timers to turn them on at dusk and off at bedtime. The timers spend much of the rest of their lives plugged into outlets in the Basement Laboratory to keep their internal NiMH backup batteries charged, although they’re not controlling anything:
This one is labeled ENOVER, but it’s essentially identical to all the others sporting random alphabetic names; I have a few more labeled UKOKE in the same plastic case. The current crop uses a different case and has one fewer button, but don’t expect any real difference.
One of the timers had a blank display and didn’t respond to button pushes or a pin punch poked in the RESET hole, so I dismantled it to see what was inside.
Both the hot and neutral terminals had stray wire strands:
The power board had the usual missing components, suggesting it had been cheapnified after passing whatever regulatory inspection it might have endured to get a CE mark on its dataplate:
The alert reader may have already noticed the mmmmm smoking gun:
Incredibly, Z1 has a part number wrapped around it! A quick lookup shows a 1N4749A is a 24 V 1 W Zener diode, neatly matching the 24 V relay. The datasheet gives a 10.5 mA test current and a 38 mA maximum regulator current, with a caveat: “Valid provided that electrodes at a distance of 10mm from case are kept at ambient temperature”
The relay datasheet says 8.3 mA nominal coil current, a mere 200 mW, which is much easier to dissipate in wire wrapped around a steel core than in a little diode.
Evidently the poor diode ran rather hot before becoming a dead short, because a phenolic PCB (definitely not at ambient temperature) ought not discolor like that.
Indeed, measuring Z1 in another, still functional, Enover timer showed 25 V and a similarly discolored patch around Z1, suggesting the circuit design requires a bit more disspation from the diode than it can comfortably deliver.
I replaced it with a 1N970B from the Basement Laboratory Warehouse, rated for only 0.5 W in a seemingly identical case, buttoned the whole thing up, and left it in the middle of the concrete basement floor overnight. It wasn’t smoking and continued working in the morning, so I defined things to be no worse than before and declared victory.
Should when the next one fails the same way, I’ll epoxy a small heatsink to that poor diode and its leads to reduce its overall temperature.
For future reference, the underside of the PCB shows a distinct lack of post-soldering flux cleanup:
I swabbed it with denatured alcohol, although doing so certainly didn’t make any change to its behavior.
Memo to Self: no-clean flux is a thing.
It’s worth noting no other components show signs of overheating, despite the diode becoming a short circuit, so R1 (a big power resistor) is most likely the shunt regulator’s dropping resistor and can survive the additional power.
Should the diode fail open, the rest of the circuitry will be toast.
Because a yellow / amber LED runs at a lower voltage than blue and green LEDs, it sits atop an astable multivibrator, rather than a discrete LM3909. The battery holder has a pair of carbon-zinc “Extra-Heavy Duty” AAA cells, so corrosion and leakage pose a foreseeable hazard.
The voltage across the 100 Ω LED ballast indicates a 9 mA peak LED current, which is somewhat dim in ordinary room light:
The corresponding LED voltage says the LED runs at 2.1 V for that much current:
Something around 39 Ω should make it more visible.
After powering my Sony HDR-AS30V helmet camera for nearly all of this year’s riding, the Batmax NP-BX1 lithium batteries still have roughly 90% of their original capacity:
Those are hot off the Official Batmax charger, which appears identical to other randomly named chargers available on Amazon.
They’re holding up much better after a riding season than the DOT-01 batteries I used two years ago:
Empirically, they power the camera for about 75 minutes, barely enough for our typical rides. I should top off the battery sitting in the camera unused for a few days, although that hasn’t happened yet.
Of course, the Batmax NP-BX1 batteries I might order early next year for the new riding season have little relation to the ones you see here.