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: Improvements

Making the world a better place, one piece at a time

  • Raspberry Pi Streaming Video Loopback

    Raspberry Pi Streaming Video Loopback

    As part of spiffing my video presence for SquidWrench Zoom meetings, I put a knockoff RPi V1 camera into an Az-El mount, stuck it to a Raspberry Pi, installed the latest OS Formerly Known as Raspbian, did a little setup, and perched it on the I-beam over the workbench:

    Raspberry Pi - workbench camera setup
    Raspberry Pi – workbench camera setup

    The toothbrush head has a convenient pair of neodymium magnets affixing the RPi’s power cable to the beam, thereby preventing the whole lashup from falling off. The Pi, being an old Model B V 1.1, lacks onboard WiFi and requires a USB WiFi dongle. The white button at the lower right of the heatsink properly shuts the OS down and starts it up again.

    Zoom can show video only from video devices / cameras attached to the laptop, so the trick is to make video from the RPi look like it’s coming from a local laptop device.

    Start by exporting video from the Raspberry Pi:

    raspivid --nopreview -t 0 -rot 180 -awb sun --sharpness -50 --flicker 60hz -w 1920 -h 1080 -ae 48 -a 1032 -a 'RPi Cam1 %Y-%m-%d %X'  -b 1000000 -l -o tcp://0.0.0.0:5000

    The -rot 180 -awb sun --sharpness -50 --flicker 60hz parameters make the picture look better. The bottom of the video image There is no way to predict which side of the video will be on the same side as the cable, if that’s any help figuring out which end is up, and the 6500 K LED tubes apparently fill the shop with “sun”.

    The -l parameter causes raspivid to wait until it gets an incoming tcp connection on port 5000 from any other IP address, whereupon it begins capturing video and sending it out.

    Then, on the laptop, create a V4L loopback device:

    sudo modprobe v4l2loopback devices=1 video_nr=10 exclusive_caps=1 card_label="Workbench"

    Zoom will then include a video source identified as “Workbench” in its list of cameras.

    Now fetch video from the RPi and ram it into the loopback device:

    ffmpeg -f h264 -i tcp://192.168.1.50:5000 -f v4l2 -pix_fmt yuv420p /dev/video10

    VLC knows it as /dev/video10:

    RPi - V4L loopback - screen grab
    RPi – V4L loopback – screen grab

    That’s the edge of the workbench over there on the left, looking distinctly like a cliff.

    The RPi will happily stream video all day long to ffmpeg while you start / stop the display program pulling the bits from the video device. However, killing ffmpeg also kills raspivid, requiring a manual restart of both programs. This isn’t a dealbreaker for my simple needs, but it makes unattended streaming from, say, a yard camera somewhat tricky.

    There appear to be an infinite number of variations on this theme, not all of which work, and some of which rest upon an unsteady ziggurat of sketchy / unmaintained software.

    Addendum: If you have a couple of RPi cameras, it’s handy to run the matching ssh and ffmpeg sessions in screen / tmux / whatever terminal multiplexer you prefer. I find it easier to flip through those sessions with Ctrl-A N, rather than manage half a dozen tabs in a single terminal window. Your mileage may differ.

  • Bike Helmet Mirror: Brasswork Clamp

    Bike Helmet Mirror: Brasswork Clamp

    A bit of Quality Shop Time produced a slight improvement to the clamp holding the mirror to the stalk:

    Helmet Mirror Ball Mount - mirror joint brasswork
    Helmet Mirror Ball Mount – mirror joint brasswork

    The general idea is to hold the wave washer (it’s mashed under the flat washer, honest) above those bumps on the plate holding the mirror and stalk balls. It’s a few millimeters from the end of a ¼ inch brass rod, drilled for the M3 screw, and reduced to 4.5 mm with a parting tool to clear the bumps.

    While I was at it, I made two spare mirrors, just to have ’em around:

    Helmet Mirror Ball Mount - new vs old
    Helmet Mirror Ball Mount – new vs old

    The new ball mount looks downright svelte compared to the old Az-El mount, doesn’t it?

    I should replace the steel clamp plates with a stainless-steel doodad of some sort to eliminate the unsightly rust, but that’s definitely in the nature of fine tuning.

  • Mary’s Zucchini Bread Recipe

    Mary’s Zucchini Bread Recipe

    After grating the nutmeg, continue with this:

    Mary's Zucchini Bread Recipe
    Mary’s Zucchini Bread Recipe

    To end up with this:

    Zucchini bread - minus QC sample
    Zucchini bread – minus QC sample

    Mary omits the cloves.

    Applesauce is completely optional. Should you prefer a softer & sweeter loaf, give it a try.

    Conversely, reduce the sugar by about half if you’ve accustomed yourself to a keto-oid diet; the raisins carry enough sweetness for us. You can use brown sugar if you like.

    She derived it from the Garden Way’s Zucchini Cookbook by Ralston & Jordan (© 1977):

    Zucchini Bread Recipe - Garden Way Zucchini Cookbook
    Zucchini Bread Recipe – Garden Way Zucchini Cookbook

    Obviously, cooking is not an exact science; a recipe is just where you start …

    Algorithmic pricing / money laundering is a thing:

    Garden Way Zucchini Cookbook - Amazon listing
    Garden Way Zucchini Cookbook – Amazon listing

    Ya can’t make this stuff up …

  • Keyboard Tray Raising

    Keyboard Tray Raising

    Long ago and far away, I moved the keyboards off our desk surfaces to a more convenient location on a tray under the middle drawer. Mary’s desk recently gained a somewhat thinner keyboard with a thumbwheel volume control, so she wanted the tray moved up:

    Keyboard Tray Relocation - in place
    Keyboard Tray Relocation – in place

    The supports on either side started out as 2×4 lumber with a slot cut (using the radial arm saw I no longer have) for the aluminum sheet:

    Keyboard Tray Relocation - support view
    Keyboard Tray Relocation – support view

    For the record, a pair of screws hold each support to the drawer:

    Keyboard Tray Relocation - support screw
    Keyboard Tray Relocation – support screw

    Not elegant. Works fine. Good enough!

    Tiny Bandsaw™ wasn’t designed for ripsawing lumber, but the same Proxxon 10/14 TPI blade I use for aluminum worked better than I expected to lop a 1-¼ inch strip from the wood slats:

    Keyboard Tray Relocation - bandsaw fixture
    Keyboard Tray Relocation – bandsaw fixture

    That’s a reenactment based on a true story. The wood scraps clamped on the bandsaw table leave enough clearance for the 2×4 slide to freely, yet not enough for the blade to wander off track.

    You can tell how long ago I built the original trays: nary a trace of 3D printing!

  • Nutmeg Season

    Nutmeg Season

    Well, it’s really zucchini bread season, with grated nutmeg among the spices (*):

    Zucchini bread - minus QC sample
    Zucchini bread – minus QC sample

    Having recently bought a very sharp grater, I hauled out a small vise to save my fingertips:

    Nutmeg grating - mini-vise
    Nutmeg grating – mini-vise

    The dark lunette comes from a previous clamping attempt; it takes a while to find the most secure pin arrangement.

    Grate a flat:

    Nutmeg grating - first flat
    Nutmeg grating – first flat

    I’ve always enjoyed the surprisingly intricate patterns inside what looks like a bland nut.

    Flip it over, flatten the other side, and grab it in an even smaller vise:

    Nutmeg grating - flat clamping
    Nutmeg grating – flat clamping

    In truth, that vise is intended for small cylinders, not flattened nuts, but I figured it’d suffice for light-duty use. Grate parallel to the vise screw, reclamp as needed, and it worked out reasonably well.

    Eventually, you have a pile of powder and one cubic nutmeg:

    Nutmeg grating - results
    Nutmeg grating – results

    I’m sure there’s a way to grate the remaining cube, but I’m unwilling to shred my fingertips.

    Tip the powder into a small jar and repeat as needed. Each nutmeg produces about 5 grams and I did three of the things this time.

    Yummy!

    (*) We omit the cloves and knock the sugar down by half. Your tastes will surely differ.

    Update: Mary’s recipe!

  • Bike Helmet Mirror: Ball Mount

    Bike Helmet Mirror: Ball Mount

    Nine years ago, I didn’t know how enough to design a bike helmet mirror with a ball mount, but even an old dog can learn a new trick:

    Helmet Mirror Ball Mount - on helmet
    Helmet Mirror Ball Mount – on helmet

    However, it’s worth noting my original, butt-ugly Az-El mounts lasted for all of those nine years, admittedly with adjustments along the way, which is far more than the commercial mounts making me unhappy enough to scratch my itch.

    The mount adapts the split spherical clamp from the daytime running light:

    Helmet Mirror Mount - Ball
    Helmet Mirror Mount – Ball

    Scaling it down for a 10 mm polypropylene ball around the base of the 30 mm inspection mirror’s shaft simplified everything:

    Helmet Mirror Ball Mount - drilled ball test
    Helmet Mirror Ball Mount – drilled ball test

    I’m reasonably sure I couldn’t have bought 100 polypro balls for eight bucks a decade ago, but we’ll never know. Drilling the hole was a complete botch job, about which more later. The shaft came from a spare mirror mount I made up a while ago; a new shaft appears below.

    The solid model, like Gaul, is in three parts divided:

    Helmet Mirror Ball Mount - Slic3r
    Helmet Mirror Ball Mount – Slic3r

    The helmet plate (on the right) has a slight indent more-or-less matching the helmet curvature and gets a layer of good double-stick foam tape. The clamp base (on the left) has a pair of brass inserts epoxied into matching recesses below the M3 clearance holes:

    Helmet Mirror Ball Mount - inserts
    Helmet Mirror Ball Mount – inserts

    A layer of epoxy then sticks the helmet plate in place, with the inserts providing positive alignment:

    Helmet Mirror Ball Mount - plates
    Helmet Mirror Ball Mount – plates

    The clamp screws pull the inserts against the plastic in the clamp base, so they can’t pull out or through, and the plates give the epoxy enough bonding surface that (I’m pretty sure) they won’t ever come apart.

    I turned down a 2 mm brass insert to fit inside the butt end of the mirror shaft and topped it off with a random screw harvested from a dead hard drive:

    Helmet Mirror Ball Mount - assembled - rear view
    Helmet Mirror Ball Mount – assembled – rear view

    At the start, it wasn’t obvious the shaft would stay stuck in the ball, so I figured making it impossible to pull out would eliminate the need to find it by the side of the road. As things turned out, the clamp exerts enough force to ensure the shaft ain’t goin’ nowhere, so I’ll plug future shafts with epoxy.

    The front side of the clamp looks downright sleek:

    Helmet Mirror Ball Mount - assembled - front view
    Helmet Mirror Ball Mount – assembled – front view

    Well, how about “chunky”?

    The weird gray-black highlights are optical effects from clear / natural PETG, rather than embedded grunge; it looks better in person. I should have used retina-burn orange or stylin’ black.

    This mount is much smaller than the old one and should, in the event of a crash, not cause much injury. Based on how the running light clamp fractures, I expect the clamp will simply tear out of the base on impact. In the last decade, neither of us has crashed, so I don’t know what the old mount would do.

    The clamp is 7 mm thick (front-to-back), set by the M3 washer diameter, with 1.5 mm of ball sticking out on each side. The model has a kerf one thread high (0.25 mm) between the pieces to add clamping force and, with the screws tightened down, moving the ball requires a disturbingly large effort. I added a touch of rosin and that ball straight-up won’t move, which probably means the shaft will bend upon droppage; I have several spare mirrors in stock.

    On the other paw, the ball turns smoothly in the clamp and it’s easy to position the shaft as needed: much better than the old Az-El mount!

    The inspection mirror hangs from a double ball joint which arrives with a crappy screw + nut. I epoxied the old mirror mount nut in place, but this time around I drilled the plates for a 3 mm stainless SHCS, used a wave washer for a bit of flexible force, and topped it off with a nyloc nut:

    Helmet Mirror Ball Mount - mirror joint
    Helmet Mirror Ball Mount – mirror joint

    I’m unhappy with how it looks and don’t like how the washer hangs in free space between those bumps, so I may eventually turn little brass fittings to even things out. It’s either that or more epoxy.

    So far, though, it’s working pretty well and both units meet customer requirements.

    The OpenSCAD source code as a GitHub Gist:

    // Bike helmet mirror mount – ball joint
    // Ed Nisley KE4ZNU 2020-09
    /* [Layout options] */
    Layout = "Build"; // [Build, Show, Plate, Base, Clamp]
    //– Extrusion parameters
    // Extrusion parameters
    /* [Hidden] */
    ThreadThick = 0.25;
    ThreadWidth = 0.40;
    HoleWindage = 0.2;
    function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
    function IntegerLessMultiple(Size,Unit) = Unit * floor(Size / Unit);
    Protrusion = 0.1; // make holes end cleanly
    inch = 25.4;
    ID = 0;
    OD = 1;
    LENGTH = 2;
    //- Basic dimensions
    MountDia = 30.0; // footprint on helmet
    BallDia = 10.0;
    BallRad = BallDia / 2;
    WallThick = IntegerMultiple(2.0,ThreadWidth);
    FloorThick = IntegerMultiple(2.0,ThreadThick);
    CornerRound = 2.0;
    Insert = [3.0,4.0,4.0]; // threaded brass insert
    Screw = [3.0,5.5,25.0]; // clamp screw
    Washer = [3.7,7.0,0.7]; // washer
    ShowGap = 2.0;
    BuildGap = 5.0;
    //– Helmet Interface Plate
    ScrewOC = BallDia + 2*WallThick + Screw[ID];
    echo(str("Screw OC: ",ScrewOC));
    Clamp = [ceil(Washer[OD]), // barely holds washer under screw
    ScrewOC + Washer[OD], // minimal clearance for washer
    BallDia +2*FloorThick // screw fits through insert
    ];
    Kerf = ThreadThick;
    echo(str("Clamp: ",Clamp));
    HelmetCX = 60.0; // empirical helmet side curve
    HelmetMX = 3.0;
    HelmetRX = (pow(HelmetMX,2) + pow(HelmetCX,2)/4)/(2*HelmetMX);
    HelmetPlateC = MountDia;
    HelmetPlateTheta = atan(HelmetPlateC/HelmetRX);
    HelmetPlateM = 2*HelmetRX*pow(sin(HelmetPlateTheta/4),2);
    echo(str("Plate indent: ",HelmetPlateM));
    HelmetPlateThick = max(FloorThick,0.6*Insert[LENGTH]) + HelmetPlateM;
    echo(str("Screw length: ",Clamp.z + Insert[LENGTH]));
    MountSides = 2*3*4;
    //———————-
    // Useful routines
    module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes
    Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
    FixDia = Dia / cos(180/Sides);
    cylinder(r=(FixDia + HoleWindage)/2,h=Height,$fn=Sides);
    }
    //———————-
    // Clamp frame around ball
    module ClampFrame() {
    difference() {
    union() {
    hull()
    for (i=[-1,1], j=[-1,1]) {
    translate([i*(Clamp.x/2 – CornerRound),j*(Clamp.y/2 – CornerRound),Clamp.z/2 – CornerRound])
    sphere(r=CornerRound,$fn=24);
    translate([i*(Clamp.x/2 – CornerRound),j*(Clamp.y/2 – CornerRound),-Clamp.z/2])
    cylinder(r=CornerRound,$fn=24);
    }
    for (j=[-1,1])
    translate([0,j*ScrewOC/2,0])
    rotate(180/12)
    cylinder(d=Washer[OD],h=Clamp.z/2,$fn=12);
    }
    sphere(d=BallDia + HoleWindage,$fn=48);
    cube([2*MountDia,2*MountDia,Kerf],center=true);
    for (j=[-1,1])
    translate([0,j*ScrewOC/2,-Screw[LENGTH]])
    rotate(180/6)
    PolyCyl(Screw[ID],2*Screw[LENGTH],6);
    }
    }
    module ClampSelect(Section) {
    XlateZ = (Section == "Top") ? Clamp.z/2 :
    (Section == "Bottom") ? -Clamp.z/2 :
    0;
    intersection(convexity=5) {
    ClampFrame();
    translate([0,0,XlateZ])
    cube([2*Clamp.x,2*Clamp.y,Clamp.z + 2*Protrusion],center=true);
    }
    }
    //———————-
    // Concave plate fitting helmet shell
    module HelmetPlate() {
    render()
    difference() {
    cylinder(d=MountDia,h=HelmetPlateThick,$fn=MountSides);
    translate([0,0,HelmetPlateThick – HelmetPlateM + HelmetRX])
    sphere(r=HelmetRX,$fn=128);
    for (j=[-1,1])
    translate([0,j*ScrewOC/2,-Protrusion]) {
    PolyCyl(Insert[OD],0.6*Insert[LENGTH] + Protrusion,6);
    PolyCyl(Screw[ID],2*HelmetPlateThick,6);
    }
    }
    }
    //———————-
    // Base of clamp ring
    module MountBase() {
    difference() {
    union() {
    cylinder(d=MountDia,h=FloorThick,$fn=MountSides);
    translate([0,0,FloorThick + Clamp.z/2])
    ClampSelect("Bottom");
    }
    for (j=[-1,1])
    translate([0,j*ScrewOC/2,-Protrusion])
    rotate(180/6)
    PolyCyl(Insert[OD],0.6*Insert[LENGTH] + Protrusion,6);
    }
    }
    //———————-
    // Lash it together
    if (Layout == "Plate") {
    HelmetPlate();
    }
    if (Layout == "Base") {
    MountBase();
    }
    if (Layout == "Clamp") {
    ClampFrame();
    }
    if (Layout == "Show") {
    rotate([180,0,0])
    HelmetPlate();
    translate([0,0,ShowGap]) {
    MountBase();
    color("Ivory",0.3)
    translate([0,0,Clamp.z/2 + FloorThick + ShowGap/2])
    sphere(d=BallDia);
    translate([0,0,Clamp.z/2 + FloorThick + ShowGap])
    ClampSelect("Top");
    }
    }
    if (Layout == "Build") {
    translate([MountDia/2 + BuildGap,0,0])
    HelmetPlate();
    translate([-(MountDia/2 + BuildGap),0,0])
    MountBase();
    translate([0,MountDia/2 + BuildGap,Clamp.z/2])
    rotate([0,180,0])
    rotate(90)
    ClampSelect("Top");
    }

    The original doodles include a bit of dress-up fairing that didn’t make the cut:

    Helmet Mirror Ball Mount - doodles
    Helmet Mirror Ball Mount – doodles
  • Discrete LM3909: Blue LED Waveforms

    Discrete LM3909: Blue LED Waveforms

    The circuitry and instrumentation is essentially the same discrete LM3909 as before:

    LM3909 - blue - test setup
    LM3909 – blue – test setup

    With a few minor tweaks:

    • Blue LED, forward voltage 2.56 to 2.97 V
    • 24 Ω R1
    • One Q2 current mirror transistor driving Q3

    With a pair of fresh AA alkaline cells producing 3.1 V (not the NiMH Duracells you see in the picture), the blue LED blinks brightly.

    The 610 mV peak voltage across R1 shows the LED starts at 25.4 mA:

    LM3909 blue - 3.1 V - R1 24 ohm
    LM3909 blue – 3.1 V – R1 24 ohm

    The capacitor reaches 1 V, then goes about 150 mV into reverse charge during the flash (note the different horizontal scales):

    LM3909 blue - 3.1 V - C1 V
    LM3909 blue – 3.1 V – C1 V

    The Darlington version of Q1 seems to do a decent job of keeping the cap out of reverse charge. A Shottky diode would add a few hundred mV, but I doubt there’s anything nasty going on inside the cap as it stands.

    The blue LED has a forward drop of 2.97 V at 20 mA, so I’m surprised the voltage across it hits 3.1 V at 25 mA:

    LM3909 blue - 3.1 V - LED V
    LM3909 blue – 3.1 V – LED V

    Very little of the voltage appears across Q3, the driver transistor:

    LM3909 blue - 3.1 V - Q3 coll
    LM3909 blue – 3.1 V – Q3 coll

    With a pair of nearly dead alkaline cells for a 2.0 V supply, the LED current peak drops to 4.6 mA:

    LM3909 blue - 2.0 V - R1 24 ohm
    LM3909 blue – 2.0 V – R1 24 ohm

    The LED lights brightly, then fades away exactly like you’d expect from that waveform.

    The cap still charges to about 1 V and stays well above 0 V during the (much longer) flash:

    LM3909 blue - 2.0 V - C1 voltage
    LM3909 blue – 2.0 V – C1 voltage

    The voltage across the LED now reaches only 2.7 V, which is substantially higher than the 2.0 V battery supply and exactly why the LM3909 existed:

    LM3909 blue - 2.0 V - LED voltage
    LM3909 blue – 2.0 V – LED voltage

    Q3 continues to saturate, although you can see the effect of the decreased base drive during the flash:

    LM3909 blue - 2.0 V - Q3 coll
    LM3909 blue – 2.0 V – Q3 coll

    The blue LED won’t light at 1.3 V, but still gives out a weak flash at 1.7 V, so I’d say the tweaked LM3909 circuitry works reasonably well.