The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Author: Ed

  • TLC5916 LED Driver Current Monotonicity Hack

    TLC5916 Current Gain vs Config Code
    TLC5916 Current Gain vs Config Code

    I’m using Texas Instruments TLC5916 constant-current LED driver chips for my my friend’s Totally Featureless Clock. An 8-bit configuration value sets the output current, with the external resistor defining the maximum value as described there.

    The problem is that the current-versus-config-value curve has a non-monotonic discontinuity in the middle, where the Current Multiplier bit switches from 0 to 1. I don’t know in which alternate universe this design decision made sense, but right here and now…

    It. Does. Not.

    Why it’s a problem: the LED brightness tracks room illumination as seen by a CdS photoresistor, averaged over maybe half a minute. The brightness changes very slowly, so the jump when it goes from 0x7f to 0x80 is really eyecatching. At least to me, anyway.

    Eyeballometric measurement of the curve shows the current at 0x80 pretty much matches the current at 0x60, soooo let’s just shove the second quarter of the curve (between 0x40 and 0x7f) downward until it meets the high-current value at 0x80.

    This code does the trick:

    if ((Brightness >= 0x40) && (Brightness <= 0x7f)) {
     Brightness = 0x40 + ((Brightness & 0x3f) >> 1);
    }
    

    Basically, that maps 0x7f to 0x5f. The output current for 0x5f is pretty close to the current for 0x80, making the step pretty much a non-issue.

    You could, if you were fussy enough, work out the actual current mapping values from the data sheet equations and make the ends match up perfectly.

  • Photoresistors Aren’t Indestructable

    Delaminated photoresistor
    Delaminated photoresistor

    So while testing the routine that measures light intensity using the technique described there, I discovered that:

    • The conductive layer atop the photoresistor doesn’t bond well to the base layer
    • The transparent top coating isn’t armor plating

    I wanted to verify the extreme dark end of the response curve, where the resistance is the highest and the input voltage correspondingly the lowest. The fastest way to do that is to put a piece of black electrical tape across the photoresistor’s face; it worked perfectly.

    Unfortunately, peeling the tape off the photoresistor also peeled the coatings apart. The resistance was unchanged, but I suspect moisture inside the layers isn’t going to do them the least little bit of good.

    Drat & similar remarks…

  • Arduino Pro: Securing the Serial Connecor

    Epoxy backfill on Arduino Pro serial connector
    Epoxy backfill on Arduino Pro serial connector

    The surface-mount serial connector on an Arduino Pro board isn’t the most robust of devices; the FTDI USB interface and USB cable can apply far too much torque to those little pins. Even before the situation described yesterday, the pins were getting wobbly.

    The connector shell is a big part of the problem, as it doesn’t mechanically lock the pins in place. Installing and removing the FTDI USB board pushes and pulls the pins against their pads, which means the adhesive bonding the pads must handle all that stress.

    Eventually, the Reset and TX pin pads tore loose from the circuit board. At that point, they have no mechanical stability at all; you can bridge a solder blob from the pin to its trace, but the adhesive holding the copper pad in place has lost all strength.

    The fix is straightforward, if ugly.

    • Repair the pin-to-pad/trace connections with something better than a solder blob. I used small snippets of component leads.
    • Apply denatured alcohol and scrub away all the solder flux around the pads.
    • Apply enough epoxy to the back of the connector to bond it, the pins, and the circuit board into one mechanically stable unit. I worked the epoxy between the pins and slightly under the connector shell with a small screwdriver and toothpick.

    Even with this repair in place, the connector is not particularly robust. It’s much better than it was, so we’ll count it as a win.

    This Arduino Pro has survived several projects, hence the hideous solder blobs here & there. I suppose I should just throw the poor thing away, but … that’s not my nature.

  • Arduino Pro: Power Adaptation for FTDI Basic USB

    Arduino FTDI Basic on modified Arduino Pro
    Arduino FTDI Basic on modified Arduino Pro

    Some time ago, I bought a 5 V Arduino Pro board (about which you read earlier there) and a nominally compatible FTDI Basic USB-to-serial adapter. Turns out that they’re not quite a perfect match, although they do play nicely together in normal use.

    The FTDI Basic board produces a 3.3 V regulated output voltage that’s connected directly to the output of the Pro’s 5 V regulator. This doesn’t cause any particular problem, but one side effect is that you can’t shut the board’s power off: the USB power will keep the CPU alive, more or less.

    You should, of course, use a 3.3 V FTDI Basic board with a 3.3 V Pro, which would at least put two similar voltage sources head-to-head.

    The Pro is using a backup power supply that, for reasons that make perfectly good sense, backfeeds the Pro’s 5 V regulator: when the +12 V main supply Goes Away, the backup power supports VCC directly, rather than through the regulator. The regulator can take a joke like that, as witness the FTDI vs Pro situation; in my case, a diode isolates the two supplies in normal operation.

    For reasons that I don’t completely understand, some combination of voltage to the Pro regulator and the (diode isolated!) backup support voltage caused the FTDI chip to lock up with both TX and RX LEDs on solid.

    I suspect the FTDI chip’s internal 3.3 V regulator, in combination with the USB +5 V supply, in combination with the Pro board power, drove something outside its normal operation range. So I simply removed the 3.3 V pin from the connector, disconnecting that supply from the Pro’s overvoltage, and the thing now works fine.

    Side effects:

    • The FTDI board remains powered when the Pro board gets turned off, thus preventing Linux from changing the serial port device when the power comes back up again
    • I can actually turn the Pro power off, without having the FTDI supply keep it alive. Handy for soldering!

    The Pro pin labeled GND connects to the FTDI CTS line, an input that floats high when not connected. I yanked that pin and shorted CTS to GND on the FTDI board: one less pin to worry about, for reasons that you’ll see tomorrow.

    There are many different versions of the boards and USB adapters, so current production probably doesn’t match what I have. Pay attention to what you have, though…

  • Improvised Snowthrower Skid Shoes

    Our snowthrower rests the entire weight of the front end on a pair of skid shoes, which erode against the asphalt driveway. Replacements cost nigh onto eleven bucks each, which activates my cheapskate gene.

    Worn OEM skid shoes
    Worn OEM skid shoes

    You can see from the markings that the slots are about twice as long as they need to be, so I figured I could replace them with some random angle iron. Might not last as long, but far less expensive.

    Bedframe skid shoe
    Bedframe skid shoe

    Having a nearly infinite supply of bedframe steel in the heap, I chopped off two suitable lengths, poked 3/8″ holes into the appropriate spots, then milled short slots to get some adjustability.

    Bedframe steel is about the nastiest stuff you (well, I) can still machine: high carbon, fine blue-hot chips, and hard edges. It might actually be better-suited for skid shoes than the soft steel OEM parts.

    They’re not pretty, but the driveway hasn’t complained yet.

    The only real problem is that those sharp corners snag on the edges of what we loosely term “the lawn”. I should apply the smoke wrench, miter the corners, and bend the edges upward. If I’m going to all that trouble, I should also hitch up the buzz box and wave some hardfacing ‘trodes over the bottom.

    But that’s in the nature of fine tuning and sounds a lot like work.

  • Stainless Steel Rule vs Ferric Chloride: Oops

    This is truly embarassing: I managed to leave a steel rule (not a ruler in the shop) atop a sploosh of ferric chloride for far too long. I eventually noticed the corrosion creeping around the edges.

    Top corrosion
    Top corrosion

    The bottom was hideous.

    Bottom corrosion
    Bottom corrosion

    So I sprayed it down with TopSaver, applied fine sandpaper, applied a Scotchbrite pad, and it came out surprisingly well.

    After treatment
    After treatment

    The ferric chloride, of course, came from a circuit board etching project. How you’re supposed to prevent that is to cover everything for about six feet around the spot marked X, but I don’t do that nearly as often as I should.

    Mostly I lay a sheet of packing paper atop the workbench and whisk it into the trash when I’m done, but this time I’d left it in place because my resistance soldering gizmo wound up anchoring the far end. Soooo, a drop or two soaked into the paper and of course the ruler wound up exactly atop that spot.

    The stuff is murder on stainless steel sinks, too…

  • Fixing an MTD Gas Cap Splash Shield

    OEM plastic post
    OEM plastic post

    MTD used the same design for the gasoline tank caps on our leaf shredder and snow thrower: an aluminum cone (which evidently serves to keep splashes away from the tank vent) mounted on a heat-staked plastic rod molded into the cap. It’s straightforward, but a bit suboptimal for high-vibration yard gadgets.

    The aluminum cone eventually worries its way through the plastic post and falls into the tank, taking the heat-formed button from the post along with it. Trust me on this, fishing those things out of the tank is an exquisite little inconvenience.

    4-40 screw post - inside
    4-40 screw post – inside
    4-40 screw post - exterior
    4-40 screw post – exterior

    The fix is straightforward.

    Chop off the remains of the post, drill a snug 4-40 tapping hole straight through the cap, and tap it accordingly. Secure the cone to the screw with a nut tightened against the head, run the screw through the cap, run a pair of nuts onto it, trim to length, then jam the nuts together so the cone is about where it started out. Loctite on the nuts is a Good Thing, but I don’t know how it feels about gasoline immersion.

    The snowblower cone is getting wobbly; I must make a preemptive strike on it to avoid fishing the debris out of the tank.