Tag Archives: current

Experimenting with Buck Converters

If you’re like me, the first thing you do when wiring up a new circuit is to connect the power and ground rails (with the power source initially turned off… maybe).  And you’ve probably got at least one power supply that’ll do the job.  But what if you didn’t have the supply you needed?  Perhaps all you’ve got is a 12V battery, and you’re in need of a 3.3V source.  Well, if you’ve finished your chores, I hear Tosche Station will sell you some power converters.  Failing that, you could always build your own.  A simple buck converter will likely do the trick:

The Standard Buck Converter (via Microchip)

The buck converter takes a DC input voltage and reduces it by a controllable amount, much like a resistive voltage divider.  But unlike your average voltage divider, the buck converter can efficiently supply a substantial output current.  In fact, this circuit’s output current should be greater than its input current (on average).  And no, that doesn’t violate any laws of physics; the converter’s output power will still be less than its average input power because its output voltage is lower than the voltage at its input.  In mathematical terms, (PIN = VINIIN) > (POUT = VOUTIOUT), where IOUT = ILOAD above.  Make sense?

Now clearly this isn’t your typical linear regulator.  Not with that inductor sitting there anyways.  So just how does it work then?  Well, the key is in the switching action of the p-channel MOSFET – a fact that leads us to call such circuits switching regulators.

Think of the FET as a simple switch.  When this switch is on (conducting), the current through the inductor (L1) will  ramp up (since VIN > VOUT), as will the voltage at the output capacitor.  But we don’t want the output voltage to go as high as the input voltage.  So, after a very brief on-time, we turn the switch off again.  But once the FET stops conducting, the inductor’s current has to go somewhere.  Well fortunately we have diode D1 available – it provides a path for current to continue to circulate (out to the load, back to ground, up through the diode and back to the inductor).

Here’s the trick though: this on-off switching cycle happens over and over again, many thousands of times per second.  In fact, the more frequently we switch, the smoother our output voltage will become.  This is because we have an output capacitor picking up the slack (so to speak).  During the switch-off periods, as the inductor’s current drops, COUT supplies the bulk of the output current (ILOAD).  Once the FET is switched on again, the inductor’s current ramps back up and recharges the output capacitor.  Thus, we maintain a constant ILOAD while the capacitor absorbs the ripple current (IRIPPLE).

Now as you may have already guessed, the ratio of the input to the output voltage is determined based on the relative lengths of the switch’s on and off periods.  This is a method known as pulse-width modulation (and it’s used in tons of other circuits):

Typical PWM Waveforms

If the switch were turned on 100% of the time, the output voltage would eventually equal the input voltage.  On the other hand, if the switch were on 0% of the time, the output voltage would be zero.  So it makes sense then that the output voltage is equal to our duty cycle (the percent on-time) times our input voltage.  In other words, if the switch is on for 50% of a cycle, in theory VOUT = (50%)(VIN).  Now in practice, non-ideal components will cause the required duty cycle to be higher than expected, but we’ll get to that later.

By the way, if you’re wondering how to go about picking component values for your own buck converter, there are equations for that.  But instead of going into all of the details here, I’m going to refer you to this excellent guide (and video) from Microchip.  It’ll walk you through an example design for a 12V to 5V, 2A buck converter.

The Experiments

So this past Sunday I was in my “lab” (aka the table in my basement) and decided to see how efficiently I could build myself a buck converter with the parts I had on hand:

yay for protoboards!

I’ve laid out my circuit almost exactly as shown in the schematic above (ignoring the four ceramic filtering capacitors connected across the four parallel supply rails).  On the left is my p-channel MOSFET, followed by diode D1.  The large green and black thing is, you guessed it, the inductor (which I scavenged from a broken battery charger).  To the right of the inductor are three capacitors in parallel (I’ve done this to get better output filtering characteristics at high frequencies).  The white and black wires you see leaving the right side of the board are connected to my resistive load.  The circuit is configured like so:

  • VIN = 10V
  • PFET = IRF9540
  • D1 = 1N4004
  • L1 = 100uH
  • COUT = 270uF (effective)
  • FSWITCHING = 52kHz
  • D = 62%
  • VOUT = 5V

I should also note that these component values were chosen based on an expected load current of 1A and a ripple current of 0.3A.  I only had the one good inductor to play with, so I computed my switching frequency based on its value.

Experiment #1 (Bad Diode)

For this first test, utilizing the 1N4004 general purpose diode, I measured the following:

  • PIN = 8.7W
  • POUT = 5.1W
  • Efficiency = 59%
  • TPFET = 120°F
  • TDIODE = 149°F
  • TINDUCTOR = 82°F

Alright, so while an efficiency of 59% isn’t terrible (particularly by comparison to the 50% you’d achieve using a linear regulator), it’s not great either.  Simple buck converters are typically 80-90% efficient.  So unless my measurements are way off, clearly something’s not right here.  Based on the temperatures I measured using my Kintrex IR thermometer, I suspect the diode may be our efficiency bottleneck (since it’s the warmest component).  To find out, let’s measure a few voltage waveforms while the circuit operates:

Buck Converter Test #1 Scope Trace

The top waveform, in pink, is our measured 5V output, shown at 5V/div.  Below that, in green, is the voltage measured at the connection between D1, L1, and the FET, shown at 10V/div.  At the very bottom, in yellow, is our gate drive signal.  When this signal hits 10V, the p-channel FET will be off; when it’s at 0V, the FET will be conducting.  Note that because of this inverse relationship, the duty cycle calculated by the scope (~38%) is incorrect; we need to subtract this value from 100% to get our true duty cycle (~62%).

So as I suspected, the diode is clearly having some issues.  See that big (~25V) negative voltage spike across the diode each time the FET turns off?  Yea, that’s not so good.  It means our diode isn’t turning on as quickly as it should.  This puts additional stress on the FET.  But when the diode finally does turn on, it’s showing a voltage drop of just over 0.9V.  During the switch-off period of a cycle, the diode has to conduct, on average, the full load current of 1A.  Since our duty cycle is 62%, the diode will be conducting 38% of the time, meaning it conducts an average current of 0.38A.  Using P = IV, we can determine that the diode is dissipating at least (0.38)(0.9) = 0.34W.  The diode’s turn-on delay probably accounts for more loss, but I’m not entirely sure how to calculate that.

Experiment #2 (Schottky Diode)

Well let’s just see what happens when we substitute a much better Schottky diode (15TQ060) in place of that lousy 1N4004 rectifier.  Here’s the data from test #2:

  • PIN = 5.5W
  • POUT = 5.1W
  • Efficiency = 93%
  • TPFET = 81°F
  • TDIODE = 81°F
  • TINDUCTOR = 80°F

Wow, that’s quite a difference in efficiency (from 59% to 93%)!  And it’s all thanks to the minimal (<0.3V) forward voltage of that Schottky diode, as well as its fast turn-on time.  Our waveforms are starting to look a lot cleaner as well:

Buck Converter Test #2 Scope Trace

Experiment #3 (More Current!)

So what happens if we now decide to turn up the heat a little?  What if we suddenly decide to supply a 2A load instead of 1A?  Well, I tried just that.  Here’s what happened:

  • PIN = 12.8W
  • POUT = 10.5W
  • Efficiency = 82%
  • TPFET = 96°F
  • TDIODE = 85°F
  • TINDUCTOR = 81°F

Hmm, it seems our efficiency has dropped again.  But not unexpectedly.  Based on the temperatures of the components, it seems like our FET may now be the limiting factor.  And no surprise; the p-channel device I’ve chosen has an on-state resistance of ~0.2Ω.  Using P = IV = I2R, and multiplying by the duty cycle (the switch on-time), I get:

P = I2RD = (22)(0.2)(0.62) = 0.50W

And even at 0.3V, the diode is still dissipating substantial power as well:

P = IV(1-D) = (2)(0.3)(1-0.62) = 0.23W

Now unfortunately, I don’t have a better p-channel MOSFET to try out at the moment.  So I’m just going to have to accept those losses for now (shame on me).  However, there is a way to nearly eliminate the losses of the diode: replace it with another FET!

The Synchronous Buck Converter (via Microchip)

This time I’ll be using an n-channel MOSFET which, as you may know, contains it’s own diode (called the body diode; the p-channel FET contains one as well, but I’ve omitted it in the diagrams above).  But we won’t be relying on that diode to handle any current.  Instead, we’re going to switch on the n-channel FET whenever the p-channel FET turns off (they’ll be complimentary).  In doing so, we’ll create a low resistance path (<0.1Ω) through which the ripple current can continue to flow during the P-FET’s switch-off period.

Sadly, I can’t claim credit for this brilliant idea.  I’m not sure who first thought it up, but it’s called the synchronous buck converter (as opposed to the asynchronous, or standard, buck converter).  I imagine this is because you have to operate the two FETs in sync with one another.  This makes life a little tricky, as you don’t want to accidentally turn on both transistors at once (thus creating a short from power to ground).  But it’s not bad.

Here’s a scope trace showing the n-channel FET’s additional gate drive signal (in purple):

Buck Converter Test #4 Scope Trace

Experiment #4 (More Current, More FET!)

Well I’m sure you’re just dying to know how much of an efficiency improvement this synchronous converter will provide.  Well fear not, here are the results of my last test:

  • PIN = 12.0W
  • POUT = 10.4W
  • Efficiency = 87%
  • TPFET = 96°F
  • TNFET = 84°F
  • TINDUCTOR = 82°F

Indeed, this is an improvement!  We’re not quite back to the 93% efficiency we saw at a load current of 1A, but 87% is still better than 82%, no?

So, lessons learned?  Use quality components.  That means FETs with as low an on-resistance as possible.  And if you don’t want to go with the synchronous converter, make sure you pick a fast diode with low forward voltage.

By the way, although I haven’t done it here, you’ll probably want to wrap your buck converter in a controller of some kind (unless your load current will be fairly constant).  If you don’t, with a constant duty cycle, variations in load will cause your output voltage to change by a fair amount.  Fortunately, If you look around the interwebs, you’ll find a number of ICs that provide buck converter control.  But if you’re clever, you could whip up your own op-amp control circuit.  Or just program an AVR to do the job for you – they’re great at PWM.  Give it a shot and let me know how you make out.

One last thing: if you’ve been counting, you’ll notice that the losses I’ve calculated don’t add up to the difference between input and output power.  Lest we forget, there are still resistive losses in the inductor and output capacitor, as well as switching losses on the transistor(s).  This switching loss has to do with the power dissipated in the FET’s gate capacitance, as well as resistive losses as the transistor ramps between on and off states (nothing happens instantly you know).  The solution?  Again, buy better parts. 🙂

Questions, comments, suggestions, requests?  Feel free to leave them below.  Thanks!

Heatsink or Swim

Apparently I have a thing for testing.  I rather love to run experiments, even when there’s no immediate need for the results.  I guess I just enjoy trying stuff, and hey, maybe even learning a thing or two. 🙂

So last weekend I was doing a bit of tinkering and got to wondering about the performance of different heatsinks.  Now just intuitively, I know that larger heat sinks tend to dissipate more heat than smaller ones – particularly if they have larger surface areas.  But just how much better is a tall, finned heatsink than a small, clip-on device?  This is what I wanted to find out.  So I gathered up five sinks of varying sizes and started to design my test.

The Heatsink LineupPictured above, from left to right, we have the following parts:

  1. A small clip-on heatsink, 230-75AB, cost: $0.36
  2. A medium-sized, bolt-on heatsink, 7-340-2PP-BA, cost: $3.91
  3. A larger bolt-on heatsink, 531202B00000G, cost: $1.28
  4. A Pentium 4, Socket 478 CPU cooler, cost: ~$35.00
  5. A Crydom SSR heatsink, HE-54, cost: ~$25.00

I decided to test each of these sinks with a TO-220 package transistor (since, at least in the case of the first three devices, this is what they were designed to cool).  Specifically, I’ve chosen the IRL2703, an N-channel MOSFET rated for 30V and 24A.  Now, the TO-220 package is also commonly used with regulators, diodes, etc.  So these heatsinks might be found in a number of different applications.

In order to control the power dissipated in the transistor, I’ve built a very simple current-control circuit using an op-amp (LM741) and a 0.1Ω sense resistor (Rs):

MOSFET Current Control Schematic

I will be using the transistor as, essentially, a variable resistor connected to a 12VDC power supply.  The transistor’s drain-to-source resistance varies based on the voltage applied between its gate and source.  Control of this voltage is the responsibility of the op-amp shown in the schematic above.

If you can recall the “golden rules” of ideal op-amps, you’ll remember that, with negative feedback (that is, a path between the op-amp’s output and its inverting (-) terminal), the voltage at the op-amp’s inverting (-) terminal will be equal to the voltage at its non-inverting (+) terminal.  In the circuit above then, if Vin = 1V, after being passed through the potentiometer’s 10:1 voltage division, the voltage at the op-amp’s non-inverting (+) terminal, and consequently its inverting terminal, will be 0.1V (remember also that no current flows into either of these “ideal” terminals).

So notice that the op-amp’s inverting terminal is connected to one leg of our sense resistor, Rs.  So when our input voltage is 1V, the voltage across Rs will be 0.1V (remember the voltage divider).  By Ohm’s law then, the current through the sense resistor will be I = V/R = 0.1/0.1 = 1Amp.  So an input of 1V will yield 1A through the transistor.  With an input voltage of 12V then, we’ll be dissipating approximately 12W in the transistor (actually 11.9W, to be precise; we’ll lose 0.1W in the sense resistor).

For my experiments, I’ll be using a constant current of 0.5A, which will yield a power of 6W.  This seems to be a reasonable value to use with all of my heat sinks.  And it’s still not quite enough to completely toast a naked (no heatsink) transistor.

In order to measure the temperature of the transistor as the test proceeds, I’ll be using a Kintrex infrared thermometer, model IRT0421, which I’ve had for years.  My plan is to simply move the thermometer around the transistor, at close range (1-2″), and record its maximum reading.  Admittedly, this isn’t the most precise solution.  A better idea would probably be to attach a small thermocouple between the transistor and the sink.  But that’s something I don’t have.  My method should at least provide a good indicator of relative, if not absolute, performance.

My procedure here is quite simple.  First, I will attach a heatsink to the transistor using a small thermal pad.  I will then apply a current of 0.5A at 12VDC, and allow the transistor to reach a stead-state temperature.  I will then allow everything to cool, remove the thermal pad, and try the same test again.  Perhaps my video-self can explain this better:

Before diving into the results, here are a few more pictures of the circuit and setup.  By the way, in case you’re wondering what that silver pen-like device is that’s jammed into my protoboard next to the opamp, it’s my home-made scope probe.  I took an old BIC pen, removed the guts, and then epoxied in a dulled sewing needle and wire.  It’s actually a great little probe; I leave it connected to my IOBoard most of the time.

Current Control Circuit

This is how the transistor was attached to the Crydom heatsink:
Crydom SSR HeatsinkAnd for the Pentium 4 cooling package, a single 4-40 hole was tapped (note that this image has been flipped horizontally, for aesthetic reasons, so ignore the wire colors):

Pentium 4 CPU Cooler

Results

Alright, so I’m sure you can’t wait to learn how things turned out, right?  Well, without further ado, I present to you my grand table of results:

Heatsink Under Test
Temp @ 10 Mins.
Temp @ 40 Mins.
Rating
(Expected Temp)
NONE
152°C N/A 58.7°C/W
(373°C)
Clip-On Heatsink 136°C N/A 28.5°C/W
(192°C)
Bolt-On Medium Heatsink 93°C N/A 3.1°C/W
(40°C)
Bolt-On Large Heatsink 78°C N/A 7.5°C/W
(66°C)
Pentium 4 Heatsink 32°C
(no fan)25°C
(fan on)
38°C
(no fan)25°C
(fan on)
N/A
Crydom SSR Heatsink 28°C 31°C 0.9°C/W
(26°C)

(Note that these test were performed at an ambient temperature of 21°C.  The “Expected Temp” numbers are calculated by multiplying the manufacturer’s ratings by 6W, and then adding the ambient temperature.  Also, the smaller heatsinks were only tested for 10 minutes, as it only took this long for them to reach steady state.  The more massive heatsinks were given 40 minutes.)

So now you may be wondering, “Wait, what happened to the tests with and without the thermal pads in place?”  Well I’ll tell you: the difference in final temperature with and without the pads was insignificant (perhaps one or two degrees at most).  This was a little surprising to me, as I’ve always been told to be liberal with the thermal grease/paste (and these thermal pads serve the same purpose, they’re just cleaner).  So I figured the exposed side of the transistor would be somewhat warmer without the pads in place.  And yet, that does not appear to be the case.  But am I confident enough in this result to stop using thermal paste/pads?  Eh, not really.  I’d probably still use the pads, and I’d make sure the heatsink was firmly attached (since that makes for better conduction).

Another interesting point to note: the snap-on heatsink I tested here performed little better than operation without a sink (it yielded just a 13% lower temperature rise).

Strangely though, the snap-on heatsink was the only one that seemed to measure up to its manufacturer’s °C/W rating.  I calculate a value of (136-21)/6 = 19.2°C/W, which is less than the advertised 28.5°C/W (a good thing).  But neither of the bolt-on heat sinks met their advertised ratings.  The medium-sized sink reached just 12°C/W while the larger one hit 9.5°C/W.  I’m not sure what to make of this.  Is there something I’m missing here?  Perhaps an error in my calculation?  It sure seems straight-forward…

Well finally, I was rather pleased with the performance of the Pentium 4 cooler as well as with the Crydom heatsink.  I did expect both to do well though.  The Socket-478 Pentiums could produce about 60W, so you’d expect even a stock heat sink to be able to handle one-tenth of that power with little problem.  I was amazed at just how quickly turning on the fan brought down the temperature though.  Within just a few minutes the heatsink felt cool to the touch (having just been at about 38°C/100°F).

Conclusion

In light of this data, which of these heatsinks would I choose?  Well, for this transistor, the datasheet lists a maximum operating junction temperature of 175°C.  In the above tests, I’ve measured case temperatures, so we’ll need to factor that in.  Again, the datasheet lists a thermal resistance from junction to case of 3.3°C/W.  So when dissipating 6W, as in the tests above, the junction temperature will be about 20°C warmer than the temperature of the case.  So our maximum allowed case temperature will be 155°C.  You’ll notice that with no heat sink, the transistor reached a temperature of 152°C, so in theory, you could safely operate at 6W with no heatsink at all.  But should you?  No.  For one thing, stuff starts to smell nasty at that temperature.  Plus, continuously running hot will almost certainly reduce the operating life of your transistor.

In general, I’d suggest keeping transistors well below 100°C.  So in this case, I’d be comfortable with either of the two bolt-on heatsinks.  Anything more is overkill.

By the way, here’s a neat article on defacing currency some home-made heat sinks.

So, comments, questions, suggestions?  Feel free to leave them below.  Thanks!

Update (11/24/2011):

Christoph kindly pointed out in the comments section (below) that I’d forgotten to incorporate the dissipation of the TO-220 package itself when predicting case temperature values based on the heatsink specs.  Although not quite half of the transistor’s surface area is attached to the heatsink, the front is still sitting in open air.  Now, the datasheet specifies a thermal resistance of 62°C/W from junction to ambient.  I’m measuring case temperatures, so we need the thermal resistance between case and ambient.  To get this, I need to subtract out the junction to case resistance of 3.3°C/W, for a case to ambient package resistance of 58.7°C/W.

Now, instead of trying to figure out the thermal resistance for just the front of the heatsink (which would just be a guess, really), let’s see what the effect of adding in the transistor datasheet’s full thermal resistance has on our predicted temperatures.

As with electrical resistances, we can determine the combined thermal resistance of the heatsink and transistor by adding them in parallel, as follows:

R_tot = 1/(1/R_transistor + 1/R_heatsink)

Let’s apply this for the clip-on heatsink:

R_tot = 1/(1/58.7 + 1/28.5) = 19.2°C/W.

That’s a pretty big difference!  For 6W, this predicts a temperature of 136.2°C – much less than the 192°C I calculated above, and much closer to my measured value (136°C).  Here is a summary of the new predicted resistances and temperatures (I have NOT yet updated the table above with these new values):

Clip-on Sink: 19.2°C/W, 136°C
Medium Bolt-on Sink: 2.9°C/W, 38°C
Large Bolt-on Sink: 6.7°C/W, 61°C
P4 CPU Cooler: N/A
Crydom Sink: No Effective Difference (the supposed resistance of this heatsink is already so low, adding in the dissipation of the transistor itself makes no noticeable difference)

So making this correction helps with the clip-on sink, but it’s made things worse (at least by comparison with the tested value) for the two bolt-on sinks…

The other adjustment we could make would be to add the case-to-sink resistance of the transistor.  The datasheet lists this value as 0.5°C/W for a flat, greased surface.  Which in this case adds 3°C for 6W.  This could account quite well for the difference in measured values for the Crydom heatsink, but it doesn’t make a huge difference for the others.

Again, these are all pretty much approximations, and as I’ve already admitted, my testing procedure is not terribly accurate.  However, I do believe that it’s still a fairly good relative comparison of these sinks.  If I were measuring the temperatures of the sinks directly, yes, there would be differences in their emissivity, which would affect my IR thermometer.  However, I held the thermometer very close to the transistor and measured the temperature of the same point on the case of the same transistor in all tests.  So I’m not too worried about this.  Again, thanks to all for the comments!

Iontophoresis: Pharmacology, Meet Electrical Engineering

Iontophoresis Patch Dispensing DexamethasoneI don’t mean to brag, but I have a really great mom.  Sadly though, last week she twisted her ankle quite badly.  According to her physical therapist, the injury caused damage to one of the nerves in her leg.  So, in addition to the more traditional PT remedies (cold and hot packs, stretching exercises, etc), he prescribed a disposable iontophoresis patch, pictured here, for the administration of the anti-inflammatory drug dexamethasone.  And the day after she was done with it, my mother, knowing of my fascination with electronics, mailed it to me for disassembly.

So just what is iontophoresis?  (And why isn’t it spelled ionophoresis?  That letter “t” really feels out of place to me…)  Well, it is a method for drug delivery which utilizes direct electrical current to “push” charged ions through a patient’s skin – no needle required.  It works based on the simple principle that like charges repel and opposite charges attract.  So, if we have a drug which can be ionized – either positively or negatively charged – we can apply a like charge to the delivery electrode, and an opposing charge to the skin itself.  This difference in electrical potential (aka voltage) will cause the charged drug ions to flow into the skin.  Cool, right?

Empi Iontophoresis Action Patch: Underside

In practice, drug delivery using iontophoresis is quite simple.  First, a solution of the drug to be dispensed is applied to the appropriate electrode (either positive or negative, depending on the charge of the ionized drug).  Then, both the delivery electrode and a second, oppositely-charged electrode (necessary to complete the electrical circuit) are applied to the patient’s skin.  Finally, a small electrical current, usually no more than a few milliamps, is applied between the two electrodes for a set amount of time.  Dosages are specified in mA-min: the number of milliamps applied, multiplied by the treatment duration in minutes.  The battery-powered patch shown above is rated for 80 mA-min when used for 3 hours.  Thus, it delivers an average current of 80/(3*60) = 0.444mA.

Alright, let’s get started with the teardown.  First off, I removed the labeled cover from the top electrode, which was held on by only a fairly mild adhesive:

Iontophoresis Patch Electronics

As you might have guessed, I found a whole slew of 1.5V alkaline coin-cell batteries, linked together in series to produce 10.5VDC.  Towards the bottom-middle of the battery compartment, you’ll notice a small bracket-shaped device.  This is actually a spring-loaded switch which is held open by a removable tab (no longer present).  This switch is necessary to prevent the batteries from discharging until the patch is applied and the tab removed.  The underside of the battery compartment doubles as the positive electrode, and is attached to the conductive gelatinous pad shown in a previous image.

Before going any further, I was curious to see if I could bring the discharged device back to life once more.  So, I punched a couple of small holes in the battery compartment and inserted my own wires.  Those wires were connected back to a DC supply set to 10.5V:

Repowering the Iontophoresis Patch

Indeed, the LED (what Empi’s marketing department calls the “Smart Light”) illuminated once more!  Now, I’d already suspected this to be a fairly simple system – basically a set of batteries in series with a resistor – but I decided to take some current measurements between the two electrodes to confirm this.  To do so, I grabbed a bit of aluminum foil, some wires, a section of plastic wrap, and assembled it like so:

Measurement Connections

Not the prettiest thing, granted, but it did the job.  The adhesive backing on the patch held the plastic wrap tightly in place, pressing the aluminum foil snugly against the two electrodes.  I first inserted a 50k resistor in series with the electrodes, and measured a current of 143uA.  I then lowered the resistance to 25k, and recorded a current of 251uA.  Finally, I shorted out the two electrodes and saw a current of 1240uA.  Clearly, there was nothing here performing current control.  The amount of current this device delivers depends solely on the resistance of the patent’s skin.  But, that’s probably fine.  I mean, does skin conductance really vary much from patient to patient?

With that test complete, I removed my wires and proceeded to extract the opposite end of the circuitry from the drug delivery electrode (it was again held in by mild adhesive):

Iontophoresis Patch: Complete Electronics

Nothing terribly exciting here, honestly – a flexible circuit board with five components, seven coin cell batteries, and a switch.  The whole thing was quite easily traced:

CircuitNow I’m guessing, but I’ll bet that extra diode D1 is there to cause the LED to shut off sooner than it would with just a series resistance.  The forward voltage across D1, about 0.7V, requires that much more voltage from the batteries for the LED to be illuminated.  The purpose of R3, I’m guessing, is to prevent too much current from being delivered to the patient.  And the function of R1 can only be to discharge the batteries more rapidly, which I’ll wager is done to guard against an excessively long dosing time.

So the question is, does iontophoresis actually work?  Well I’m afraid the verdict’s still out on this one.  One study indicates a measurable difference in the delivery of the drug dexamethasone, but does not demonstrate a tangible benefit to the patient.  Overall, the results are mixed, and iontophoresis is still considered experimental by insurance companies (who won’t typically pay for it).  Take a look at this great article for more info.

Oh and as for my mom, she’s doing just fine, although she isn’t quite sure whether or not to attribute that to iontophoresis.  With so many other treatments being employed in parallel, it’s hard to tell what worked and what didn’t.  But at a cost of $12, the patch she used was probably worth the try.  I certainly got a kick of out it anyway.

Measuring Telluric Currents – First Trial

Way back in November of last year (2010), I wrote a short little article on telluric currents, their history, and related applications.  Now, in case you’re unfamiliar with this topic (as I was prior to November of last year), here’s the executive summary: telluric, or earth currents, are electrical currents which travel through ground or water, primarily near the surface of the earth.  They may be naturally occurring (due to changes in the earth’s magnetic field via solar wind), or man-made (e.g, from mineral exploration).

Well towards the end of my previous post, I expressed a desire to try and measure these currents.  Unfortunately at that time, it was winter, and I was in the process of relocating to Iowa.  But now that I’ve settled in here, and the ground has finally thawed, I’ve gone out and performed a quick first measurement.  Here’s the procedure I followed:

  1. Obtain two 36″ lengths of standard rebar and 100′ of insulated 14 AWG copper wire (solid core works, but I used stranded for better contact with the rebar).
  2. Sand/file any rust from the surface of the rebar (to reduce contact resistance).
  3. Strip about two inches of insulation from the ends of the wire, then fray these ends and wrap them tightly around one end of each piece of rebar.  Cover these attachment areas with electrical tape.
  4. Cut the wire, which is now linking the two pieces of rebar, at any point (this is where the multimeter will be inserted).
  5. Space the two lengths of rebar as far apart horizontally as possible, then drive them into the ground as deeply as possible (in my case, this was about 20″).  For my first test, I configured the two so that they would point north to south based on the map shown here and my location in Iowa).  In other words, if I were to stand at the southern-most length of rebar, facing the other rod, I would be facing north.  They were separated by the 100′ of wire.
  6. Measure both current (short circuit) and voltage (open circuit).
  7. Finally, if anyone should question what the @#$% you’re doing pounding rebar into the ground, simple employ this catch-all excuse: “solar flare protection.

So, without further ado, I give you my results (in low-quality cellphone pic format):

Telluric Current - Well, it is measurable...

If you can’t quite make out that reading, my apologies.  The meter indicates 0.55mA (DC).  Yea, not too incredible, I know.  I also measured the voltage between the two rebar rods, but at just 105mV, it’s not terribly impressive either.  So, at best, we’ve got 14.5uW of power to play with – barely enough to run a digital watch (please see this excellent page on Thevenin equivalent circuits and the maximum power theorem for details on how that number was calculated).

Overall, these results are a little disappointing, both in quality and in quantity.  I had hoped to reconfigure my rods a couple of times so as to measure the current’s heading as well.  Unfortunately, for this test I picked a slightly wooded area that also happened to be teeming with mosquitoes.  I’ll do a lot of things for the sake of science, but serving as a meal for blood-sucking insects isn’t one of those things.

In the future, I’d like to leave the rebar in place for a while longer – say, 24 hours – and record data continuously during that time.  I’ve read in a number of sources that telluric currents tend to vary over the course of a day.  So, when I did my test this morning (8:30AM CST), I may have been measuring things as a low point.  The only trouble with capturing data for such an extended length of time is that I’ll need to find a more controllable location, and I’ll need to figure out how to log the data automatically.  I’ve got a few development boards I can probably re-purpose for that though…

So, in summary, for round two of testing I shall make the following changes:

  • Take measurements with the rods configured along different compass headings.
  • Log data for a consecutive period of at least 24 hours.

If anyone has other suggestions, please leave a comment.  Stay tuned for more.  Thanks!

Current Sensing Made Easy

Current ShuntIt’s been said that engineers aren’t boring people, we just get excited about boring things. Well, that may be true, but I’m not so sure. How could anyone not get excited about measuring hundreds of amps worth of electrical current?
All those electrons, zipping by at less than 0.1mph…

Thrilling, I tell you, thrilling!

But seriously, do you know what you can do with hundreds of amps? Welding is one thing, and that’s pretty hip to be sure. Plus, everybody’s making coil guns these days. And what do all good impulse weapons need? Current! Well, strong magnetic fields to be precise, but currents produce magnetic fields. So, more current!

Anyway, if you’ve ever needed to measure currents of tens or hundreds of amps, you’ve probably used a current shunt (pictured above right) or something similar. These devices simply take advantage of Ohm’s law, which states that the voltage measured across a resistor (the shunt) is equal to the product of current and resistance:

Ohm's Law (Voltage = Current * Resistance)

So, we put our precisely-known resistance in-line with the current we wish to quantify, then simply measure voltage (which is typically a substantially easier task) and OLPCcompute current. Now there are going to be a few problems with this. First, putting additional resistance into your circuit is going to waste a bit of power. A typical 100A current shunt introduces a resistance of 1mΩ. Pretty small, right? Well at full current, it’ll be dissipating 10W of power. Admittedly, yes, 10W is pretty small. But still, that’s 10W which could be put to better use powering laptops in Africa. Plus, this 10W causes the shunt to heat, which could cause inaccuracy and even damage over time.

The second issue with current shunts is their need for amplification. With the 100A shunt I mentioned previously, you only get 1mV per ampere. With a 12-bit ADC using a 3.3V reference, that’s only a resolution of 0.8A. To get better resolution you’ll need an op-amp of some sort. And if you’re measuring bidirectional currents, you’ve then got to worry about how to deal with negative voltages. All of this just means more cost, more parts.

Today, I’d like to introduce you to another one of my favorite integrated circuits: the Allegro Hall-Effect Current Sensor. I first found these ICs on DigiKey while looking for a current sensing solution for my Doom Box solar power system. I’ve since used them in several iterations of that project as well as my fuel cell demonstration system, and have been very impressed with their performance. A few varieties are pictured here:

Allegro Hall-Effect SensorsAnd just what do they do, you ask? Well, they measure currents using the Hall effect. But you figured that out from the title. The result of this method is a significantly lower series resistance. And what’s really nice about these chips is their built-in amplification circuitry. They provide a voltage output which is proportional to measured current on a 0-5V scale (even for bidirectional currents, where 0A is represented by a 2.5V output).

So how does this compare to our old friend the shunt resistance? Allegro’s 100A ACS758 sensor provides an output of 40mV per ampere with a series resistance of just 0.0001Ω. That reduces our maximum power dissipation, by a factor of ten, to just 1W. How about cost? A 100A shunt goes for around $24. The ACS758 costs $7. So to summarize: this solution offers forty times more resolution, ten times lower power dissipation, three times lower cost, and requires fewer external components. Now you see why this excites me?