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

  • Nonmagnetic Tweezers: Don’t Believe The Hype

    A small package of 6000 SMD resistors just arrived from a Hong Kong eBay seller. It showed up promptly despite traveling halfway around the world, had neat packaging, and I’ll give ’em good feedback.

    Also included was a free needle-tip tweezers, just exactly what you need for plucking those little ceramic rectangles from their packages. I  already have a bunch of needle-tip tweezers in my rack, but you can never have too many tools and this one won’t go to waste.

    Gooi TS-11 tweezers
    Gooi TS-11 tweezers

    The package has what appears to be comprehensive instructions in both Chinese and Japanese (to my untrained eyes, anyway). Not much in English, other than that Anti-magnetic, anti-acid and non-corrosive Stainless Steel line; perhaps this isn’t the export model. Indeed, it lacks the obligatory country-of-origin labeling, but, given where the package came from, one may reasonably assume the usual Chinese origin.

    The tweezers are (almost illegibly) stamped STAINLESS NON-MAGNETIC and bear a tidy sticker: gooi TS-11 ANTIMAGNETIC.

    Gooi TS-11 Antimagnetic sticker
    Gooi TS-11 Antimagnetic sticker

    The build quality and surface finish are, um, a bit rough, but Gooi seems really proud of their non/anti-magnetic properties.

    Needless to say, a magnet sticks firmly…

    I have no convenient way to test their anti-acid (whatever that is) and non-corrosive properties, but I’m betting these suckers are plain old Chinese mild steel, made from recycled US scrap. Perhaps the previous iteration was stainless and we’re stepping down the cost-saving ladder? If they would just change the packaging to match reality, that would be fine with me.

    [Insert standard observations about Chinese quality control here.]

    Y’know, come to think of it, I’m sort of wondering about those 6000 SMD resistors. With any luck they’ll actually work when I get around to using them. If not, I suppose it serves me right for buying direct from Hong Kong via eBay, eh?

    And, yes, I know some stainless steel is magnetic.

  • MAX4372 Sense Input Protection: The Story Continues

    Measured vs setpoint currents
    Measured vs setpoint currents

    As noted here, there’s a difference between the current setpoint (controlled by the PWM analog outputs) and the measured values. As it turns out, there’s a better way to look at those datapoints.

    This is a graph of measured current against the setpoints. Looks pretty good to me, apart from a teensy offset error. There really isn’t much in the way of a gain error over the entire range.

    Having had a bit of time to think this over, the measured current-sink current should generally be numerically equal to the setpoint value, simply because there’s an external op-amp forcing that to be true. The twiddlepot adjusting the op-amp gain doesn’t enter into this, because the loop forces that voltage to match the PWM output. So, duh, the purple line should be spot on, at least up to the point where the sink transistor saturates.

    What’s more interesting is that, over this range, the MAX4372 output is also spot on, which is not obvious from the previous chart. It flattens out when the common-mode voltage at the sense resistor drops below a volt, more or less, which is what the datasheet leads you to believe.

    The datapoints comes from the same panel on a different day, so the points don’t quite line up if you’re comparing them. The brown solar panel voltage curve flattens out when the current sink transistor saturates, but the panel can continue to supply increasing current into a dead short, so the current continues to rise for a bit.

    After I get the Circuit Cellar column laid to rest, I gotta figure all this out from first principles, then run the current up to 300 mA from the dreaded bench supply.

    But the short answer seems to be that the Schottky protection circuitry doesn’t have much effect up through 75 mV. Which seems reasonable, come to think of it.

  • MAX4372 Sense Input Protection: Results

    Solar Photovoltaic Panel Maximum Power Point Cloud
    Solar Photovoltaic Panel Maximum Power Points

    Here’s the result of using the Schottky diode input protection circuit I proposed there. I used 10 and 5 ohm resistors, twice the values shown in that schematic.

    The circuit runs a load test and determines the maximum power point (MPP) of a solar photovoltaic panel every minute. The points represent the results of about two hours of winter-afternoon sunlight.

    The test program applies an increasing load in steps of 10 mA (it’s a small panel, OK?) and records the corresponding panel voltage. One combination of current and voltage extracts the most power from the panel; that’s the MPP.

    Obviously, the MPP varies with the amount of sunlight falling on the panel, so the result of the test is a cloud of points. That’s what you see in the graph: the highest points represent the most intense sunshine, the lower points come from shadows and changing sun angle.

    The load is applied through a current sink that draws 100 mA per volt, as generated from a microcontroller PWM output. That’s pretty well calibrated by twiddling a gain pot, so I think it’s quite close.

    The graph shows that the 10 mA steps recorded by the now-well-protected MAX4372 high-side current amp are low by about 10%, regardless of the absolute current level. That’s more error than predicted by the SPICE model (even with the larger resistors) and may represent contributions from something other than the protection network.

    However, it does look as though a simple calibration routine could compensate for the error. That’s a simple matter of software, right?

    Most important of all, the MAX4372 has survived the usual mistreatment. The load test is essentially DC, where the inductor counts as a piece of wire. Under those conditions, the combination of a stiff voltage source and an imposed load exceeding 600 mA produces a lethal differential voltage across the current-sense resistor. The diode clamps that voltage to 300 mV or so, which is enough to protect the MAX4372.

    Rumor from my source at Maxim says the protection circuitry inside the MAX4372 can withstand maybe 50 mA, so the high-value external resistor approach (without the diode) may be the better way to go. Getting rid of the nonlinear diode should be a win…

    Update: A different plot shows a different result. I think the offset comes from something other than the protection circuitry.

  • Unsolderable Header Pins

    Unsolderable pin headers
    Unsolderable pin headers

    Speaking of things that don’t work, these header pins from my stash have developed some sort of rot. They’re genuine Brand Name pins, albeit a few decades old, and have been stored in the original bag in various basements along the way.

    What’s supposed to happen: you touch a pin with a soldering iron and some solder, the solder melts and wets the pin. If the pin is in a circuit board at the time, the solder bonds it to the pad surrounding the hole. Nothing exciting here, except that when I tried to use these pin headers, that didn’t happen.

    The symptom is that the headers are unsolderable: the solder doesn’t wet the pins.

    Non-solderable header pin detail
    Unsolderable header pin detail

    The detail view shows what does go on. When I touch a the pin, the original solder plating scoots out of the way, exposing the underlying metal (or whatever it is). Neither tin-lead nor tin-silver solder wets the surface, so the pin can’t be soldered.

    The flux forms a layer over the new surface and doesn’t do its usual job of cleaning the metal. Scraping the pin clean doesn’t seem to help, either. In fact, nothing helps: that whole bag of headers is a dead loss.

    I’m sure these things worked when they were fresh, but that was a long time ago. I’m not sure what sort of change could occur underneath the original solder plating.

    So I picked up some new headers with what passes for gold plating these days and they work fine.

    The pix come from my pocket camera on the binocular microscope, using my homebrew adapter.

  • Defective PCB-mount Switches

    Defective PCB Option Switches
    Defective PCB Option Switches

    This type of switch is a nice alternative to the ordinary pin-header option jumpers: pull the white plunger up to open the switch, push it down to close. Nothing to lose or (worse) drop into the machinery.

    Being that sort of bear, I test most components, particularly surface-mount parts, before soldering them onto the board. Switches, however… well, what could go wrong?

    Unfortunately, both of these switches were defective.

    The gutted switch at the top of the pictures stuck open after I soldered it in place: pushing the plunger down didn’t do anything at all. Leaning rather hard on it didn’t get its attention, so I unsoldered and tore it apart. The parts looked OK: no obvious corrosion or deformity.

    I tested the second switch, found it worked perfectly, and soldered it in place, whereupon it failed just like the first: stuck open.

    Perhaps the soldering iron’s heat (immeasurably) reshaped the plastic or (invisibly) oxidized the contact point? Maybe the design is close enough to not working that installing it pushes the tolerances over the edge? I’ll never know.

    These were surplus parts, so there’s no recourse, but I’m pretty sure they’d misbehave the same way if I’d paid full retail for them. If you see any inside your widgets, this may be why you can’t select an option… or why the widget suddenly enters a mysterious new mode.

    I tossed the rest of my supply in the trash.

  • Diode Parameter Extraction & Plotting

    After blowing up a MAX4372 high-side current amp, I thought a Schottky diode would do the trick as a voltage limiter for the delicate current-sensing inputs. The comments to that posting showed I might be close, but that I hadn’t figured it right.

    The first step is finding out how the diode behaves.

    Clip a multimeter (set to the 2 V range) across the diode, clip another multimeter (set to maybe 200 mA in series with the diode, then connect a bench power supply through a 100 kΩ (more or less) resistor to limit the diode current across everything.

    Twiddle the power supply knob, record voltage and current pairs, type them into a spreadsheet (say, OpenOffice, but Excel is probably similar). That gives you a table & plot that looks like this:

    1N5819 Schottky diode current vs. forward bias
    1N5819 Schottky diode – current vs. forward bias
    mV uA
    20.1 0.4
    40.1 1.4
    60.0 3.5
    80.6 8.2
    100.2 18.0
    125.4 48.9
    150.5 131.3
    175.0 343.0
    183.8 481.0

    Nothing surprising there: the current has an exponential relation to the forward voltage.

    An exponential relation cries out for a semilog plot, so add a third column figuring the natural log (a.ka. ln or log-to-the-base-e) of the current values in the second column. The equation is just

    =LN(B3)

    copied down the column as needed.

    1N5819 Schottky diode - ln(current) vs fwd bias
    1N5819 Schottky diode – ln(current) vs forward bias

    That gives you another table & plot, thusly:

    mV uA ln(current)
    20.1 0.4 -0.92
    40.1 1.4 0.34
    60.0 3.5 1.25
    80.6 8.2 2.10
    100.2 18.0 2.89
    125.4 48.9 3.89
    150.5 131.3 4.88
    175.0 343.0 5.84
    183.8 481.0 6.18

    The trick is to add a regression line to the data, which you do by selecting the data series, other-clicking, selecting “Add Regression Line”, selecting the regression line, other-clicking, selecting “Show Equation”, then futzing around until the equation shows enough decimal places. Also extend the X & Y axes so you can see the Y-axis intercept on the left and the current at the MAX4273’s Absolute Max rating of 300 mV on the right.

    I threw out the first measurement point, as it didn’t quite fit the rest of the data. My measurement accuracy isn’t all that great below a microamp, sooo that seemed justified. Check the raw data and see for yourself.

    The regression equation is, comfortingly, ln(current) = 0.040 * voltage – 1.187.

    The slope of 0.040 = kT/q, which says the temperature of my basement laboratory is 464 K, a tad warmer than the actual 286 K. Feeding the actual temperature in, the slope should be 0.046.

    What that really means is that the ideality factor n = 1.62. We usually forget about that little Fudge Factor, but here it is in action: 0.040 = nkT/q.

    The Y-axis intercept is -1.187, which means:

    saturation current = exp(-1.187) = 0.3 uA = 300 nA.

    Not a number you’ll get from the datasheet, of course.

    For more on all that, consult the Wikipedia diode entry.

    It’s worth mentioning that the slope depends linearly on the temperature. The exponent causes the far end of that nice line to whip the current around something nasty.

    Anyhow, with numbers in hand, it’s back to the schematic… and a bit of SPICE simulation that uses a canned diode model.

  • MAX4372 Sense Input Protection

    My initial thought was to stick a Schottky diode across the sense terminal inputs, but John Kasunich suggested that requires a much heftier diode and might not work anyway. He suggested sampling the current-sense voltage through high-value resistors, which will certainly affect the linearity & calibration of the sense voltage.

    My sissy circuit has a peak fault current of maybe a few amps, which the diode should shrug off if I’m not stupid about it. But I like the resistor notion, as it dramatically reduces the diode current.

    MAX4372 Sense Input Protection
    MAX4372 Sense Input Protection

    Maxim has a useful Application Note (AN-3888) describing the effect of common-mode filters on the amp’s calibration. A key suggestion: the two resistors should differ by a factor of two to match the input bias currents.

    So here’s one approach that might work.

    The schematic is a screen snapshot from Linear Technology’s LTSpice IV. The two current sources on the left model the MAX4372 sense amp inputs, with their max bias current values. R1 is the current-sense resistor: a whopping 0.5 ohm for my low-current application.

    R2 and R3 isolate the diode from the sense resistor. High values introduce more error due to diode current, while also helping to protect the sense inputs from excessive voltage. Low values reduce those errors, while bypassing more load current through the diode. Ya can’t win.

    Running the simulated load current up to 5 A shows that the diode clamps the input voltage to about 330 mV, which is likely good enough. Higher values for R2 and R3 reduce that; 10 and 5 ohms might suffice. The factor-of-two difference is really only important at very low currents for these very low resistors; at higher currents, the diode is all that matters.

    MAX4372 Simulation Results
    MAX4372 Simulation Results

    What’s of more interest is the error induced by those resistors in normal operation. Here’s a screen snapshot of simulation up to a load current of 500 mA, well above my expected max of 300 mA. Pay attention to the middle trace in each group of three, which shows the results at 30 °C (the others are 20 and 40 °C).

    The red traces angling down from the upper left represent the ratio of the diode voltage to the sense resistor voltage It starts a bit over 0.99 and gets down to 0.92 by 300 mA. So, basically this protection network introduces less than 10% error if you ignore temperature effects.

    The board I’m building has a calibrated current sink, so (if I were doing this for a real project), I’d be sorely tempted to just build a lookup table on the fly. Then I could work backwards from the desired current setpoints to the PWM voltage outputs required to generate those values. But that’s a simple matter of software, right?

    If you care a lot about accuracy, you’ll obviously want to measure the board temperature and tweak the table accordingly.

    If you want to see how an actual diode behaves, you can measure it.