Archive for December 29, 2014

Milliohm Meter and why we all need one

As I am fond of mentioning, projects beget other projects. It’s just the way of things. The power supply needs a dummy load, the dummy load needs to be low-resistance, my multimeter can’t measure low resistances worth a toss, so I need a way to measure this accurately.

The why

Owners of old analog multimeters have sometimes had a low-ohm function, so they have the ability to measure low resistances. Why do we lack this with our modern DMMs that are supposed to be better in every way?

Before I realized that my DMM was unreliable below 10Ω, I had been shopping for 1Ω resistors for current measurement and was so annoyed when they measured way off, sometimes 20-50% off. It perplexed me. Why even bother making resisters that are so out of spec? The easy (yet non-intuitive answer) is that the resistors are not at fault, but my DMM is. Specifically the leads.

Try this out: take your DMM and turn it to the lowest resistance setting. Then touch the leads together. It’s not zero is it? That’s no mistake, the leads themselves have a small, yet non-zero resistance. In addition, all multimeters measure resistance by pumping a small, known amount of current into the subject in question and measure the resulting voltage drop – basic Ohm’s law. The difficulty comes in that most multimeters don’t put out enough current consistently to “amplify” the reading enough to shoot above the accuracy floor of the multimeter itself when attempting to measure low resistances. The errors of measuring very small voltage drops combined with the small resistance of the leads themselves add up to an inaccurate measurement that is utterly useless.

The solution

What is needed is to pump a stable, known current across our subject. It has to be high enough to “amplify” the reading to read well on a display or volts setting on a DMM. We also have to eliminate those pesky leads.

With that in mind we need a constant current source. What quickly jumped out at me from a bit of online research (like this and this) is that it’s quite easy to achieve this with the humble (and ubiquitous) LM317 voltage regulator. The datasheet shows in the application hints (see figure 43) of how it can be easily wired to act as a constant current source as opposed to it’s more usual use as a constant voltage source. Simply whack on a low, known resistance on the output of the LM317 and have the ADJ pin on the other end of it. It will then regulate the voltage across this resistor to maintain a constant current. Easy.

Picking the right current is the easy bit. Obviously we want something in powers of 10 to avoid any extra calculations (we do want a direct readout) and we want to choose something that lines up with the range setting on our multimeter so it’s set to the millivolts range but reading milliohms directly. One example I saw used a 100mA current which would give a display in 10s of milliohms. This works, but i found it confusing, having to do a mental calculation (even moving a decimal point) which is just plain annoying and opens up the possibility of errors and misreads if I forget.

So I chose a current of 1A, a nice round number and it magnifies the result by a factor of 10 so my millivolts display reads milliohms.

miliohm-meter-adaptor

Through a lot of bashing about in Circuit Lab, I determined that the sense resistor (sitting between the output of the LM317 and it’s ADJ pin) would need to be 1.155Ω (more accurate than the 1.2Ω quoted in the datasheet) to make the LM317 spit out precisely 1A into my subject. Again, we have the problem of low resistance and also 1.155Ω is not exactly a common value, in fact I don’t think it’s manufactured at all (why would it be?). A simple way around this is to use resistors in parallel to achieve our target value. Better yet to make one of those resistors a trimpot so we can really dial it in there accurately. See the schematic on the right.

Using the parallel resistance formula, we know that 10x 10Ω resistors = 1Ω so a bit of fiddling with other values in there would net us our target value. Also, the power rating is additive in parallel which is also handy. 10x 1/4W resistors make a 2.5W resistor! I chose the values based on what I had in my parts bin, but annoyingly I am missing a 100Ω trimpot. I had a 100Ω regular potentiometer which would have been fine had I not fried it by trying to solder it (doh!). I will need to make it downtown and grab a trimpot to finish this project. As always.

So that’s the solution for the constant current. Naturally, it will need a power supply which I calculate to have to be on the order of 14V and capable of 1.5A (just for a bit of headroom). More on that later.

Kelvin measurement

With the constant current problem taken care of, we are still left with leads that have a non-trivial resistance which when measuring such low resistances could really skew our measurement. Small problems become big ones when you need more accuracy to measure very small things.

Fortunately, there is a tried, tested and true way to do this: Kelvin measurement. The concept is simple: eliminate the leads. We still need leads to run from our constant current source and to our DMM but we can effectively eliminate them by separating the current supply from the measurement. Since we no longer are attempting to measure resistance and supply current with the same leads, the resistance of the leads is nullified. The one catch is that they do all have to meet but as close as possible to the subject under test. The solution to this is to have the multimeter lead and the current supply lead meet right at the test points for the resistor.

If we calibrate our trimpot such that 1A is being delivered right at the positive connection to the resistor, we eliminate the tiny voltage drop of the lead from the current source. Since the multimeter is just measuring voltage the length of its leads essentially also becomes trivial again. With our result nice and amplified from the 1A current, all other factors kind of fall down to the noise floor and can be safely ignored.

This is known as 4-wire or Kelvin measurement. It is commonly employed but of specific use in current sensing applications. There are even 4-wire resistors or “shunts” that are specifically designed for this, making the test points a close as possible for the most accurate measurement.

Safety Margin

One thing to watch out for of course was watching the max 15W power dissipation of the LM317. The other circuit I took the idea from had the current output at 0.1A so that was never a possibility, at 1A one has to be careful. In bashing around the calculations I made triply sure that everything was well within safety margins. Always, always, always check the power your are dissipating though your transistors, regulators, shunts and power resistors. Watch for little traps. For example, the LM317 dissipation is given by the voltage differential (in vs. out) multiplied by the current you are running through it. The datasheet says it’s capable of 40V or something differential and 1.5A but if you try that you will have a molten LM317 (60W is way way more than 15W). Watch your max power dissipation and try to never go above 80% of that, same goes for the max junction temperature (meaning use heatsinks and even fans if you need to). Really over-design your safety margins.

Even if you are below 80% of the rated maximums, check your datasheets and in particular look at the graphs. The LM317 for example loses ability to regulate voltage (and thus current) when you approach it’s maximums so make sure you are well within an acceptable range for desired operation of your product.

We’ll see if I have done my due diligence when it comes time for power up, calibration and testing.

The build

Undaunted by missing critical parts, I went ahead and soldered what I had together with the result shown here.

Just an LM317 constant current source

Just an LM317 constant current source

I’m missing the 100Ω trimpot but also suitable power supply for the thing. I have a milk crate full of salvaged wall worts and none fit the spec. I know from experience that 12V ones will have a couple of extra volts so that’s no problem, i have tons of 12V and 14V ones kicking about. None, however, can deliver more than an amp it seems. So i will have to buy a surplus one. Failing that i’ll just build a 14V power supply but i’d rather not waste parts when a simple wall wort will do.

Test leads. The left bottom is the PCB connector to the above board, the left top plugs into the DMM, the right will have alligator leads for the test subject

Test leads. The left bottom is the PCB connector to the above board, the left top plugs into the DMM, the right will have alligator leads for the test subject

I’m also short on suitable alligator clips for my test lead shown here. I have saved my clips from broken/melted alligator test leads but the small rubber boot on them won’t fit over the heavy gauge wire I am using for test leads. Seems kind of necessary to me for safety. I’ll add to the list some heavier duty alligator clips. Might as well do it right and I need to head to the shops anyway.

Also, I have a case I could use, but it’s rather large, wouldn’t hurt to have a smaller case to avoid wasting the larger one. It will be a simple adaptor box with wires coming out of it, no readouts or anything so I don’t need the extra surface area, just enough room for the board and the LM317 and it’s heatsink. The only holes in the thing will be the current wires, a 5mm LED, and the DC input jack. Easy drilling.

Expect a follow-up once I get my butt to the shops.

Zener Pre-Regular Revisit

In revisiting my power supply project I also revisited a number of unanswered questions. Chief among them is how on earth do I get rid of the excess voltage from the AC rectification? Previously, I had mentioned this was somewhat of a shock to me as a novice that a 30V AC tap from a transformer can gain 12.6V in the rectification to DC. I know part of that is the combining of the AC waveforms and the bumping up by the mammoth amount of capacitance I have on it to smooth it. I had originally tried some very dodgy and very ugly collection of series power diodes which plain just would not work. They were not only ugly, but ridiculously unsafe and would prevent the proper operation of the circuit at low currents and would be unreliable at high currents. Scrap that. I’ll consign that to the embarrassing fail bin.

The next idea was to pre-regulate the voltage down to a safe level for the downstream regulators and prevent unnecessary power dissipation. I chronicled before some shaky success but discarded that idea after it proved somewhat lacking and prone to smoke. I also thought that now three darlington transistors in the signal path was somehow wrong, there was something about it I didn’t like for some reason.

In poking about again with fresh eyes and a clear mind I decided once again to make a zener pre-regulator, having it control the base of a darlington transistor to set the output voltage to just shy of 30V. Most of the original concept stayed the same with a few little modifications to make it safer and include the proper ratings of components as well as ensuring that no datasheet “Absolute Maximum Ratings” were being flirted with. Schematic below. (please note the caveats at the bottom of this post)

pre-regulator-test-circuit

As I had been down this road before, I was tickled to discover that I already had everything I needed in my parts bins and with my 10Ω home made power resistor just completed I set to marrying it all together. Having only a few parts it was rather trivial to assemble it.

I test powered up the AC board as I had not touched it in a year and I got that delightful hum and that crazy 85.2V reading between the positive and negative rails. I kind of freaked at that moment, not only because 85.2 is a lot of volts but I realized I really need to be extra safe with this thing. Also I forgot that it was centre-tapped and i just measured the negative lead (-42.6V) unnecessarily. I cut the power to it and noticed my multimeter barely dipped. I realized that the 10 milliFarads of capacitance I had on the thing to smooth the power is not only extremely dangerous when charged, but would probably take a decade to discharge though the multimeter’s very high input impedance. Rather than touch the positive and negative wires together to discharge the caps instantly (which would have resulted in a very big and dangerous bang) I carefully placed them on a 30Ω power resistor I had to drain the caps quickly and gracefully.

This is why you are always told to never touch capacitors when opening up equipment as they could be charged still. They must be discharged. Smart is using a low value power resistor to “bleed” them dry of charge. Stupid is shorting the terminals with a screwdriver. For safety, I will include such a resistor – a “bleeder resistor” – to discharge the caps when it is switched off.

Anyway, with the AC board working great, it was time to hook up the latest candidate for a pre-regulator and try it with some loads.

The setup. From left to right: my 10Ω home made dummy load resistor, the zener pre-regulator, and the AC board

The setup. From left to right: my 10Ω home made dummy load resistor, the zener pre-regulator, and the AC board

It worked sort of fine though the numbers were of course somewhat off from my simulated circuit. For one thing the 5W 30V zener I was using led to a regulated voltage of 32ish volts which was higher than I wanted it to be. For my stuff to work well I needed it about 26-29V. I needed enough headroom for the eventual voltage regulator to make a nice steady 24V yet as low as possible to reduce the power it will dissipate due to the voltage differential. On a whim I whacked in the 1W 30V zener I had and behold – I got 28-29V. Perfect. Just what I wanted.

I tried a variety of loads including: a 1k resistor, 100Ω power resistor, 30Ω power resistor, and yes – my monster of a 10Ω resistor pictured here in glowing glory as it dissipates something like 90W of power.

IMG_0558
IMG_0559
IMG_0563

Overall I would call it a success with some caveats. I did notice a change in voltage depending on the load I was putting across it. This is not a huge deal as I do not need it to be an accurate voltage regulator, but i do need it to stay under 30V and above 26V, preferably with a bit of padding, no matter what load i draw from it. In the schematic above I added some capacitance to hopefully smooth it up a bit and keep it a bit more stable. I will test this tonight in the lab. I did get the disturbingly low reading of 25.6V (ignore my stupid multimeter it sometimes forgets decimal points) which will definitely need investigation as this is below my absolute minimum of 26V.

IMG_0565

Another problem, that I just noticed in fixing up the schematic to post on here, is I probably used the wrong transistor. On it, and from examples I had used to design it, I indicate an NPN darlington to be used and I had probably mistakenly used a PNP one. This worked just fine but I might investigate while i’m down there to see if indeed I did indeed use the TIP147 instead of the TIP142 and what, if any, effect swapping them would do.

Update

Well I just took a poke on the bench and I was indeed using the TIP142 NPN darlington like I was supposed to. I still need to investigate why the voltage dipped and if I can repeat that and take some careful measurements. I understand how to use the darlington as a current regulator, and the dip in voltage would suggest it’s limiting the current (which I do not want it to do at this stage). It makes a basic sort of sense by the 30V zener would net roughly 30V on the output (I guess) but I need to know the why and specifically the calculations involved. CircuitLab showed me that I would get around about 30V regardless of current draw, why this real-life dip I haven’t a clue – yet. I’ll try and repeat the experiment and isolate the conditions under which the voltage dips. I’ll try various other loads too to see if it goes outside the usable window. More to come.

Caveman Dummy Load

Okay, so I thought I’d start with the fun post :) . For the truly nerdly, electronics is always entertaining, even if you can’t directly see what’s going on. For everyone, however, the fun bit comes in with a bit of mad science. We want fireworks, smoke, sparks, and flames. So long as we don’t get hurt our burn our house down, we can enjoy a bit of drama and cackle evilly as we dump 3A through something and feel the power coursing through it.

I mentioned in the last post about the need for an immediate, low-tech dummy load that doesn’t involve me sourcing parts, puzzling over schematics, waiting for online deliveries, or rushing to the shops to grab that one part I’m missing (I’m always missing one!). With that in mind I had a problem with my power supply project. I’m busy designing away the various modules, simulating what would happen and punching the math to make sure it doesn’t blow up on me. I need to test the damn thing as I build and although I can simply check the output voltage of each stage I prototype up, it doesn’t tell me anything of what I will do when i put a load on it. Will it be stable? Will it melt into a pool of toxic goo? The only way to know for sure is to find out. I take a calculated risk as everyone does quite literally by simulating my circuits but it doesn’t take into account the real world of component tolerance and the million weird and wonderful little variables that are assumed not to exist in mathematical simulations. Besides, it’s more fun to build stuff up and see it in action :) .

My inquisitive searches popped up a number of interesting ideas that don’t involve me making yet another complex project like the electronic dummy load I want to build. I needed something simpler and nothing can be simpler in electronics than a resistor. I mentioned in my last status post that the logical dummy load is a resistor, but of course finding one accurate enough that can dissipate the required power without melting has been challenging. Most power resistors have really wide tolerances, are bloody expensive, and not so easy to find. Keeping a stock of all the required values would then be a challenge even if I could find the right ones. So, like any enterprising maker, I squared my shoulders and proclaimed “I shall make my own!”.

What is a resistor anyway

First, I needed to examine what a resistor is before I could actually build one. Put simply, it is nothing more than a length of wire trimmed to a known resistance. All wires have resistance although it’s usually assumed to be negligible and with good reason – it usually is. This is because the highly conductive copper we usually use for wires are designed to have very low resistance so we get our signals through and don’t waste so much power in our projects. A wire’s resistance is a function of it’s material’s resistivity (a constant that is different for every conductive metal, copper is 1.7 x 10^-8 Ω m by the way) multiplied by it’s length, and all divided by the cross-sectional area of the conductor in question. So it’s easy to see from that statement that the length of the conductor increases the resistance, and the cross-sectional area decreases it. So the thicker the conductor, the lower the resistance, the longer the the conductor the higher.

It seems simple now, doesn’t it? just make it thin and cut it to the desired resistance, done. One problem – the current it’s resisting has to go somewhere, the laws of physics prevent energy from just ceasing to exist. As expected, it’s dissipated as heat. With enough current flowing through it that could be disastrous. Not only would it heat anything touching it, but could melt itself making is a very dangerous thing from both an electrical and “burn down your house” standpoint.

Copper, having such a low resistivity, is hardly ideal to use for a resistor. I would need many kilometres of the stuff to get what I want and/or have it so fine a gauge that it would melt from the current I’m intending to dump through it. As I contemplate this, I toot on my ecig and it hits me – the kanthal wire in the coil could work perfectly. I check a packet of the coil wire I have and sure enough it says clearly 18Ω/m. Perfect.

I laugh to think – all a resistor is a heater.

The build

Seems simple enough, I need a precise 10Ω resistor, I have a meter of kanthal which I know is 18Ω/m, and I know it will take a few amps dumped through it since I do this many times a day with my ecig. All I have to do is cut it and test, cut it and test until I hit 10Ω. Then I can mount it on… what to mount it on… oh jeez. Here I have a length of wire, that’s going to get really hot if I dump more than an amp through it (I intend to dump three) and I have to have some way of holding it down. A live wire with enough current to kill me and enough heat to burn me (and anything around it) very badly is never a great combination. I need something non-conductive yet heat resistant. I look about and grab a pencil, maybe this could work?

IMG_0551
IMG_0552
IMG_0553

As you can see above it did work after a fashion. It measured 10Ω, I was able to put lower currents (<1A) through it without a problem. The above happened when I tried 1.33A from my little power supply and the pencil predictably started to burn. Yeah, that was a dumb idea. Also, my house now reeks of burning pencil.

I rummaged about for anything else I could find that might hold this hot potato and came up with nothing. I was hoping some sort of ceramic something might be floating about somewhere but no dice. In rummaging around I found a part that a friend gave me ages ago. It was a piece of a heater from an old car which is nothing more than a piece of plastic, some sort of heat resistant material and some brass strips. The nichrome heating coils were still on it so I cut them off and fitted on my coiled kanthal wire. Bingo, I had a solution.

In action

With my homemade resistor somewhat safely mounted in something that probably wouldn’t fly apart and melt, it was time for the real deal. Time to use it as my test load. I chose 10Ω as my intention was to test my newly prototyped pre-regulator with it and powers of ten make calculations really easy to do in my head. 30V over 10Ω is 3A or my target max current for my power supply. I will detail the results of the pre-regulator test in a following post about it specifically but the short of it is IT WORKS. Gwahahaha

Pretty isn’t it? that’s 3A of current running through it thereabouts and 30V across it. It was a lovely glow and did indeed give off a lot of heat. My chilly basement lab was quite cozy :) . The pre-regulator played nice too and gave me more or less expected results

IMG_0564

Conclusion

It just goes to show that even complex problems can still have caveman DIY solutions in this modern age. I built me a dummy load with no controls, no readouts, no fuss, and no real expense. I will still build my electronic dummy load of course, since I do need a constant current sink that is finely adjustable for more accurate measurements and to calibrate my power supply.

Return, re-education, progress

So, after a long hiatus I am back in the lab and back to try and finish at least one damn project before I die. Started innocently enough, was bored on an evening and not knowing what to do with myself I thought I’d catch up on some of Dave Jone’s excellent video blog entries. Naturally, his energy and charisma stoked the flames of interest and had me missing the heady smell of flux and the hum of an energized transformer. I looked over what I had on the go and found with delight that I actually remembered a lot and was able to get back to where I was intuitively in no time at all (read: a couple of weeks of review).

Staus

Here I’ll summarize the projects I have on the go before I get to the good stuff – the experiments.

Nixie Clock

Almost finished. Kinda. Sorta. The schematic I reviewed for any errors and made sure I got everything right – no problem. I gave the half-finished board a good look-over and found it just fine, needing only to be populated. I know for certain I will be needing a second board on top of it, which is fine, to house the ridiculous number of high voltage transistors as well as the remainder of the 4017 counter ICs. I mapped out a plan of how i’m going to do my interconnects as well and puzzled over the problem of having something like 30 connections going from one board to the other. This is what happens when you use data that isn’t multiplexed and no microcontroller, you basically end up with a lot of wiring. For the power connectors and a few other things I don’t mind using molex style PCB connectors but I was faced with a challenge of how to route the 16 connector outputs from the bottom board 4017s to the top. I briefly flirted with the idea of keeping them all on the same board but then I would end up with 28 odd connections I would have to take to the second instead of 16. So with that in mind it dawned on me that the old IDC connector and the ribbon cable are ideal for this application! I’ll pick some up at the shops when I finally make it down there. As always, I’m s a few parts short on every project so it’s a worthwhile journey. All this one needs apart from this is a few switches to set the time some way to mount the nixie tubes securely and safely and of course a box to put it all in.

Power Supply

The power supply is, and always was, a beast of a project. Some do their first power supply simply but I wanted something flexible, cool, powerful, and more or less something I will want to use years down the road. The inevitable revisions take forever and the whole project is quite complex by this point. As I’ve mentioned before I’ve broken it into modules to make it easier on myself: AC Power, Pre-regulator, Current Limiter, Voltage Regulator, Control and display.

The AC Power board, as shown from previous posts, is complete and overall I’m quite pleased with it. It does have a rather high DC voltage output of ±42.6V which necessitates the inclusion of the pre-regulator block (mentioned previously) but otherwise performs just fine and will take more than I could possibly throw at it before it dies. Subsequent video watching and research has made me want to add the rather important addition of MOVs (Metal-Oxide Varistors) to add some over-voltage protection to the AC input of the supply though this is a rather trivial addition and simply have to add one each between the hot-ground, neutral-ground, and hot-neutral. I will probably add them to the rectification board or may have them on a separate board or hanging off the terminal block, I have not yet decided. Over-current protection is already present in the 5A hot fuse in the terminal block, as well as redundant case fuses I will employ in the final build. There is also the question of the ground lift. Research has shown me the wisdom of not tying the centre tap of the transformer (the 0V rail) to mains earth so with that in mind I will keep it floating by default with an aircraft switch on the front to enable mains earth referencing should I need it. Easy.

The pre-regulator has seen much progress since the last time I took a poke at it. I had previously included it, discarded it, then included it again in a much more workable form. After much fiddling in circuit lab, I settled on using a zener diode/darlington transistor regulator and crunched all the numbers into a workable solution. I did build it up and test it but will expound on my results in a subsequent blog post. The upshot is I can knock that crazy 42.6V down to much more usable 28-29V and have it work over a variety of loads which is nice. There still is the question of stability and whether or not it will play nice with the rest of the circuit.

The other modules are untouched from last check. It will be a long time before a completed product. I’m still fuzzy on a bunch of things and I’m expecting pitfalls along the way which could be both frustrating and highly amusing. Of course, that is why i’m doing this in the first place – I’m learning, and that is its own reward.

Dummy Load

Of course this ties in closely with the power supply project as I need some practical way to test the thing under working conditions not to mention calibrate it. It has taken a back seat to other projects yet I will have to build it to build my power supply. Projects always lead to more projects. It all started, as mentioned previously, with Dave Jone’s excellent example, but I’ve been further spurred on by the discovery of Martin Lorton’s excellent version which will probably be much more suited to my needs. Naturally, I will add my own modifications to both make it my own and to suit my needs. Martin’s has a 2A cap (I believe he reduced it to 1500mA by the end though) and I need mine to sink 3A to properly test my power supply. It should be a simple matter of selecting the right mosfet and/or using mosfets in parallel.

Given that this project is likely to take me as long as the others and I still have not been able to leave my house to grab the appropriate parts, I went back to why I need this damn thing in the first place. The easiest solution for a dummy load is to of course whack the right value resistor that can handle the power you want to dump through it. This has proven most frustrating since not only do I not have a collection of power resistors on hand, but finding ones with the appropriate tolerance and power dissipation capability has proven to be difficult.

I decided for a more low-tech approach and see if I could make my own power resistor to act as a static dummy load just for now. That is a subject of the next blog post which I will marry with the power supply pre-regulator test. Quick answer: I did, and it not only worked but I’m still alive and my house is still standing.

New Projects

Always something new an shinier on the horizon, isn’t there? This is why I never get anything done.

Milliohm meter

Keeping with the theme that projects beget other projects, the power supply needs a dummy load, the dummy load needs a precise high power low-ohm resistor, I need a way to measure low resistances. It’s commonly known that most DMMs do a woefully awful job of measuring low resistances. One has to dump enough power into it to see a measurable result, and things like the leads now have a nontrivial resistance. So I started building an adaptor for my multimeter that fixes these problems. A post will be written on this also. No, I didn’t finish this either.

eGo Charger

This is merely an idea and a helpful schematic posted by someone on a forum somewhere. One of my eGo chargers for my ecig is malfunctioning and not doing it’s job and I sit here rather nervously waiting for my one functioning one to die and deny me my fix. I’m merely thinking about this one for now, if I get it wrong i’ll have explody batteries on my hands so you can bet I’m going about this one carefully.