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: Recumbent Bicycling

Cruisin’ the streets

  • Hall Effect LED Current Control: First Light

    This hideous proof-of-concept lashup gathers a bunch of stuff I’ve been investigating into what’s definitely in the running for the most over-the-top LED blinky light ever:

    Hall Effect LED Current Control - breadboard overview
    Hall Effect LED Current Control – breadboard overview

    The general idea:

    A closer look at the key analog parts:

    Hall Effect LED Current Control - breadboard detail
    Hall Effect LED Current Control – breadboard detail

    The ferrite toroid near the middle surrounds that same “49E” Hall effect sensor. The ZVNL14 logic-level MOSFET in the lower right runs with about 2.4 V on the gate to put 120 mA through the LEDs. The cluster of parts just above it are the RC low-pass PWM filter, with the PWM running at 32 kHz. The snippet of perfboard near the top adapts a MAX4330 op amp to DIP pins. I used the twiddlepots to bring up the op amp and MOSFET circuitry by force-feeding bias and gate voltages.

    The Arduino Pro Mini closes the feedback loop from current sensor to MOSFET gate. A knockoff Arduino Pro Mini is a $5 component, in onesies, delivered halfway around the planet. For low-volume stuff like this, you just build it right in and move on; there’s no reason to lay out a PCB with an ATmega328 chip and a handful of other parts. Unless you’re worried about power consumptions, as described below.

    The schematic:

    Hall Effect Current Feedback LED Driver - prototype schematic
    Hall Effect Current Feedback LED Driver – prototype schematic

    The MAX4330 removes the Hall effect sensor’s VCC/2 bias, but it turns out the offset varies by enough from part to part and over temperature that a single twiddlepot setting won’t suffice. The RC filter near the middle of the schematic converts an Arduino PWM output into a voltage between 2.0 and 3.0 V, which puts more PWM resolution where it matters; the default 0.4% PWM steps are just too coarse. I think 16 bit PWM resolution would be A Very Good Thing here.

    The first-pass program nulls the offset once, during the startup routine, but nulling whenever the LEDs turn off would be a Good Idea. The offset steps are 8 mV, about what you’d expect from 2/5 of the nominal 20 mV PWM increments. It ramps the offset up from zero, but you’d probably want to use a binary search.

    The op amp has a voltage gain of about 28 that scales the toroid-plus-Hall-sensor output so that 500 mA in the winding produces 5 V. That gain isn’t quite high enough for the 120 mA I’m using for this collection of LEDs , but it makes the coefficient a nice round 0.10. It’d be good to have a calibrated current load, something around 100 mA, that would allow auto-calibration.

    A 50% voltage divider lets the Arduino measure the nominal 7.4 V battery voltage and decide when to lower the current or change the blink pattern or kvetch about imminent blackout or something. Knowing both the battery voltage and the resistance of the current calibration load would let the program calculate the actual current for calibration. Given two calibration loads, then you could derive both the gain and the remaining offset; that’s likely too much trouble.

    The Pro Mini board has a voltage regulator that provides +5 V for everything else in the circuit, which means putting the microcontroller into sleep mode won’t save any battery power. I think a p-channel MOSFET switch and a suicide output from the Arduino will be in order. A vibration sensor would give you auto power on and off, which would be a nice touch; MEMS sensors seem to want 3.3-ish V for supply and logic.

    The entire lashup runs at about 60 mA with the LEDs turned off, which is way too high and may include some breadboard screwups; considerable reduction will be in order before this circuit makes any sense. The Hall effect sensor costs about 4 mA all by itself, plus another milliamp in the load resistor. The microcontroller should be around 10 – 20 mA, but the datasheet makes some assumptions that aren’t true for the Arduino runtime.

    The program brute-forces the pulse timing, just to get this thing working. The main loop stalls while the LEDs are on, which is obviously a Bad Thing. The ADC conversions do some averaging, but I’m not confident it works well enough. The PWM output routine includes an entirely empirical delay to cover the filter time constants.

    The blink pattern should be in a table. Given linear current control, you can have variable brightness; a “night taillight” mode that isn’t so shatteringly bright would be a Good Idea. The table might contain gate voltages for each current level, updated during the last pulse, so that the output would be Pretty Close at the beginning; you’d measure those values during startup.

    A button or two for mode selection might be in order. Sealing buttons is always a problem, but this thing might not be totally waterproof anyway.

    But it blinks!

  • Wouxun KG-UV3D Batteries: Age and Cycle Effects

    The first Wouxun (evidently pronounced “ocean”) KG-UV3D HT spent a month or two in my bike, lashed to a kludged version of the APRS+voice interface box and powered by its own lithium-ion pack. After I got the circuit worked out and built a duplicate, I picked up a second HT for Mary’s bike; as a result, that battery pack never got much use.

    A pair of discharge tests shows the difference:

    Wouxun 7.4 V Packs
    Wouxun 7.4 V Packs

    The 2011-03 battery has almost exactly the rated 1.7 A·h capacity, at least if you’re willing to run it down to 6 V, and the 2012-06 pack delivers 1.9 A·h. Electronic gadgets measure state-of-charge using the battery voltage, so the older pack “looks” like it has much less capacity: it runs about 100 mV lower than the newer pack out to 1.2 A·h, then falls off the cliff. Looks to me like one of the two cells inside is fading faster than the other; so it goes.

    I’m still thinking of using these to power some LED taillights, because they have a nice form factor and built-in latches:

    Wouxun KG-UV3D - battery pack latch
    Wouxun KG-UV3D – battery pack latch
  • Utility Bicycling: Hauling Onions

    Yet Another Reason why I have a BOB Yak trailer for the ‘bent:

    Tour Easy with BOB Yak - hauling onions
    Tour Easy with BOB Yak – hauling onions

    That’s about 30 pounds of onions, all 80 of which are now drying on the patio for winter use…

  • Tour Easy: Yet Another Shifter Pulley

    Somehow, I think I’m never going to get around to doing a CNC version of this thing, but at least now I have more pictures…

    The overall problem comes from the fact that the Tour Easy frame geometry doesn’t match the expectations of the front shifter: the cable bends over a small finger that, on a diamond frame bike, should simply hold it in position. Here’s the finger, with a very early version of the pulley that just holds the cable slightly higher than the normal position, complete with one snapped wire showing that the pulley wasn’t getting the job done:

    Front derailleur cable - broken strand
    Front derailleur cable with broken strand

    The obvious solution involves running the cable over a nice, rounded surface that prevents abrupt bending. The most recent version looks like this:

    Shifter pulley installed - left view
    Shifter pulley installed – left view

    Yes, the end of the cable sticks out over the chain; I haven’t tucked it in yet.

    A bit of lathe work produces a 0.42 inch diameter thin brass disk with a 50 mil half-circle trench around it; in retrospect, the diameter of the trench bottom should be 0.42 inch and the OD should be about 0.45 inch. If you have really good parting-off-fu, you can produce a disk with a finished backside right on the lathe, but I had to drill an off-center hole anyway, so I thinned it on the Sherline:

    Shifter pulley - thinning
    Shifter pulley – thinning

    It looks like this after all the thinning:

    Shifter pulley - thinned
    Shifter pulley – thinned

    One flange is wider than the other: the thin flange faces front and gets a bunch of cutouts, the wide flange faces rearward and must support the bitter end of the cable.

    I lined it up in the shifter, filed a notch to fit around the shifter finger, scribed the hole location, clamped it down, and drilled the hole:

    Shifter pulley - center drilling
    Shifter pulley – center drilling

    I think the hole could be on-center with the larger disk; now that I’m keeping better notes, I’ll try that next time. If so, then I can drill it on the lathe, part it off to the correct width, and hand-file the backside flat. The general idea is to have the cable pass over the finger, which almost happens with the smaller diameter.

    Some tedious hand-filing produces notches that index over the finger and clear some protuberances on the shifter arm. This is the front face of the pulley that sits against the shifter arm, with a 5 mm socket head cap screw for scale:

    Shifter pulley with bolt - front face
    Shifter pulley with bolt – front face

    The rear face has one side of the trench filed away to get the cable out of the trench and around the bolt:

    Shifter pulley with bolt - rear face
    Shifter pulley with bolt – rear face

    Then it looks like this from the right side of the bike:

    Shifter pulley installed - right view
    Shifter pulley installed – right view

    A pleasant morning with some Quality Shop Time…

  • Public Facilities Maintenance: Lack Thereof

    I have a deep and abiding cynicism about the wisdom of building Special Facilities for bicycles and pedestrians. We very much enjoy biking along the Dutchess County Rail Trail, but I fear the County’s initial enthusiasm and funding will quickly wear off, leaving us with another poorly maintained facility.

    For example, the section of trail just south of Morgan Lake (a.k.a., Phase II) opened in July 2009, a mere four years ago. This view shows the North Grand Avenue at-grade crossing:

    DCRT N Grand - overview
    DCRT N Grand – overview

    Shortly after the opening, the ADA-mandated vision-impaired tactile pavement strips at that crossing began to deteriorate and, by now, they’re just rubble-filled depressions across the trail on either side of the road.

    The south strip:

    DCRT N Grand - South ADA Strip
    DCRT N Grand – South ADA Strip

    The north strip:

    DCRT N Grand - north ADA strip
    DCRT N Grand – north ADA strip

    Evidently, the Official Personnel traversing the DCRT lack the responsibility / authority / initiative to apply a broom and sweep the pebbles out of the path, much less schedule a repair crew. I suppose I should haul a shovel along on one of our trips and privatize the upkeep; it’s been two years, so further waiting will be pointless.

    It’s not as though there’s no Official Traffic, as witnessed by this well-worn informal entrance at the south end of that trail segment:

    DCRT Overocker - vehicle tracks
    DCRT Overocker – vehicle tracks

    There’s an Official Gate just to the left of the trail at that crossing, but, judging from the weeds, it’s evidently easier to stay in the car or truck than get out and unlock the barrier:

    DCRT Overocker - vehicle gate
    DCRT Overocker – vehicle gate

    Perhaps pebbles now count as tactile paving.

  • Coaxial Power Plug Tip: Extraction Thereof

    Another coaxial power plug lost its tip inside a lithium ion battery pack used with the APRS + Voice circuitry on our bikes, as I could barely see at the bottom of the socket:

    LiIon Pack - output socket
    LiIon Pack – output socket

    Rather than cutting the pack apart, I buttered up the end of an intact plug with some ABS solvent glue (a hellish homebrew mixture of acetone and MEK), rammed it into the socket, and held it in place for a minute:

    LiIon Pack - undamaged plug insertion
    LiIon Pack – undamaged plug insertion

    The tip emerged on the first try:

    LiIon Pack - rescued plug tip joined
    LiIon Pack – rescued plug tip joined

    Even better, it cracked off the plug without too much effort:

    LiIon Pack - rescued plug tip separated
    LiIon Pack – rescued plug tip separated

    More solvent glue and a few hours of clamping worked fine:

    LiIon Pack - clamped plug tip
    LiIon Pack – clamped plug tip

    That cable is now back in service.

  • BOB Yak Trailer: New New Grenade Pin Straps

    Somehow, I thought those neoprene O-rings that replaced the grenade pin straps on my BOB Yak trailer would last more than one season, but they’ve already rotted out. A bit of rummaging produced a hank of rubber gasket intended to secure window screen in its aluminum frame, so it’s presumably better suited to an outdoor life than O-rings; it comes without provenance, so I have no idea what it’s made of.

    A few snips, a handful of cable ties, and it’s all good again:

    BOB Yak Grenade Pins - new strap
    BOB Yak Grenade Pins – new strap

    But I’m not expecting a decade out of these straps, that’s fer shure…