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

  • Plug Alignment for ICOM IC-Z1A Radio

    Plugs and jack alignment plates
    Plugs and jack alignment plates

    As I mentioned there, I originally connected my bicycle-mobile amateur radio gadget to the ICOM IC-Z1A radio using separate mic and speaker plugs. That seemed like a good idea, but bicycles vibrate a lot and the plugs apply enough leverage to the jacks inside the radio to pry them right off the PCB. That requires a protracted repair session that I never wanted to do again.

    The solution is to mount both plugs rigidly on the radio so that they simply can’t move. I dithered for a while and finally decided that function trumps good looks on this project, particularly given that our radios spend their entire lives inside a bag behind the bike seats.

    The top picture shows the small aluminum plates I made to align the plugs to the HT jacks, along with a plastic gluing fixture to hold the plugs parallel while the epoxy cures. If you just jam the plugs into the radio without an alignment fixture, you will glue the plugs together in such a way that they cannot be removed: the radio does not hold the shafts exactly parallel!

    Plug stabilization - What Not To Do
    Plug stabilization – What Not To Do

    How do I know? Well, I tried doing exactly that by simply epoxying the existing plugs into place, applying enough epoxy putty to stabilize the plugs against the radio. Looks reasonable, but when it came time to take them out (and you will want to take them out, trust me) they are firmly and permanently embedded. I had to carve them apart to get them out.

    The mic, speaker, and coaxial power jacks are 10 mm on center. The 2.5 mm mic plug has a small shoulder that required a matching recess in the plate, while the 3.5 mm speaker plug is basically a cylinder. I don’t use the coaxial power jack, having hacked an alkaline battery pack with Anderson Powerpoles. The plate’s external contour matches the flat area atop the radio around the jacks.

    You could lay out and drill close-enough holes by hand, use a step drill to make the shoulder recess, and then let the epoxy do the final alignment. However, you want the center-to-center distance exactly spot-on correct, as the plugs won’t mate properly otherwise. I turned it into a CNC project for my Sherline mill, of course, but that’s just because I have one.

    HT Plugs in gluing fixture
    HT Plugs in gluing fixture

    This picture shows two plugs epoxied into the plate. While the epoxy cures, the plate rests atop the fixture with the two plugs vertical and their shell flanges flush against it. I applied the epoxy with a toothpick and worked it into the gap between the threads and the plate.

    The end result will be a pair of plugs that exactly match the radio’s jacks in a plate that sits firmly atop the radio’s case. You should find that the plugs snap firmly into place and the entire assembly is absolutely rigid.

    Caveat: don’t use an aluminum plate if your radio depends on separate electrical connections for the mic and speaker plug shells. The IC-Z1A has isolated shells, but remains happy when they’re connected. My Kenwood TH-F6A HT uses the shells for entirely different functions and will not work with them shorted together.

    With the epoxy cured, wire the connections as usual. I had a small cable with enough tiny wires to put the mic conductors in their own shielded pair, but that’s likely overkill.

    Finished plugs with epoxy blob
    Finished plugs with epoxy blob

    You could machine a nice enclosure, but I simply molded an epoxy putty turd around the connections, shells, and cable. The trick is to wait until it’s nearly cured, plug it into the radio, then shave off whatever gets in the way of the knobs, antenna plug, and other appurtenances.

    It may not look elegant, but it works great!

  • Bicycle Mobile Mic Amp Debug: It’s the Connector

    The radio on Mary’s bike has been misbehaving over the last few months: the PTT button on the handlebars occasionally had no effect. Debugging this sort of intermittent problem is quite difficult, as it would sometimes fail and repair itself before we could get stopped in a safe place where I could poke around in the wiring.

    After months of this nonsense, I narrowed the failure down to the short cable from the HT’s mic jack to the interface board: by positioning the cable just so, the radio would work fine for days or weeks at a time. I taped the thing in position and all was well, at least for a few days or weeks at a time.

    HT audio interface - 2001
    HT audio interface – 2001
    HT audio interface - 2009
    HT audio interface – 2009

    These two pictures show what the interface looked like back in 2001 when I put it together (modified from another version I did in 1997!) and what it looks like today. The most significant change is in the plugs connecting the whole affair to the HT: a CNC-machined plate holds them perfectly parallel at the proper spacing and an epoxy-putty turd fuses them into a rigid mass. More on that sub-project tomorrow…

    Loose plugs, it turns out, vibrate the HT’s jacks right off the circuit board in short order and those jacks are a major pain to replace. Ask me how I know…

    The wire break seemed to be precisely where the mic cable exits the epoxy turd. You’d expect a fatigue fracture to occur at that spot, so I wasn’t particularly surprised, although I was amazed that the thing hadn’t failed completely over the months I spend fiddling with it. I finally resolved to fix this once and for all, which meant either flaying the cable and patching the wire in situ or rebuilding the whole connector assembly. Either choice requires enough fiddly work to discourage even me.

    Sooo, disconnect everything & haul it to the Basement Laboratory, Electronics Workbench Division…

    Before cutting into the cable, I measured the mic voltage on the PCB and tried to make the thing fail on the bench. The HT (an ancient ICOM IC-Z1A) normally presents 3.5 V DC on the mic wire and the external PTT switch pulls it to ground through a 22 kΩ (or 33 kΩ or thereabouts) resistor. The mic audio is a small AC signal riding a volt or so of DC bias with the PTT active.

    The wire measured maybe 0.25 volts and the PTT dragged it flat dead to ground. Yup, through that honkin’ big resistor. Well, maybe the last conductor in that mic wire had finally broken, right there on the bench?

    Measured from the 2.5 mm plug tip conductor (tip = mic, ring = 3.5 V DC, sleeve = mic common) to the PCB pad on the PC, the mic wire stubbornly read 0.0 Ω, regardless of any wiggling & jiggling I applied to the cable. But no voltage got through from the radio to the board…

    Sticking a bare 2.5 mm plug into the HT mic jack produced a steady 3.5 V on the tip lug. Reinstalling my epoxy-turd plug assembly produced either 0.25 or 3.5 V, depending on whether I twisted the thing this way or that way.

    Ah-ha! Gotcha!

    Pulled out my lifetime supply of Caig DeoxIT Red, applied a minute drop to the end of the mic plug, rammed it home & yanked it out several times, wiped off the residue, and the PTT now works perfectly. Did the same thing to the adjacent speaker plug, just on general principles, and I suspect that’ll be all good, too.

    Diagnosis: oxidation or accumulated crud on the mic jack inside the radio.

    Now, to try it out on the bike and see how long this fix lasts. Anything will work fine on the bench, but very few things survive for long on a bicycle.

    Memo to Self: It’s always the connectors. Unless it’s the wires.

    Here’s the schematic, just in case you’re wondering. I wouldn’t do it this way today, but that’s because I’ve learned a bit over the last decade or so…

    [Update: A more recent attempt is there.]

    IC-Z1A Mic Amp Schematic
    IC-Z1A Mic Amp Schematic
  • Phone Charger: PowerPole-to-USB Adapter

    I have a Virgin Mobile Kyocera Marbl phone, for reasons discussed there. It’s sufficiently nonstandard that the “fits most phones” headsets and chargers don’t. In particular, I have yet to see a charger with the proper adapter dingus for this phone.

    Fortunately, the charger is rated at 5 V @ 350 mA… that’s easy enough.

    Phone charger with Powerpoles
    Phone charger with Powerpoles

    Cut the charger’s cable in the middle, more or less, and install Anderson Powerpole connectors. The standard color code for 5 V is white / black; don’t use red / black for fear you’ll eventually plug it into a 12 V source and toast the phone.

    The charger wires are most likely a far smaller gauge than the 15 A (!) connector pins prefer, so strip the conductors twice as long, double the ’em over and perhaps add a short length of multistrand hookup wire to fill out the barrel before you crimp it.

    Check the polarity before you poke the pins in the housings: you want the +5 V pin in the white housing!

    I aligned the housings to match the ARES / RACES standard, as described there, as that’s what I’ve done with all my other Powerpole connectors. If your phone expects some weird-ass voltage, maybe you want to make certain it can’t possibly mate with anything that’ll kill it stone cold dead. Oh, and in that case pick a suitably different color. Blue seems to be the standard for 9 V, at least in the ham radio arena, for whatever that’s worth.

    Add heatshrink tubing for strain relief (it might slip over the finished pins if you forget), wrap cold-vulcanizing rubber tape around the whole connector for more strain relief, and you’re done. It’ll make your charger cable resemble an anaconda eating a pig, but that’s OK with me.

    USB charger to phone cable
    USB charger to phone cable

    Now the phone can commune with a bench power supply, a bulk 5 V supply, or nearly anything that you’ve hacked into using Powerpoles. It’s your job to make sure the voltage matches up!

    Now, if you haven’t already, make a USB-to-Powerpole adapter. Alas, even though the phone uses 5 V, it draws too much current to charge directly from a standard USB port. However, I have a Black & Decker Pocket Power battery pack with a regulated USB outlet that can allegedly supply 250 mA and seems to handle the phone just fine.

    So: cut a spare USB cable, verify that the red conductor is 5 V and the black is common (hell hath no fury like that of an unjustified assumption and we’re dealing with bottom-dollar suppliers here), crimp, align housings, add strain relief, and try it out.

    This should work for any phone with a dumb, bulk-power charger. If you cut the cable and find three conductors, solder that devil back together again; there’s no telling what’s passing along that third rail!

  • Tone Encoding/Squelch vs. APRS Packet Reception Reliability

    We’ve been using ham radios on our bikes for years, but last year I put together an interface that connects a TinyTrak3+ GPS encoder to the helmet mic amp. This year I’m building two more, about which I’ll write later.

    The problem is that listening to APRS data bursts isn’t all that pleasant, although it’s bearable, but it’ll get much worse when we use 144.39 MHz as our intercom frequency so we can both talk and be tracked: we’d hear all the APRS traffic within digipeater range.

    Now, admittedly, talking on 144.39 isn’t standard. The local APRS wizards have given tentative approval, as we can’t figure out a better way to talk, give position reports, and not carry two radio / battery / antenna / electronics packages on each bike. As long as we don’t do a lot of yakking, we shouldn’t interfere with the digital traffic very much… and we don’t do a lot of talking while riding.

    So I figured I’d send a 100 Hz tone under the audio and enable tone squelch, so we wouldn’t hear packets from anybody else. We’d still hear each other blatting away, but if I set the TT3+ encoders to send a position report every 10 minutes, it ought to be bearable.

    The catch with this is that some receivers / APRS decoders can’t handle subaudible tones. I considered Digital Coded Squelch, but one of our radios doesn’t include that feature, alas.

    To get some idea of how tone would work with the APRS setup around here (which is where we do most of our riding), I set up an HT on the bench with the TT3+ and my interface. The antenna is an HF/VHF discone, indoors, on the basement floor, beside a window. The GPS receiver can see a slice of sky from its perch just outside the basement window under an awning. That’s about as terrible a setup as we have on our bikes: low power, bad antenna, obscured line-of-sight.

    Each test ran 10-14 hours, the TT3+ sent a packet every 5 minutes, and I checked the raw packet results on aprs.fi.

    With tone off and the TT3+ waiting for 3 seconds of audio silence before transmitting, 39% of the packets got through to the APRS-IS backbone.

    With tone on and, thus, the TT3+ unable to hear / avoid other traffic, 47% of the packets got through on one test and 42% on another. The higher rate was overnight, when (I think) there’s less traffic on 144.39.

    Putting the gadgetry back on the bike, parking it beside the garage, and letting it run for 5 hours on a Saturday afternoon showed that 81% of the packets made it to the backbone. Some of the packets were received by stations over 30 miles away, which probably coincided with the the closer receivers hearing transmitters hidden from the more distant ones.

    The only conclusion I can come to is that tone squelch isn’t going to hurt anything around here, where the APRS wizards have done a great job of getting the decoders to cope with subaudible tones. How it’ll work elsewhere is up for grabs, but we’ll burn that bridge when we come to it.

    And it turns out that the radios take about half a second to wake up and activate the audio output with tone squelch enabled, so we don’t actually hear the data bursts: they’re almost always finished and we may hear dead air for a fraction of a second. Because the TT3+ can’t do collision avoidance, we sometimes hear other packets from other transmitters before the squelch closes again, but it’s not objectionable. Whew!

    Update: with the TT3+ set to transmit every 3 minutes, it works fine!

  • Byonics TinyTrak3+ GPS Power Control

    GPS power from MOSFET relay
    GPS power from MOSFET relay

    The Byonics TinyTrak3+ GPS encoder has a “Power Control” output that can switch the power to a radio or GPS interface. J6 provides the interface: pin 1 = common, pin 2 = high active.

    With the “Power Switch” option enabled in the config program, you can set the number of seconds to allow the GPS unit to get up to speed before the next scheduled transmission.

    I glued a surface-mount MOSFET relay to the back of the PCB with urethane adhesive; it fits neatly between the DIP microcontroller’s pins with one output lead soldered to the 5V pad of J7. The other lead goes to the center +V pad; because the relay uses back-to-back MOSFETs, the polarity doesn’t matter.

    That replaces the normal solder bridge across J7 that provides power (on pin 4) to the GPS2 plugged into the DB9 connector. When the relay’s on, it connects the GPS to the power supply. When it’s off, the GPS goes dark.

    The relay input is an LED with a forward drop of 1.3 V max and requires 4 mA to turn on: figure 3.7 V / 4 mA = 925 Ω max. I kludged an 890 Ω resistor by paralleling (stacking!) 1.5 k and 2.2 k resistors; you could probably use anything near that and it’d work fine.

    The relay is an OMRON G3VM-21GR1, part number A11171 from Electronics Goldmine, but I suspect any teeny little solid-state relay would work. The max on resistance is about 1 Ω and the receiver draws about 65 mA. I measured about 20 mV of drop, so the actual resistance is a lot lower than the spec.

    I initially set the power-on delay to 10 seconds, which seemed to be OK: the GPS (green) LED would blink a few times, then go solid. Alas, the warm-start spec for the Byonics GPS2 (see the GPS3 for details) receiver is really 38 seconds, average, and it was definitely producing bogus position data. So I set the delay to 60 seconds and we’ll see how that works; early reports indicate the coordinates still have plenty of jitter.

    [Update: 60 seconds is iffy. 90 seconds seems to work pretty well. A bit of rummaging says that the satellites broadcast their ephemeris data every 30 seconds, so 90 seconds allows for two complete update cycles. Maybe 100 seconds would be even better. Some old background info for Garmin hand-held receivers is there.]

    It’s obviously a tradeoff between accuracy and battery life. This is for use on a bicycle and, believe me, I don’t want to tote a huge battery!

    If the control signal was low-active, then you could use a cheap PNP transistor as a high-side power switch.

    The white/orange wire routes regulated 5 V through an otherwise unused pin to the homebrew interface that combines the GPS data with helmet mic audio. The tiny rectangle is a 1 µF cap that helps cut down digital noise. There’s no need for a connector on that end, as it’s wired directly to the interface circuit board inside a small enclosure.

  • Electronic Ballast Shoplights: So Much For Efficiency

    Just picked up a batch of electronic-ballast shoplights from Lowe’s, motivated by a 10% off card they sent a while ago. Not a killer deal, but it evidently got plenty of folks into the store on a Sunday morning.

    The new lights don’t claim much about their abilities, other than “Electronic Cold Weather Start (0° F)” and that the reflector sizing requires T8 (1″ dia) fluorescent tubes. One would expect an electronic ballast to have a decent power factor and improved efficiency.

    Because I’m that sort of bear, I opened one up to see what was inside. Here’s the ballast:

    Electronic Ballast Dataplate
    Electronic Ballast Dataplate

    Although the fixture is sized for T8 tubes, the ballast would be perfectly happy with T12s. Similarly, the box insists on F32 tubes, but the ballast is OK with F40s.

    I thought a comparison with one of my old magnetic-ballast fixtures would be of interest, so I hitched up the Kill-A-Watt meter and ran some comparisons.

    The results…

    Amp Watt VoltAmp PF
    Old magnetic ballast
    F40T12 0.64 60 76 0.79
    F32T8 1.11 80 126 0.62
    New electronic ballast
    F40T12 0.75 47 89 0.53
    F32T8 0.77 49 91 0.54

    The electronic ballast has a much lower power factor and thus much higher current. The box & ballast don’t say anything about power factor correction and, wow, there sure isn’t any. The power company hates gadgets like this…

    I cannot compare the brightness because the F40 tubes are several years old, but it’s interesting that the electronic ballast runs both tube sizes at essentially the same power (just as the dataplate indicates, sorta-kinda). The magnetic ballast really cooks the piss out of the smaller tubes, though… or it’s dumping a lot of energy into the ballast. Hard to say.

    The T12 tubes are rated for 3000 lumens & 20 k hours. The new box of T8 tubes I got a while back are 2800 lumens and 24 k hours. Frankly, I don’t believe any of those numbers, particularly given the actual power consumption: it looks like either ballast runs them at just 75% of their rated power.

    Anyhow, these were the cheapest shoplights in stock; I bought eight of ’em, because I’ve been replacing one dead fixture every month or two for the last year. I’d like to think I’d get a better ballast if I spent twice as much, but to a good first approximation the additional cost seems to have gone into black plastic trim and a burnished-chrome exterior finish; not what I need in the Basement Laboratory.

    I wish the boxes were more forthcoming so you didn’t need to perform exploratory surgery.

  • Arduino Hack-job LCD Negative Bias Supply

    Most character-mode LCDs seem to be happy with a VEE supply of about 0 V, which produces enough contrast to get by. If you have a negative supply handy, then it’s easy to goose it with a little negative bias and improve the contrast.

    What if you don’t have a negative supply and you’re using an old craptastic LCD that really wants VEE = -1 V and you didn’t realize that until you had everything wired up and it’s a one-off / low-duty-cycle instrument that you don’t want to spend much more time on?

    Just whack up a quick-and-dirty charge pump inverter…

    Quick and dirty LCD VEE Inverter
    Quick and dirty LCD VEE Inverter

    It turns out that the circuitry already had a 33 kHz PWM square-wave signal driving something else, so I air-wired this inverting charge pump to the PWM output. You could, of course, put an otherwise unoccupied PWM output to good use, which is a better idea if you have the option.

    You can use a PWM output, but the charge pump depends on being fully charged & discharged in every cycle. Run your own numbers.

    The LCD’s VEE input dumps about 1 mA to the supply, which means the charge pump must be able to pull out 1 mC/s, more or less. At 33 kHz, each cycle must haul 30 nC.

    Assuming the Arduino (well, any microcontroller will do, but that’s what I’m using) has a 5 V power supply and the output pin isn’t overloaded from the rest of its function and the cap charges & discharges completely during each half-cycle, then the first cap must store that 30 nC of charge. You want a lot more than that so you have a stiff supply to work with.

    Q = CV, so you need at least 30 nC/5 V = 6 nF. Nothing exceeds like excess, so I soldered a 220 nF box cap standing up from the header pin on the circuit board and air-wired the diodes in place. That will transfer lots more charge and keep the voltage nicely negative.

    I have a lifetime supply of 10 µF solid tantalum caps, so that’s what I used for the filter cap. Regulation isn’t critical, but each pump cycle shouldn’t change the voltage on that cap very much. In fact, pulling 220 nF * 5 V = 1 µC from the filter cap while injecting 30 nC from the LCD leaves you with a whopping 970 nC deficit: it’ll stay around -5 V just fine.

    Actually, it won’t. The negative supply will be about two diode drops above -5 V. The diodes aren’t carrying a lot of current, so they’ll be running at maybe half a volt apiece. Call it -4 V, more or less. You could use Schottky diodes if you need more negative volts.

    If the LCD dumps 1 mA into the supply and -1 V produces the right contrast, then a 3 k resistor will drop the necessary voltage from the supply.

    As it turned out, the LCD dumped 800 µA, -0.8 V gave the right contrast, and a 4.7 k resistor worked just fine. Maybe you want a twiddlepot in there to adjust things.

    You need that little cap right at the LCD VEE pin to soak up the spikes from the LCD drive multiplexing, as this “power supply” has nearly 5 k output impedance. Yow!

    If you’re worried about temperature compensation, then you’ll need something fancier. In that case, you’ll also want a Spice model to be sure all these rough-and-ready calculations cut somewhere close to the truth.

    Memo to Self: maybe next time this should be on the PCB right from the start, even if it’s not really needed? Or, much better, just go with a single-chip inverter and be done with it!

    Update: If you’re worried about driving a bare cap from your microcontroller pin, add a small-value series resistor. The time constant should be maybe a third of the square-wave period: 15/3 = 5 µs in this case, so the resistor should be 5 µs/220 nF = 22 Ω. That limits the peak current to no more than 5 V/22 Ω = 230 mA, not a big improvement. Mostly, the microcontroller pin will be OK if you’re using small caps.