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.

Tag: Memo to Self

Maybe next time I’ll get it right

  • Forgotten Alkaline D-cell: Corrosion!

    Alkaline D-cell corrosion
    Alkaline D-cell corrosion

    Found this toxic spill while I was looking for a gadget on another shelf: it seems I left an alkaline D cell standing on my electronics parts & tools carousel for much too long.

    Amazingly, although the cell’s leakage blistered the paint pretty badly, it didn’t affect the steel carousel!

    I wiped most of the crud and dead paint off, then applied white vinegar (which is essentially dilute acetic acid) to neutralize the cell’s potassium hydroxide. The grabber tool sticking  out from between the boxes had a pretty good dose of corrosion up the side, but soaking it in vinegar (wow, the bubbles!) removed that and a shot of penetrating oil expelled the rinse water.

    It’s definitely not Duracell’s fault: the cell had a best-used-by date in 1997.

    Memo to Self: throw ’em out!

  • LED Bike Light Doodles

    LED Bike Light Notes
    LED Bike Light Notes

    I need an LED taillight (and maybe headlight) with a metal case and far more LEDs than seems reasonable. This is a doodle to sort out some ideas… not all of which will work out properly.

    The general notion is that one can put today’s crop of ultrasuperbright 5 mm LEDs to good use. While the Luxeon & Cree multi-watt LEDs are good for lighting up the roadway, they’re really too bright and power-hungry for rear-facing lights. Mostly, you want bright lights facing aft, but the beam pattern & optical niceness really aren’t too critical as long as you’re not wasting too many photons by lighting up the bushes.

    I think, anyway. Must build one and see how it works. I know that a narrow beam is not a Good Thing, as cars do not approach from directly behind and it make aiming the light rather too finicky.

    The problem with commercial bike taillights is that they use piddly little LEDs and not enough of them. If you’ve ever actually overtaken a bicyclist at night with a blinky LED taillight, you’ve seen the problem: they’re too damn small. Automobile taillights must have a very large surface area for well and good reason.

    But who wants to lug the taillight off a ’59 Caddy around?

    So the diagram in the pic explores the notion of arranging a bunch of red & amber LEDs in a fairly compact array. The shaded ones are red, the open ones are amber (with two more side-facing ambers to meet legal requirements), and there are eight of each. The OD is about 40 mm. Figure 5 mm LEDs with 2.5 mm of aluminum shell between them. If the center four LEDs were spaced right, an axial (socket-head cap?) screw could hold the entire affair together.

    Turns out both the red & amber LEDs in the bags of 100 I just got from Hong Kong run at 2 V forward drop @ 30-ish mA, so that’s 16 V total for eight in series.

    Four AA NiMH cells fit neatly behind the array, so the supply will be 4 – 5 V, more or less. The outer casing could be plastic pipe.

    What to do for a battery charging port? Must be mostly weatherproof. Ugh.

    Rather than a regulated supply and a current sink / resistor, use an inductor: build up the desired forward current by shorting the inductor to ground, then snap the juice into the LEDs. The voltage ratio is about 4:1, so the discharge will happen 4x faster than the charge for a duty cycle around 20%. At that ratio, you can kick maybe 50 mA into the poor things.

    Governing equation: V = L (ΔI/ΔT)

    If they’re running continuously, 2 V x 50 mA x 0.2 = 20 mW. The full array of red or amber is 160 mW, 320 mW for both. If you’re powering them at 10% duty cycle, then the average power dissipation is pretty low. Not much need for an external heatsink in any event.

    A 1 kHz overall cycle means a 200 µs inductor charging period. With low batteries at 4 V and 50 mA peak current, the inductor is 16 mH. That’s a lot of inductor. I have a Coilcraft SMD design kit that goes up to 1 mH: 12 µs charge and 16 kHz overall. Well, I wouldn’t be able to hear that.

    No need for current sensing if the microcontroller can monitor battery voltage and adjust the charge duration to suit; three or four durations would suffice. Needs an ADC input or an analog window comparator.

    Automotive LED taillights seem to run at about 10% duty cycle just above my flicker fusion frequency; say between 50 – 100 Hz. If that’s true, red & amber could be “on” simultaneously, but actually occupy different time slots within a 100 Hz repeat and keep the overall duty cycle very low.

    I’d like red on continuously (10% of every 10 ms) with amber blinking at 4 Hz with a 50% duty cycle. When they’re both on the total would be 60% duty.

    The legal status of blinking taillights is ambiguous, as is their color; more there. Motorcycles may have headlight modulators. Bikes, not so much.

    Battery life: assume crappy 1500 mAh cells to 1 V/cell. Red = 50 mA x 0.2 x 0.1 = 1 mA. Amber = 50 mA x 0.2 x 0.5 = 5 mA. Thus 1500 / 6 = 250 hours. Figure half of that due to crappy efficiency, it’s still a week or two of riding.

    Rather than a power switch, use a vibration sensor: if the bike’s parked, shut off the light after maybe 5 minutes. It wouldn’t go off when you’re on the bike, even stopped at a light, because you’re always wobbling around a little.

    Memo to Self: put the side LEDs on the case split line?

  • Credit Card Privacy Choices

    Just got a new credit card, which arrived with the usual “Privacy Policy” flyer describing how they’ll keep our sensitive bits safe & secure. Except, of course, that by default they’ll share those bits with nearly any organization that asks, if there’s even the least bit of money to be made in the process.

    The flyer explains how we can tell them of our privacy choices. Oddly, in this Internet Age, none of the banks have figured out how to put our privacy policy choices on their websites. Maybe that would be entirely too efficient.

    Anyhow, we’re supposed to either:

    • Pick up the phone to deal with their customer service apparat or
    • Pick up a pen, fill out a form, cut it out, and mail it to them

    For our joint accounts, if I forget to say “And this also applies to my wife”, well, then they’re free to share her sensitive bits.

    I’m sure they know that when they make “choosing” difficult enough, nobody will bother.

    Ya think?

    For the record:

    • Chase: press 0 to short-circuit the account info blather and get to a rep
    • Citi: press 6 for that purpose. Why not 0? Huh…

    The Chase folks tell me this may require up to 90 days to take effect. Wow, do they fill out forms and hand-carry the paperwork to Galactic HQ for further transcription?

    Memo to Self: Remember to tell the nice voice…

    • This applies to both account holders
    • Turn off all information sharing options
    • Turn off “convenience checks” (is anybody stupid enough to use those things?)
    • Turn off automatic credit line increases

    This takes about four minutes for each account on a Sunday morning.

  • Maxwell 10 F Ultracapacitor: First Charge

    Maxwell PC10 Ultracapacitors
    Maxwell PC10 Ultracapacitors

    My buddy Mark One dropped off a pair of Maxwell PC10 10 farad Ultracapacitors. We both recall our respective professors saying that a farad is an impractical unit, there’d never be such a thing as a 1 F capacitor, and it would be the size of a barn anyway…

    These are 25x30x3 mm.

    The downside, of course, is that they’re rated at 2.5 V DC with an absolute maximum of 2.7 V.

    On the other paw, they have a maximum current of 2.5 A and a whopping 19 A short-circuit current. Serious risk of fire & personal injury there…

    Charged one up from an AA NiMH cell I had lying around on the desk, which took a while, then let it discharge all by itself while taking notes. The results look like this:

    10 uF Ultracap - Self DischargeTime    Voltage – mV
    13:02    1353
    13:08    1350
    13:36    1338
    13:56    1333
    14:09    1329
    14:21    1326
    14:54    1318
    15:13    1314
    15:49    1308
    16:06    1305
    17:42    1291
    18:49    1283
    19:03    1282

    Now, maybe that’s not exactly the extreme top left end of an exponential drop, but it looks close enough:

    V(t) = V0 * exp (-t/τ)

    Pick any two points on the curve to find τ, the time constant:

    V(t1) / V(t2) = exp (-t1/τ) / exp (-t2/τ)

    Take the log of both sides and remember that the log of a ratio is the difference of the logs:

    log V(t1) – log V(t2) = (-t1 + t2) / τ

    Plug in the first and last data points to get:

    0.02341 = 21.6 ks / τ

    Reshuffle and τ = 923 ks. Close enough to a megasecond for my purposes.

    How to find the capacitance? Charge the cap up fram a pair of NiMH cells, discharge it at a constant current using a battery tester, thusly:

    10 uF Ultracap - 100 mA Load
    10 uF Ultracap – 100 mA Load

    That curve isn’t exactly linear, but it’s close enough that we can use the familiar capacitor equation:

    ΔV/ΔT = I/C

    Reshuffle to get capacitance over there on the left side:

    C = I * ΔT / ΔV

    The lower axis is minutes, not seconds, with truly poor grid values. Eyeballometrically, call it 4 min * 60 = 240 seconds.

    Plug in the appropriate numbers and find that

    C = 0.1 A * 240 s / 2.5 V = 9.6 F.

    Close enough.

    Knowing τ and C, find the self-discharge resistance R = τ/C = 96 kΩ. That seems pretty low, but at 2 V it amounts to 25 µA. The cap’s self-discharge current is rated at 40 µA, so that’s well within spec.

    Now, admittedly, the cap doesn’t hold much energy:

    • NiMH 2 x AA = 1 Ah @ 2.4 V = 2.4 Wh = 8600 Ws = 8600 J
    • Ultracap 10 F @ 2.4 V = 1/2 * C * V^2 = 29 J

    But, heck, it’s pretty slick anyway… it’ll make a dandy backup power source for a clock I’m thinking of making.

    Memo to Self: Datasheet says to add balancing resistors that carry 10x the self-discharge current when stacking in series. That’d be 10 kΩ, more or less, which seems scary-low.

  • Whirlpool Water Heater “Lifetime” Warranty: The Good and the Bad

    So our 6-year-old Whirlpool electric water heater tank failed and dribbled water on the floor. Fortunately, I spotted the leak before it flooded the basement: I look at the heater just about every time I venture into the Basement Laboratory Electronics Wing. Judging from the mildew & fungus growing on the wooden base I built for it, though, I haven’t been doing a good job of walk-by inspecting. In my defense, the visible wooden edge is 3/8″ thick below the dark rim of the heater.

    Grit drained from tank
    Grit drained from tank

    I turned off the inlet & outlet ball valves, flipped the breaker off, routed a garden hose out the door, laid the end in an old cake pan, and drained the tank. The pan collected a fair amount of rusty grit (and more washed down the driveway), which means the glass-lined tank was suffering from internal rust.

    A call to the Warranty Hotline produced an Indian-subcontinent accented voice, who told me that I had to get a licensed plumber to tell them that it was, in fact, rusted out. “Any plumber in the phone book will do”, he said, “Just have them call this number and we will verify the situation with them.”

    My back of the envelope, confirmed by friends, is that it’d cost about $150 for a plumber to drop in. Oh, and this was on a Saturday morning, which means it might be a while later and bit more expensive than that. Paying somebody $75/hour to wait on hold didn’t seem attractive.

    A new heater of the same general nature is $400, give or take.

    Soooo, in round numbers, I’d be spending half the cost of the “free”  replacement just to find out if Whirlpool would honor the warranty.

    I was ready to just cut my losses and buy another heater when my friend Aitch suggested two simple alternatives:

    • Call the warranty line again, point out that this is the Internet Age, and offer to send them pictures of the problem, along with a statement that I was being truthful.
    • Spend the $150 to ship the dead heater to the office of the Whirlpool CEO with a note describing the situation

    I picked the first option and had a brief conversation along these general lines:

    • paying nearly half the price of a new heater for an “evaluation” is absurd
    • the leak was near the top; even the caps over the heating elements were rusted
    • the grit shows that tank has internal rust, so it’s not external corrosion
    • I’ll send pictures anywhere you want

    Much to my astonishment, the pleasant voice gave me a replacement authorization! No pictures needed.

    Knock me over with a feather…

    So I hauled the corpse back to Lowe’s, swapped it out for a new one, and away I went.

    Now, it’s worth noting that the new heater has a 12-year tank warranty, not the lifetime one that came with the original purchase. Given my experience with the first one, we’ll see what happens; I suppose they learned how expensive a lifetime warranty can be.

    Overall, a pleasant surprise, although the initial presentation wasn’t encouraging in the least.

    Memo to Self: Don’t ask, don’t get…

  • Silver Soldered Bandsaw Blade: Test to Destruction

    Broken Solder Joint
    Broken Solder Joint

    There I was, bandsawing a 24″-diameter circle from 3/8″ plywood when the saw stopped cutting… which is how the bandsaw tells me that the blade joint just came undone. That’s what I get for applying too much torque to the blade, I thought…

    As you can see, the joint I described at great length there wasn’t nearly as good as I thought. It has a nice wetted spot in the middle, but the rest of the joint didn’t bond. Alas, the ends of the blade sections had just enough molten solder to look as though they were bonded.

    I’ve done other joints with that resistance soldering unit which held up well, but I’ll cheerfully admit I don’t have years of deep experience with it. Given the effort involved in making a bandsaw blade joint (not to mention the fact that I only solder up a new blade when I really need one), this is the first destructive test I’ve seen. It’s not like I’m going to solder up a blade, then tear it apart just to see how it worked, as I did with the nickel strip on those AA cells there.

    A change of technique seems in order. The carbon electrode produces enough heat directly under it (which isn’t surprising, that’s how resistance soldering works), so I must cover the full joint area with enough oomph to get a good bond everywhere. That seems to be 1.5 seconds per zap, more or less, repeated as needed.

    I have some machinable graphite that I could cut to be one square bandsaw joint at the end, plus a stub from a searchlight electrode that might work with less overall effort. However, a larger electrode probably wouldn’t heat the joint enough to melt the solder everywhere at once.

    For what it’s worth, I tried to re-solder the joint without doing full surface preparation by grinding down to bare steel. Didn’t work, natch, which should come as no surprise; wasted half an hour futzing around before I gave up and did it right.

    Memo to Self: Use the carbon gouging rod electrode, hit the entire joint, and don’t move until each zap cools!

  • Programming Algorithm for 27HC641 EPROMs

    General idea: replacing a failing Mostek MK36000-series masked ROM in a Tektronix 492 Spectrum Analyzer memory board with an equally obsolete 27HC641 EPROM, using the bits found there.

    The various datasheets give contradictory advice concerning device programming:

    EPROM Burn - Microchip algorithm
    EPROM Burn – Microchip algorithm

    Assuming you have appropriate power supplies, then the waveform on VCE looks like this. The upper trace is the -OE signal for the data latch supplying the byte-to-be-burned, the lower trace is VCE on EPROM pin 21. Set VCC = 6 V on pin 24 while all this is going on. The currents range into the hundreds of mA; this is not a low-power device!

    The squirts on the -OE latch signal before each programming cycle are eight quick writes to those antique DL-1414 displays that share the data bus with the EPROM. They show the current address and data byte during programming, plus other status & error messages.

    The Microchip and GI datasheets both claim that the EPROM cells erase to all 1 bits, like every other EPROM I’ve ever used. The Philips datasheet says:

    … after each erasure, all bits of the 27HC641 are in an undefined state. […] which is neither a logical “1” or a logical “0”

    27HC641 EPROM in programming socket
    27HC641 EPROM in programming socket

    The chip markings suggest they were made by Signetics, which got Borged by Philips some years ago. Lo and behold, the chip erases to a bizarre pattern that may be “undefined” but is perfectly consistent from erasure to erasure.

    Therefore, you cannot blank-check a 27HC641 EPROM before programming it!

    The Philips / Signetics datasheet doesn’t have a programming algorithm and the GI datasheet says you’re supposed to hold VCE at +12.5 V except when you’re asserting the programming data. So I used the Microchip algorithm on a Signetics chip and it seems to program properly.

    The only quirk is that the Arduino Diecimila doesn’t have enough storage to hold the entire EPROM at once, so I verified each data byte as I wrote it, rather than doing the whole chip after the entire programming loop. The top picture shows a single 1 ms programming pulse followed by the 3-ms overburn pulse; the byte read back from the EPROM must agree with the source byte after each pulse. When it’s all done, I manually dump the entire EPROM as an Intel HEX file and verify that against the original HEX file: if it matches, the burn is good.

    The byte-burning function goes a little something like this:

    int BurnByte(word Address, byte Data) {
    
    unsigned Iteration;
    byte Success;
    
     SetVcc(VH);                              // bump VCC to programming level
     SetVce(VIH);                             // disable EPROM outputs
     Outbound.Address = Address;              // set up address and data values
     Outbound.DataOut = Data;
    Success = 0;
    for (Iteration = 1; Iteration <= MAX_PROG_PULSES; ++Iteration) {
    
    RunShiftRegister();
    digitalWrite(PIN_DISABLE_DO,LOW);       // present data to EPROM
    
    SetVce(VH);                             // bump VCE to programming level
    delayMicroseconds(1000);                // burn data for a millisecond
    SetVce(VIH);                            // return VCE to normal logic level
    
    digitalWrite(PIN_DISABLE_DO,HIGH);      // turn off data latch buffer
    SetVce(VIL);                            // activate EPROM outputs
    CaptureDataIn();                        // grab EPROM output
    SetVce(VIH);                            // disable EPROM outputs
    
    RunShiftRegister();                     // fetch data
    
    if (Data == Inbound.DataIn) {           // did it stick?
    Success = 1;
    break;
    }
    }
    
    MaxBurns = max(MaxBurns,Iteration);
    
    if (Success) {                           // if it worked, overburn the data
    
    digitalWrite(PIN_DISABLE_DO,LOW);       // present data to EPROM (again!)
    SetVce(VH);                             // bump VCE to programming level
    delay(3 * Iteration);                   // overburn data
    
    SetVce(VIH);                            // return VCE to normal logic level
    digitalWrite(PIN_DISABLE_DO,HIGH);      // turn off latch buffers
    
    SetVce(VIL);                            // activate EPROM outputs
    CaptureDataIn();                        // grab EPROM output
    SetVce(VIH);                            // disable EPROM outputs
    
    RunShiftRegister();                     // fetch data
    
    Success = (Data == Inbound.DataIn);     // did overburn stick?
    }
    
    return !Success;                         // return zero for success
    }
    

    NOTE: the MK36000 and 27HC641 have slightly different address bit assignments.

    The MK36000 address bits look like this:

    • pin 18 = A11
    • pin 19 = A10
    • pin 21 = A12

    The 27HC641 address bits look like this:

    • pin 18 = A12
    • pin 19 = A11
    • pin 21 = A10

    Now, if you’re building a programmer, just wire up the 27HC641 socket as if it were a MK36000 and everything will be fine. The byte locations within the chip won’t match those in the original MK36000, but it doesn’t matter because you store bytes at and the Tek CPU fetches bytes from the same addresses.

    However, if you’re using a commercial EPROM programmer, it will write the bytes at the locations defined by the 27HC641 address bit assignments (because that’s all it knows), which will not work when plugged into the Tek board. Choose one of the following options:

    • build an interposer board to permute the address bits
    • cut-and-rewire the Tek board (ugh!)
    • write a program to permute the bytes in the HEX file

    Think about it very carefully before you build or program anything, OK? The checksum will most likely come out right even with permuted bits, but the CPU will crash hard as it fetches the wrong instructions.

    Memo to Self: always RTFM, but don’t believe everything you read.