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.

Category: Electronics Workbench

Electrical & Electronic gadgets

  • X10 PHC02 Maxi Controller: Green LED

    PHC02 Circuit Board
    PHC02 Circuit Board

    Got the replacement X10 controller from the usual eBay source and it works fine, except it has a red LED that’s on unless it’s sending an X10 command.

    That’d be OK, except that I’ve spent the last few months associating a red LED at that spot on the dresser with a jammed X10 controller.

    Not to mention that red LEDs are sooo 20th Century…

    Four screws hold the baseplate in place; it takes a bit of prying to release the stiffening collars around the front screws and remove the baseplate. One more screw holds the circuit board in place.

    Surprisingly, they used the same metal-dome switch plates!

    Anyhow, with the board out, it’s easy to unsolder the red LED and replace it with a green one from my bag o’ mixed LEDs. It’s not quite the same shape and doesn’t have a big shoulder to keep it in place, but it’s good enough for me.

    New green LED
    New green LED

    The heat of soldering melted the thermoplastic glue that held the original LED in place. The new one isn’t quite as firmly bonded, but I don’t intend to jam a paperclip into the hole after shoving the LED out of the way.

    That was easy…

  • Spectral Characteristics: The Graph

    In the process of pulling together a talk for the Trinity Robotics contest, I rediscovered my spreadsheet of spectral response data. It’s been compiled over the years from myriad sources (utterly without attribution), suffers from gaps & interpolations, and undoubtedly emits a fairly high bogon flux density.

    To wit: trust nothing!

    Spectral Response
    Spectral Response

    Horizontal scale has UV on the left and IR on the right.

    Vertical scale is linear, roughly corresponding to power in or out at a particular wavelength. It should, of course, be logarithmic, but that’s in the nature of fine tuning, as no source data has that much resolution.

    Things to note:

    • Human eyes are tuned to see chlorophyll and not much else. That must’a been important at one time or another…
    • The nice bumps on the left are visible LEDS: violet blue green orange yellow red. The IR LED over on the right stands alone.
    • There’s no overlap between human vision and IR LED emission, but you can still see a dim red glow if you stick it right up against your eye.
    • Don’t do that with a UV LED, though.
    • White LEDs are just blue LEDs with fancy phosphors. That’s why the spectrum looks like a blue LED with a bump in the yellow-orange neighborhood. They’re not well-balanced at all.
    • High-pressure sodium lights kill IR sensors stone cold dead. Look at that peak, perfectly aligned with the photodiode response. If you could see in IR, you’d go blind. That’s what made the Trinity contest so challenging for so many years; they recently switched to fluorescent lighting and the complaints dropped dramatically.
    • Those emission spikes are why camera color correction doesn’t work well: if there’s no energy in a region, you can’t crank the gain up enough to make a difference.
    • An 87C Wratten filter is great for excluding visible light, but the overlap with that HP-Na spike tells you it won’t do jack with that sort of lighting.
    • Fluorescent tubes produce intense spikes at 436 and 546, corresponding to mercury emission lines. Their phosphor emissions extend far into the IR, too, but the data I have doesn’t include that region.
    • Ditto for metal halide bulbs.

    To produce the graph, apply this bash script to the CSV file…

    
    #!/bin/sh
    export GDFONTPATH="/usr/share/fonts/TTF/"
    gnuplot << EOF
    #set term x11
    set term png font "arialbd.ttf" 24 size 1200,800
    set output "Spectral Response.png"
    set title "Spectral Response"
    #set key 28,-0.75 Left reverse samplen 2 noautotitles
    #set key right noautotitles
    unset key
    unset mouse
    set bmargin 4
    set grid xtics ytics
    set xlabel "Wavelength - nm"
    set format x "%3.0f"
    #set xrange [0:9]
    #set xtics 0,10
    #set mxtics 4
    set ytics nomirror autofreq
    set ylabel "Relative Response"
    #set format y "%3.0f"
    set yrange [0:1.1]
    #set y2label "Panel Power - mW"
    #set format y2 "%3.0f"
    #set y2range [0:800]
    #set y2tics 200
    set datafile separator ","
    set label 1 "Eye" at 550,1.05 font "arialbd,14" center
    set label 2 "White" at 480,1.05 font "arialbd,14" center
    set label 3 "IR" at 940,1.05 font "arialbd,14" center
    set label 4 "87C Filter" at 1050,0.85 font "arialbd,14" center
    set label 5 "Photodiode" at 825,1.05 font "arialbd,14" center
    set label 6 "Tungsten" at 1050,1.00 font "arialbd,14" center
    set label 7 "Fluor" at 410,0.42 font "arialbd,14" right
    set label 8 "Halide" at 680,0.41 font "arialbd,14" left
    set label 9 "HP-Na" at 805,0.60 font "arialbd,14" right
    set label 10 "Violet" at 410,1.05 font "arialbd,14" center
    set label 11 "Red" at 635,1.05 font "arialbd,14" center
    plot    "Spectral Response Curves.csv" \
     using 1:2 with lines lt -1  lw 3 title "Eye", \
     "Spectral Response Curves.csv" \
     using 1:3 with lines lt 1 lw 2 lc rgb "light-blue" title "White" , \
     "Spectral Response Curves.csv" \
     using 1:4 with lines lt 1 lw 2 lc rgb "dark-violet" title "Violet" , \
     "Spectral Response Curves.csv" \
     using 1:5 with lines lt 1 lw 2 lc rgb "blue" title "Blue" , \
     "Spectral Response Curves.csv" \
     using 1:6 with lines lt 1 lw 2 lc rgb "green" title "Green" , \
     "Spectral Response Curves.csv" \
     using 1:7 with lines lt 1 lw 2 lc rgb "gold" title "Yellow" , \
     "Spectral Response Curves.csv" \
     using 1:8 with lines lt 1 lw 2 lc rgb "orange" title "Orange" , \
     "Spectral Response Curves.csv" \
     using 1:9 with lines lt 1 lw 2 lc rgb "red" title "Red", \
     "Spectral Response Curves.csv" \
     using 1:10 with lines lt 1 lw 2 lc rgb "magenta" title "IR" , \
     "Spectral Response Curves.csv" \
     using 1:11 with lines lt 1 lw 2 lc rgb "dark-red" title "Photodiode" , \
     "Spectral Response Curves.csv" \
     using 1:12 with lines lt 1 lw 2 lc rgb "dark-gray" title "87C Filter" , \
     "Spectral Response Curves.csv" \
     using 1:13 with lines lt 1 lw 2 lc rgb "dark-yellow" title "Tungsten" , \
     "Spectral Response Curves.csv" \
     using 1:14 with lines lt 1 lw 2 lc rgb "orange-red" title "HP-Na" , \
     "Spectral Response Curves.csv" \
     using 1:15 with lines lt 1 lw 2 lc rgb "brown" title "Halide" , \
     "Spectral Response Curves.csv" \
     using 1:18 with lines lt 1 lw 2 lc rgb "midnight-blue" title "Fluorescent"
    EOF
    
    

    And the data in CSV format because WordPress doesn’t allow spreadsheets…

    
    #"Wavelength","Eyeball","White LED","Violet LED","Blue LED","Green LED","Yellow LED","Orange LED","Red LED","IR LED","Photodiode","IR Filter","Incandescent","Sodium","Metal Halide","Daylight Flour","Moon Fluor","Fluorescent"
    300,,,,,,,,,,,,,,,,,
    310,,,,,,,,,,,,,,,,,
    320,,,,,,,,,,,,,,,,,
    340,,,,,,,,,,,,,,,,,
    350,,,,,,,,,,,,,,,,,
    360,,,,,,,,,,,,,,,,,
    370,,,0.02,,,,,,,,,,,,,,
    380,,,0.11,,,,,,,,,,,0.06,0.04,0.03,0.03
    385,,,,,,,,,,,,,,0.06,0.05,0.04,0.03
    390,,,0.33,,,,,,,,,,,0.07,0.06,0.05,0.04
    395,,,,,,,,,,,,,,0.08,0.07,0.06,0.05
    400,,,0.90,,,,,,,0.05,,0.09,,0.09,0.09,0.07,0.06
    405,,,,,,,,,,,,,,0.10,0.40,0.37,0.39
    410,,,1.00,,,,,,,,,,,0.10,0.13,0.10,0.09
    415,,,,,,,,,,,,,,0.15,0.13,0.10,0.09
    420,0.05,0.02,0.33,0.02,,,,,,0.12,,0.12,,0.26,0.15,0.11,0.10
    425,,,,,,,,,,,,,,0.16,0.16,0.13,0.11
    430,,0.05,0.11,0.11,,,,,,,,,,0.13,0.18,0.14,0.12
    435,,,,,,,,,,,,,,0.13,1.00,1.00,1.00
    440,0.16,0.08,0.05,0.92,,,,,,0.19,,0.15,,0.11,0.21,0.17,0.14
    445,,,,,,,,,,,,,,0.11,0.22,0.18,0.15
    450,,0.30,,1.00,,,,,,,,,,0.13,0.24,0.19,0.16
    455,,,,,,,,,,,,,,0.15,0.26,0.20,0.17
    460,0.25,0.65,,0.77,,,,,,0.25,,0.19,,0.18,0.26,0.21,0.17
    465,,,,,,,,,,,,,,0.15,0.26,0.21,0.18
    470,,0.90,,0.22,,,,,,,,,,0.15,0.26,0.21,0.18
    475,,,,,,,,,,,,,,0.17,0.27,0.22,0.18
    480,0.36,1.00,,0.11,,,,,,0.32,,0.22,0.02,0.20,0.27,0.22,0.18
    485,,,,,,,,,,,,,,0.16,0.27,0.22,0.18
    490,,0.80,,0.03,,,,,,,,,,0.20,0.27,0.22,0.18
    495,,,,,,,,,,,,,,0.17,0.27,0.22,0.18
    500,0.50,0.32,,,,,,,,0.39,,0.25,0.10,0.18,0.26,0.21,0.18
    505,,,,,,,,,,,,,,0.23,0.25,0.21,0.17
    510,,,,,,,,,,,,,,0.22,0.25,0.20,0.17
    515,,,,,,,,,,,,,,0.22,0.24,0.20,0.17
    520,0.70,0.30,,,,,,,,0.44,,,0.02,0.18,0.24,0.20,0.18
    525,,,,,,,,,,,,,,0.20,0.24,0.20,0.19
    530,,,,,,,,,,,,,,0.22,0.24,0.20,0.21
    535,,,,,,,,,,,,,,1.00,0.24,0.21,0.24
    540,1.00,0.48,,,0.08,,,,,0.49,,,0.02,0.45,0.26,0.23,0.27
    545,,,,,,,,,,,,,,0.27,0.70,0.67,0.78
    550,1.00,0.55,,,0.45,,,,,0.52,,,0.05,0.18,0.29,0.27,0.36
    555,,,,,,,,,,,,,,0.20,0.30,0.30,0.40
    560,1.00,0.55,,,0.95,0.13,,,,0.54,,,0.10,0.18,0.32,0.32,0.45
    565,0.91,,,,1.00,0.34,,,,0.55,,,0.30,0.24,0.33,0.35,0.49
    570,0.83,,,,0.85,0.55,,,,0.57,,,0.43,0.24,0.34,0.37,0.52
    575,,,,,,,,,,,,,,0.26,0.39,0.44,0.59
    580,0.65,,,,0.37,0.96,0.08,,,0.59,,,0.33,0.24,0.42,0.46,0.61
    585,0.61,,,,0.31,1.00,0.19,,,0.60,,,0.40,0.23,0.34,0.39,0.52
    590,0.58,,,,0.24,0.94,0.30,,,0.62,,,0.15,0.24,0.32,0.38,0.51
    595,,,,,,,,,,,,,,0.29,0.30,0.37,0.48
    600,0.50,0.40,,,0.11,0.60,0.80,0.13,,0.64,,0.51,0.46,0.37,0.28,0.34,0.44
    605,,,,,,,,,,,,,,0.30,0.26,0.31,0.41
    608,0.46,,,,,0.56,1.00,0.29,,,,,0.33,,,,
    610,0.45,,,,,0.55,0.97,0.33,,,,,0.32,0.37,0.24,0.29,0.36
    615,,,,,,,,,,,,,,0.33,0.21,0.27,0.33
    620,0.40,0.32,,,,0.20,0.80,0.60,,,,,0.32,0.26,0.19,0.24,0.29
    625,,,,,,,,,,,,,,0.33,0.17,0.21,0.25
    630,0.30,0.28,,,,,0.52,0.95,,,,,0.20,0.25,0.15,0.18,0.22
    634,0.26,,,,,,0.43,1.00,,,,,0.19,,,,
    635,,,,,,,,,,,,,,0.27,0.13,0.16,0.19
    640,0.20,0.25,,,,,0.30,0.90,,,,,0.17,0.27,0.11,0.14,0.16
    645,,,,,,,,,,,,,,0.26,0.10,0.12,0.14
    650,0.15,,,,,,0.20,0.60,,,,,0.16,0.25,0.09,0.10,0.12
    655,,,,,,,,,,,,,,0.31,0.08,0.09,0.10
    660,0.10,,,,,,0.10,0.43,,,,,0.14,0.27,0.07,0.08,0.09
    665,,,,,,,,,,,,,,0.29,0.06,0.07,0.07
    670,0.08,,,,,,,0.30,,,,,0.13,0.24,0.05,0.06,0.06
    675,,,,,,,,,,,,,,0.28,0.05,0.05,0.05
    680,0.05,,,,,,,0.20,,,,,0.11,0.25,0.04,0.05,0.05
    685,,,,,,,,,,,,,,0.37,0.04,0.04,0.04
    690,0.03,,,,,,,0.10,,,,,0.10,0.26,0.03,0.04,0.04
    695,,,,,,,,,,,,,,0.24,0.03,0.03,0.03
    700,,0.24,,,,,,,,0.84,,0.81,0.09,0.26,0.03,0.03,0.03
    705,,,,,,,,,,,,,,0.21,0.02,0.03,0.02
    710,,,,,,,,,,,,,,0.16,0.02,0.02,0.02
    715,,,,,,,,,,,,,,0.15,0.02,0.02,0.02
    720,,0.20,,,,,,,,0.87,,0.84,0.08,0.14,0.02,0.02,0.02
    740,,0.10,,,,,,,,0.90,,0.87,0.06,,,,
    760,,0.08,,,,,,,,0.93,,0.89,0.05,,,,
    770,,,,,,,,,,0.94,,0.90,0.11,,,,
    780,,0.04,,,,,,,,0.96,,0.92,0.05,,,,
    800,,0.02,,,,,,,,0.99,0.03,0.95,0.06,,,,
    810,,,,,,,,,,1.00,0.08,0.96,0.07,,,,
    820,,,,,,,,,,1.00,0.16,0.97,1.00,,,,
    840,,,,,,,,,,1.00,0.38,0.97,0.07,,,,
    860,,,,,,,,,,0.96,0.58,0.98,0.06,,,,
    880,,,,,,,,,,0.91,0.73,0.99,0.05,,,,
    900,,,,,,,,,0.15,0.87,0.81,1.00,,,,,
    910,,,,,,,,,0.37,,,,,,,,
    920,,,,,,,,,0.67,,,,,,,,
    930,,,,,,,,,0.96,,,,,,,,
    935,,,,,,,,,1.00,,,,,,,,
    940,,,,,,,,,0.97,,,,,,,,
    950,,,,,,,,,0.73,,,,,,,,
    960,,,,,,,,,0.45,,,,,,,,
    970,,,,,,,,,0.26,,,,,,,,
    980,,,,,,,,,0.16,,,,,,,,
    1000,,,,,,,,,0.10,0.43,0.89,0.98,,,,,
    1020,,,,,,,,,,0.36,0.90,0.97,,,,,
    1040,,,,,,,,,,0.29,0.91,0.96,,,,,
    1060,,,,,,,,,,0.22,0.91,0.94,,,,,
    1080,,,,,,,,,,0.15,0.92,0.93,,,,,
    1100,,,,,,,,,,0.08,0.93,0.92,,,,,
    
    
  • X10 Controller: End of Life

    X10 Controller Circuit Board
    X10 Controller Circuit Board

    After 30-some-odd years, the X10 controller we’ve been using to turn off all the lights at bedtime finally stopped working. For the last few months it had been occasionally jamming ON, even when nobody pushed any keys, and the only way to reset it was pulling the plug.

    The big silver can on the white cable is an ultrasonic mic, so perhaps the circuitry around that was getting cranky: the ultrasonic cleaner in the bathroom (which we use for eyeglasses) would reliably jam it. I think the controller was responding to the third harmonic of the 40-ish kHz cleaner power, delivered through the power line.

    As you’d expect, all the electrolytic caps were shot; ESR for the big one was “open”, the smaller ones around 5 Ω. The capacitance values were entirely within spec, of course. I replaced all three.

    X10 Controller keyboard
    X10 Controller keyboard

    While I had the hood up, I cleaned the switch contacts, even though that probably had nothing to do with the problem. Back in the day, they used actual metal deformable domes, stuck under an adhesive layer that did a fine job of keeping the crud and dust out.

    Put everything back together, fired it up, and it misbehaved the same way. I’d say we got our money’s worth out of it, though.

    A replacement is on the order of $15 from the usual eBay suppliers, so it’s not the end of the world.

    The new one probably doesn’t have the ultrasonic receiver, so it shouldn’t respond to the ultrasonic cleaner with the same enthusiasm.

  • Ambient Room Light Intensity

    The Totally Featureless Clock has been running continuously for the last few months, with a laptop dutifully recording its trace output. Occasionally the USB link will disconnect, but on the whole it works pretty well; the clock continues to run even when the USB link fails.

    Here’s about three weeks of light intensity record. The red trace is the max value, green is minimum, and blue the current intensity. The min and max tend toward the middle, one count per hour, so they don’t stick at the extremes.

    Light Intensity
    Light Intensity

    The peaks represent daylight hours, zeros are overnight, and the overall scale is roughly logarithmic, more or less, kinda-sorta.

    The general idea is that the LED brightness matches the room illumination, with the min & max values tracking the actual ambient light range to get the most benefit out of the TLC5916’s limited dynamic range.

    You can spot the data dropouts where the red trace steps abruptly; it should decline smoothly from each peak and the peaks should be evenly spaced about 24 hours (1440 minutes) apart. Each minute generates three lines with the exact time, so it would be possible to futz around and timestamp each record, but …

    The clock dumps the ADC values in hexadecimal, which gnuplot can’t handle, so a bit of preprocessing is in order.

    cat *log > 0.txt
    grep Light 0.txt > 1.txt
    sed 's/Light: /0x/g;s/Min=/0x/g;s/Max=/0x/g' 1.txt > 2.txt
    gnuplot
    set key on right center
    plot "2.txt" using 1 with lines lt 3 title "Light", (and so forth)
    

    All in all, it seems to be working as intended. When I put it inside the case, I’ll probably have to increase the resistor to account for the dark-gray faceplate.

  • DVD Player External Li-Ion Pack: A Pleasant Surprise!

    A friend mentioned a sale at Overstock.com (likely gone by now) that offered an Initial RB-270 9 V, 5.4 Ah lithium-ion battery pack, with a built-in charger, for $16. The pack was intended to keep a DVD player alive for long enough to avoid back-seat mayhem on long trips (for those toting undisciplined brats, anyway), but I saw it as a plug-in replacement for the NiMH AA-cell packs I’ve been using with the HTs on our bikes.

    The NiMH cells have been a major disappointment, as described there and there and there, with barely 1.5 Ah of capacity from nominal 2.4 Ah cells.

    Much to my surprise, all three of the Li-Ion packs delivered pretty nearly their advertised ratings. I varied the discharge level, but they’re all quite close…

    Initial External Li-Ion packs
    Initial External Li-Ion packs

    It looks like the packs include an internal regulator and over-discharge monitor, as the voltage is bar-flat right up to the point where it drops to zero. I’m mildly surprised at the regulator; I’d expect that they’d just deliver whatever the cells were producing, rather than waste any energy in the regulator.

    Notice that the 200 mA rate produced a lower total capacity than the 1 A rate. I’m guessing that’s power lost in the regulator over the protracted run time; 4.9 Ah at 200 mA added up to nearly a day of testing, far over the “up to six hours play per charge” rating.

    Let’s see: 5.4 Ah @ 6 hours makes the nominal load about 900 mA. So it delivered maybe 4.8 Ah at 1 A. Not what’s claimed, but much closer than those Tenergy NiMH cells.

    Next steps:

    1. Butcher the nice coily-cord cables to add Powerpole connectors that will click right into the bike radios
    2. Take one apart to see what bypassing the regulator would entail
  • Cutting Pin Header Strips

    Slitting dual-row connector
    Slitting dual-row connector

    I needed a few strips of single-row pin headers, but the parts bin was empty.

    I hate it when that happens.

    The heap disgorged a handful of double-row strips and, of course, I Have A Machine Shop.

    So: no problem.

    This is, I admit, not cost-effective, but it took about 15 minutes to slit the aforementioned handful of strips right down the middle and get back to soldering.

    The trick is to use an ultra-thin slitting saw, rather than a regular saw. The one here is 4 mils thick and the better part of 7/8″ in diameter; call it 0.1 mm x 22 mm. I think it came with one of the Dremel tool kits a long while ago.

    Cut about 1 mm deep on the first pass, then cut through on the return to avoid having the saw deflect too much. Run about 100 mm/min, 1000 rpm, and no coolant. Line it up by eye, type manual CNC commands into EMC2, and it’s all good.

    The trick is finding a mandrel that doesn’t collide with the vise; my larger saws have a rather thick screw-and-washer arrangement that doesn’t fit. I think some padding (chopped-up credit cards?) between the longer pins, mounting the vise vertically, and grabbing the longer pins would fix that. The catch might be clearance between the top of the vise and the bottom of the spindle motor.

    Better to just buy some single-row strips. Sheesh… but if all you have is a CNC mill, you have plenty of solutions.

    Another slitting saw repair is there

  • Digikey Full-Line Catalog

    For the first time ever, Digikey sent me a full-line catalog.

    Digikey catalog
    Digikey catalog

    It’s 2778 pages long, three inches thick, and weight 2 kg.

    Some time ago I made the mistake of replacing our large rusted-out mailbox with a much smaller one: the catalog presented a solid wall of paper when I opened the door.

    Here’s a closeup…

    Digikey catalog vs Arduino Duemilanovae
    Digikey catalog vs Arduino Duemilanovae

    Now, I’d love to have you believe I’m such a high-rollin’ kind of engineer that Digikey spares no expense on my behalf, but the only explanation for this embarassing situation I can come up with is that their customer service system blew a gasket in my general direction…

    What makes it even more ironic is that they’d recently sent me a survey asking how I’d like to get their catalog. I’d emphatically replied that I did not need a paper catalog or a USB stick with the PDFs. Just let me do the on-line searching and occasionally refer to the appropriate PDF pages and I’ll be fine.

    The damned thing is basically useless; I hate to just toss it in the recycling, but I can’t think of any reason to keep it around.

    I just removed my mailing address from their list, presumably leaving my account info intact; we’ll see if that sticks.