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

  • Long-lived CFL Bulb

    This compact fluorescent lamp seems to have survived nearly two decades of use in a desk lamp:

    Desk Lamp - long lived CFL
    Desk Lamp – long lived CFL

    It had plenty of starts, although maybe not so many total hours, as the other CFLs you’ll find mentioned around here.

    I swapped in a similar CFL and we’ll see what happens.

  • Halogen Desk Lamp Conversion: Preliminaries

    A discarded 20 W halogen desk lamp arrived in the Basement Laboratory for rebuilding:

    Halogen Desk Lamp - head layout
    Halogen Desk Lamp – head layout

    An incandescent bulb doesn’t care about AC or DC, so a simple transformer also serves as a counterweight in the base:

    Halogen Desk Lamp - 12 V 20 W transformer
    Halogen Desk Lamp – 12 V 20 W transformer

    I might replace it with some steel sheets, although I have no immediate need for a bare transformer.

    A case adds 19¢ to each 10 W 300 mA LED driver:

    Halogen Desk Lamp - 10 W LED driver innards
    Halogen Desk Lamp – 10 W LED driver innards

    Nice strain relief on those line-voltage wires, eh?

    A simple test setup with three 3 W COB LED panels:

    Halogen Desk Lamp - 3x3W COB LED test
    Halogen Desk Lamp – 3x3W COB LED test

    I clamped them to the aluminum sheet for heatsinking before I lit ’em up. The circles traced directly from the lamp’s hardware give some idea of the eventual layout.

    I have more-intense LEDs, but spreading the light over a larger area should work better for the intended purpose. These are pleasant warm-white LEDs, too.

    The fourth LED raised the forward voltage beyond the supply’s 42 V maximum, causing the supply to blink on and off.

    Much to my surprise, the driver has plenty of 60 Hz ripple:

    COB LED 3x3W - 10 W driver - 100 mA-div 10 V-div
    COB LED 3x3W – 10 W driver – 100 mA-div 10 V-div

    The top trace averages 280 mA and the bottom trace 32 V, so the LEDs run at 9 W = 3 W apiece, as they should.

    Now, for some metalworking …

  • Magnifying Desk Lamp Pivot Clamp Repair

    The clamp holding the magnifying lamp (with a fluorescent ring light!) over the Basement Laboratory Desk finally fractured:

    Magnifying Lamp Pivot - broken parts
    Magnifying Lamp Pivot – broken parts

    Gorilla Tape held the broken parts together well enough to determine how it used to work:

    Magnifying Lamp Pivot - hole sizing
    Magnifying Lamp Pivot – hole sizing

    The two parts used to be 11.2 mm thick, but it fit on a random chunk of half-inch aluminium plate so perfectly as to constitute a Good Omen:

    Magnifying Lamp Pivot - stock layout
    Magnifying Lamp Pivot – stock layout

    I decided the saw kerf would make up the difference, because, sheesh, we’re talking pot metal here.

    Lay out the center, use a transfer punch the same diameter as the lamp pivot to get the proper spacing, give it a whack:

    Magnifying Lamp Pivot - hole marking
    Magnifying Lamp Pivot – hole marking

    The alert reader will note I came that close to drilling the hole through the wrong side of the angle.

    And, yes, extrapolating the vertical edge downward suggests the large hole-to-be will intersect the small hole-in-being. This is deliberate: the clamp screw through the smaller hole fits into a recess around the lamp pivot shaft to keep it from sliding to-and-fro. I had to convince myself, but it really did work out OK.

    Pay some attention to clamping it at right angles to the spindle so the big hole goes through more-or-less in the right direction:

    Magnifying Lamp Pivot - drill press alignment
    Magnifying Lamp Pivot – drill press alignment

    The masking tape serves as a depth reminder:

    Magnifying Lamp Pivot - drilling
    Magnifying Lamp Pivot – drilling

    Set it up in a machinist’s clamp, bandsaw in twain, file the kerf reasonably flat, clamp the halves together, then bandsaw the clearance slot:

    Magnifying Lamp Pivot - clearance slot
    Magnifying Lamp Pivot – clearance slot

    The clearance kerf wasn’t nearly as on-center as I wanted, which doesn’t really matter, but I filed a bit more diligently on the shallow side while clearing up the slot:

    Magnifying Lamp Pivot - clearance filing
    Magnifying Lamp Pivot – clearance filing

    Introducing the new parts to Mr Disk Sander roundified them enough to pass inspection. These angular bits obviously require a bit more attention to detail:

    Magnifying Lamp Pivot - parts
    Magnifying Lamp Pivot – parts

    The lamp originally had a fancy knob on the screw which never worked particularly well, so I replaced it with a nylon locking nut to maintain a reasonable amount of pressure:

    Magnifying Lamp Pivot - installed
    Magnifying Lamp Pivot – installed

    The far end of the screw has a square shaft fitting into a square hole in the lamp arm, making it easy to torque the nut enough to make the pivot grip the shaft  properly; if I ever find my Belleville washer stash again, I’ll add one. I should cut the screw off, too, but that’s definitely in the nature of fine tuning.

    A pleasant morning of Quality Shop Time!

    The obligatory doodle with dimensions, some of which turned out to be completely incorrect:

    Magnifying Lamp Pivot - dimension doodles
    Magnifying Lamp Pivot – dimension doodles

     

  • Debranded HP w2408 Monitor: Revived

    Three years ago I found a bulgy electrolytic cap inside a failed HP w2408 monitor:

    HP 2408 monitor power supply - HV cap bulge
    HP 2408 monitor power supply – HV cap bulge

    Back then, a 150 µF 450 V cap of the proper size (the 30 mm height being critical) was difficult to find and relatively expensive to purchase in onesies from the usual reliable sources, particularly as the repair advice I could find suggested it probably wasn’t the causing the monitor’s problems. So the monitor sat in pieces in an out-of-the-way corner of the Basement Laboratory while other events transpired.

    As part of a long-delayed Great Cleanup of Small Projects, I discovered the caps are now four bucks delivered from halfway around the planet, so I got one, did the swap, reassembled the pieces, and the monitor works just like new. No pix, but you get the general idea.

    For another few years, anyway.

    For whatever reason, the 3.5 mm audio output seems dead. The monitor has a pair of teeny speakers that don’t do justice to its magnificent HDMI audio, but they’re entirely adequate for my simple needs: pre-SSH Raspberry Pi setup doesn’t call for much.

  • Refurbished LED Panels

    A recent Squidwrench meeting produced a treasure trove of discarded LED lighting, including a shoplight-style fixture in a narrow, finned aluminum extrusion. It was in “known-bad” condition, so I extracted the four LED panels, connected each one to a widowmaker cord, and determined I had two good ones, a mostly working one sporting some dead LEDs, and a corpse.

    The working panels showed the power supplies produced about 19 V across two parallel strings of six LEDs, with each string running at 350 mA for a total of 700 mA = 13 W. I wired up a quartet of 6 Ω power resistors to check out the power supplies from the suspect panels:

    LED Panel - power supply test setup
    LED Panel – power supply test setup

    The supply in the background is truly dead. I can’t tell whether it killed the LEDs or the gaggle of failing LEDs dragged it down with them.

    Some multimeter probing revealed enough live LEDs to restore the partially working panel. A rather sweaty interlude at the SqWr hot-air rework station transplanted the good LEDs, whereupon combining it with the live supply gave me a third fully functional panel:

    LED Panel - restored
    LED Panel – restored

    I did the test firing in the Basement Laboratory, because I’m nowhere near crazy enough to deploy a widowmaker line cord on the SqWr Operating Table in public.

    I bandsawed the last working LED from the gutted donor panel:

    LED Panel - single LED test
    LED Panel – single LED test

    The SMD LEDs mount on traces applied to and electrically insulated from the aluminum sheet, so unsoldering them required way more heat than you (well, I) might expect at first glance. A snap-on condenser lens over each LED concentrates the light into a nice cone, producing a narrow sheet of light from each panel.

    The elaborate aluminum extrusion seems much too heavy for the individual panels, but those open-frame supplies definitely need more than casual protection. Now that LEDs are more common than when these panels came off the assembly line, I should probably replace the supplies with enclosed constant-current drivers and be done with it.

  • Squidwrench Electronics Workshop: Session 5

    Topics for today’s Squidwrench Electronics Workshop: Session 5 in a continuing series.

    Having discussed transistors as current-controlled current sources, we can now select one as a victim use one as a switch, then add capacitors to learn about exponential charging, and introduce the oscilloscope as a vital tool.

    NPN Switch - protoboard
    NPN Switch – protoboard

    So, we proceed:

    Transistors as switches

    Review graphical parameters

    • saturation voltage for high Ic
    • cutoff voltage for near-zero Ic
    • resistive load line: VR = Vcc – Vc
    • power dissipation hyperbola (at all Vc)
    • secondary breakdown limit (at higher Vc)

    Something like this, only drawn much larger and with actual numbers:

    Transistor characteristics - saturation and cutoff - load line
    Transistor characteristics – saturation and cutoff – load line

    Reminder of linear vs. log scales converting hyperbolas into straight lines.

    NPN transistor as “to ground” switch

    • where to measure device voltages?
    • passing mention of flyback diodes
    • IB needed for saturation?
    • Darlington transistors: beta multiplier, VBE adder

    For example:

    NPN switch - LED
    NPN switch – LED

    Without the LED, you get nice square waves:

    NPN - 100 Hz - 2.2k - no cap - Vc
    NPN – 100 Hz – 2.2k – no cap – Vc

    An ancient green LED reduces Vc by a little over a volt:

    NPN - 100 Hz - 2.2k green LED - no cap - Vc
    NPN – 100 Hz – 2.2k green LED – no cap – Vc

    Discuss PNP transistor as “from supply” switch

    • why VCC must not exceed controller VDD
    • kill microcontroller and logic gates

    Wire up pulse gen to transistor

    • function generator for base drive voltage
    • collector resistor (then LED) as output
    • how do you know what it’s doing?
    • add oscilloscope to show voltages
    • explanation of scope functions!

    Capacitor as charge-storage devices

    Useful ideas and equations

    • C = Q/V
    • so C = ΔQ/ΔV
    • therefore i = C * Δv/Δt
    • energy = 1/2 * C * V²

    Charging capacitor from a voltage source through a resistor

    • Exponential waveform: e^t/τ
    • time constant τ=RC
    • show 3τ = 5%
    • and 5τ < 1%

    Add cap to transistor switch with R to soften discharge path

    • charge vs discharge paths
    • calculate time constants
    • wire it up
    • verify with oscilloscope

    The circuit will look like this:

    NPN switch - Cap charge-discharge
    NPN switch – Cap charge-discharge

    Discussion of parts tolerance: 100 nF caps are really 78 nF

    With one cap:

    NPN - 100 Hz - 2.2k 2.2k 78nF - Vc Vcap
    NPN – 100 Hz – 2.2k 2.2k 78nF – Vc Vcap

    Add another cap for twice the time constant:

    NPN - 100 Hz - 2.2k 2.2k 2x78nF - Vc Vcap
    NPN – 100 Hz – 2.2k 2.2k 2x78nF – Vc Vcap

    Let the scope calculate 10-90% rise time:

    NPN - 100 Hz - 2.2k 2.2k 2x78nF - Vc Vcap - rise fall times
    NPN – 100 Hz – 2.2k 2.2k 2x78nF – Vc Vcap – rise fall times

    Useful relations:

    • rise time = 2.2 τ (compare with calculations!)
    • rise time = 0.34/BW

    Do it on hard mode with the old Tek scope for pedagogic purposes.

    That should soak up the better part of four hours!

     

  • Streaming Radio Player: I2C Display

    Although I2C on the Raspberry Pi fails with devices using clock stretching, cheap I2C OLED displays seem to work well enough to not generate any problems search-able with the obvious keywords:

    RPi I2C OLED
    RPi I2C OLED

    Given a picture of the header pinout, the wiring is trivially easy:

    RPi I2C OLED - RPi header detail
    RPi I2C OLED – RPi header detail

    Using yellow for the ground hurts a bit, but that’s what I get for peeling the SPI cable down to four wires. The pin directly adjacent to the green wire is also ground, should that be easier to reach.

    Tweaking the Luma driver to use I2C doesn’t require much:

    #from luma.core.interface.serial import spi
    from luma.core.interface.serial import i2c
    
    ... snippage ...
    
    # reduce SPI bus from default 8 MHz to (maybe) avoid OLED failure-to-start
    #serial = spi(device=0,port=0,bus_speed_hz=1000000)
    
    # use I2C bus to avoid SPI timing spec failure
    serial = i2c(port=1,address=(0x78 >> 1))     # PCB label = 0x78, low bit = R/W
    

    The OLED PCB lists the I2C address with the R/W bit

    And then It Just Works, with one gotcha. Although the Python program shuts itself and the system down, the wall wart continues to supply power and, because the I2C bus doesn’t include a Reset line, the OLED display doesn’t know the RPi has gone away. So you must issue a command to turn it off before shutting down:

    device.cleanup()        # ideally, switches to low-power mode
    rc = subp.call(['sudo','shutdown','-P','now'])
    

    Now, to discover what works … oddly … with these displays.