Welcome to buchanan1.net

J.R. Buchanan

http://www.buchanan1.net

Joule Thief

Testing variations on the popular Joule Thief circuit

May 2016

Joule Thief on breadboard

schematic 2

Introduction

I've seen articles about Joule Thief circuits on the Internet for years. Bascically it's a boost mode switching supply that is powered by a single AA cell and used to light an LED. There are two things that make the Joule Thief interesting. Fist, the voltage provided by a single AA cell is not normally enough to light an LED, especially a white or blue LED, both of which require the highest voltage needed by commmon LEDs. LED flashlights usually use 3 cells in series to provide power. The second point, which is where the circuit gets its name, is that it will operate when the battery is depleted down to the point that its terminal voltage is around 0.5 volts. Most devices that use AA cells will only work down to perhaps 1.2 or 1.3 volts. The Joule Thief sucks the last bit of energy from the battery (term used loosely).Since energy is measured in joules, the name is "Joule Thief."

The most common circuit used is depicted above the heading. There are many articles on the web about how this circuit works, Wikipedia has an article about it. Over the last few months as I write this, there have been some edits made to the article, specifically adding and removing the claim that this is an Armstrong oscillator. It is not. An Armstrong oscillator uses a tank circuit and operates in a linear mode, the Joule Thief operates in a non-linear switching mode. The parasitic capacitance forms a tank circuit that does cause some parasitic ringing at a much higher frequency (around 8 MHz in my tests) than the fundamental frequency the circuit operates at (typically 50-100KHz). The article, in the form it is as I write is pretty decent other than that.

I'd read that it's a very forgiving circuit, tolerant of many changes in component values. I got to wondering what some of these component value changes might do to its performance. I thought of many possible variables:

This was just too much, too many things to change, too many variations to test all of the combinations. So I picked a few to try, maybe in the future, I'll try some of the other variables.

Here's what I decided to try:

I didn't actually test the parallel windings idea, however I did collect some data that confirmed my suspicions about this idea. More on that later.

There were many things I could measure; Here are the measurements I thought of:

I measured all of these for some of the circuit variations, I measured some of them for all variations. I put the results of the ones I found most interesting in tables further down, with entries for different input voltages, simulating the battery discharge.

Procedure

First I built a basic Joule Thief circuit on a breadboard. Since I'd be testing different turns ratios on the transformer, I thought I'd get a bunch of identical cores so that I wouldn't have to change the windings on the same core repeatedly. I ordered 10 Pcs 14mm Inside Dia Transformer Inductor Ferrite Toroid Cores Green from Amazon. I picked 12 turns for the secondary, pretty much arbitrarily, based on some common choices in the articles I read. For the initial trial, I used the same number of turns on the primary and secondary, what I had seen in every example of the circuit. In fact, the effect of different turns ratio was one of the things I was most curious about.

It worked the first try, using a 2N2222A transistor and a white LED, and after some experimentation, a 440 ohm (470 || 6800 ohm) bias resistor to give a peak LED current of 30mA with 1.5V in. I decided n a peak current of 30mA for most tests so that other changes could be compared on an equal basis. Here are the voltage and current waveforms at the LED for this configuration.

Waveforms

The upper trace is the LED voltage, peaking at about 3.9V, the lower trace is the LED current, peaking at about 30mA.

To be able to measure the current at various points in the circuit, I added some low value resistors, I could then measure the voltage across the resistors with a DVM and oscilloscope, and calculate the current at these points. The resistors are only 5% tolerance, so the accuracy of the measurements isn't great, however, since the same resistors were used for all trials, the results can be compared.

Here is the schematic with the resistors in place. I also added some capacitors to keep the power output of the active divider clean. The divider was added, as when I changed the input voltage from 0.75V to 1.5V in later tests, my bench supply was very touchy. It was almost impossible to set the voltage to the desired point. The divider provides a much finer resolution for the input voltage. The input power is supplied by a bench supply set to 5V. The voltage provided by the divider is variable between 0.2V and 1.9V over the full 270 degree rotation of the potentiometer. Not touchy at all. The divider provides OK load regulation, changes in current draw have minor effect on the output voltage, but provides essentially no source regulation, it must be powered by a well regulated supply, such as a bench supply.

schematic 2

C2 is used in parallel with C1 because aluminum electrolytic have a fair amount of series inductance, lessening their effectiveness as bypass capacitors at higher frequencies. C2 takes over here. Q3, the 4124DL, is massive overkill here, I just had it sitting on my bench, it was taken from a compact fluorescent light ballast. Lots of parts in those things...

The input current was measured by using a DVM across RS2. The peak LED current and the waveform of the current through it were measured by hooking an oscilloscope probe between ground and the high side of RS1. RS3 was used to measure the current through the inductor, again using an oscilloscope. Since neither side of the resistor is connected to the negative side of the power source, and my oscilloscope does not have a differential input (no 'scope I've used since my old Tektronix 545A with a differential plug-in has had this feature), the positive side of the power source was used as common, and the oscilloscope probe ground was hooked to it. This can only be done if the power supply to the active voltage divider is not referenced to ground, as oscilloscopes are referenced to ground. Nasty short circuits can happen without a floating supply. Bench supplies are virtually always floating, neither the positive or negative side is "ground." Of course, the same is true of batteries.

The oscilloscope used was a Pico Technology 2204A. This is a very nice device that plugs into the USB bus of a computer running Linux, Windows, or OS X (Mac). Although I use Linux on my desktop and file server, the laptop I have on my bench runs Windows 10 (not bad, but no Linux). I can only speak for the Windows version of the software, which is great! As well as doing what an old style analog 'scope could do, it has many other features. Later I will describe how I used one of these to measure the output power of the Joule Thief despite both the output voltage and current being very non-linear. I've barely scratched the surface of what this device can do.

Results

Different transistors

One of the first things I wanted to try was different transistors. Most of the Joule Thief circuits I saw on the web used 2N2222A, 2N3904, or 2N4401 transistors. The consensus seemed to be that the 22222A and the 2N4401 were superior to the 2N3904 due to their greater current switching capabilities. This didn't make any sense to me, as the currents involved here are small, and the 2N3904 is well within its specs, plus its higher hFE might be an advantage. Here is some information on the three transistors:

Transistor Data

As you can see the 2N3904 has a much higher current gain. I only had 2N3904 and 2N2222A transistors on hand, since the 2N4401 is so similar to the 2N2222A, I decided not to order any of the 2N4401 transistors. The actual current gain of a bipolar transistor is dependent on manufacturing, and can vary a lot between batches. It is also dependent on the temperature, which also has a very large effect, and the collector current, the effects of which can be read about in the appropriate data sheet.

The 2N2222A seemed to work well, and required 440 ohms as the bias resistor to achieve the target 30mA peak LED current. Then I tried the 2N3904. The difference was startling. The bias resistor needed to achieve 30mA peak LED current was 5700 ohms (4700 + 1000, could not find a 5600 in the %#^$% house), a massive difference. Then I measured the efficiency of the circuit by measuring the input power and output power (see below for methods used). The difference in efficiency was also startling. At 1.5V input the efficiency went from 66% to 79%. The dropout voltage (LED goes out) was 0.55V with the 2N2222A and 0.46V with the 2N3904. There is more data is in the table below. In all, this would seem to indicate that the power handling capability of the transistor is less important then the current gain. Not surprising at this low collector current. BTW, the peak collector current, which is the same as the peak inductor current, and which occurs while the inductor is charging, is always the same as the peak LED current, which occurs as the inductor initially discharges into the LED.

Different turns ratios

The number of turns in the windings and the turns ratio of the transformer interested me as well. Trying many combinations of these could easily lead to an unworkable amount of effort winding different coils. I decided to just test three ratios, all with 12 turns on the primary, and with 8, 12, and 16 turns on the secondary. When I measured the efficiency, power output, and dropout voltage characteristics resulting from these changes, all biased for a peak collector current of 30mA with a supply voltage of 1.5V, I was surprised to discover that, while there were differences in behavior between the three transformers, none of them stood out as massively superior to any of the others. Each showed an advantage in one category or another.

I tested each variation at 0.75, 1.0, and 1.5 volts on the input. As the input voltage dropped, the output power dropped, as did the efficiency of the circuit. As the input voltage dropped, the operating frequency went up. As usual, more in the table below. The 4.3K ohm resistor was 47K || 4.7K and the 7.7K resistor was 33k || 10K

White LED data

Measured Data

Different # primary turns

I'd done all of the previous tests with a transformer having 12 turns on both the primary and secondary. Of course, different turns count had to be tried. I chose 8 turns and 16 turns, with a 1:1 turns ratio for each. The 8 turn transformer yielded the highest operating frequency of all combinations I tried. The 16 turn transformer yielded the lowest operating frequency. The efficiency with the 8 turn transformer was not impressive, but with the 16 turn transformer I saw the best efficiency of all the combinations I tried. As usual, the data is in the table below.

Different # primary turns data

Measured Data

Different LED color

I got curious at this point. What would switching to a red LED do? To get about 30mA peak output with the 2N3904 transistor and the transformer with 12 turns on both windings, it took a 5.7K resistor. The first thing I noticed was the awful efficiency of the circuit at 1.5V, down from 79% for the most similar white LED circuit to 60%. However, the measurements at 1.0V and 0.75V showed higher efficiency than the equivalent white LED circuit. Then I noticed that the operating frequency didn't seem to change much as the voltage dropped from 1.5V to 1.0V. A more careful examination showed that the frequency dropped (the opposite of the white LED circuit) from 50KHz as the voltage dropped from 1.5V to 1.16V, to a low of 45.3KHz, then increased to 52KHz at 1.0V and 73KHz at 0.75V. Also, there was a lot of ringing at 7.8MHz when the transistor switched off. Way more ringing than observed in any other configuration. Why these changes? I'm not sure, and am going to put some more thought into it. Again, more in the table below.

Red LED data

Measured Data

Different bias resistor

I had selected the bias resistor for 30mA peak LED current in all the other tests. But what would happen if the bias resistor was changed while other values remained the same? I decided to use the transformer with 12 turns on both the primary and secondary, the 2N3904 transistor, and to start with the 5.7K bias resistor that yielded 30mA peak output current. I then tried a 4.7K and a 9.4K (4.7K + 4.7K) resistor. The results weren't too surprising, lowering the bias resistor lowered the operating frequency, raised the output current, and lowered the dropout voltage. Raising the bias resistor did the opposite, and also lowered the efficiency, lowering it had not significantly raised the efficiency. The results are in the table below.

Bias resistor data

Measured Data

Parallel primary windings

The current through the inductor is roughly a triangle wave, increasing as the inductor charges (transistor switched on), and decreasing as the inductor discharges through the LED (transistor turned off). The slopes are roughly linear, as the voltage across the inductor is fairly constant in charge and discharge. The inductor has the supply voltage across it during charge and the LED "on" voltage across it during discharge. There is some nasty ringing at about 8MHz when the current is switched off.

Since the peak inductor current is 30mA the single conductor of 28AWG wire I used for the primary (and secondary) is more than enough, no need for the four conductors in parallel suggested by some articles. These authors assume that the current as the inductor is charged is defined by ohms law, the supply voltage divided by the resistance of the winding. We can see that that is very much not the case. The primary winding has a measured resistance of about 0.85 ohms. I measured this by passing 100mA through the winding using a current regulated bench supply and measuring the voltage across the winding, which came out at 0.085V. The math for the resistance:

R=0.085/0.1  R is 0.85 ohms

We could not have accurately measured that with a digital ohmmeter, it is far below the useful range of a typical digital multimeter, partly because the resistance of the test leads is in the same range as the resistance we're trying to measure, you'd be introducing quite a bit of error there. In fact, if one was not careful, it would be easy to measure the resistance of part of the test leads even using the method I did use. The test leads of the meter have to be connected directly to the leads of the coil, not to any other point on the wires connected to the bench supply so that none of the measured voltage drop occurs in the lines that supply the test current.

If the authors who wanted parallel primaries were correct, using ohm's law, we'd have an inductor current for a single conductor of:

I=1.5/0.85  I is 1.8 amps!

A bit more than the 30 mA we measure! More than either the 2N2222A or 2N3904 can handle without damage as well. The resistance of the primary has very little effect on the peak current, the inductance is the limiting effect. The current through a pure inductance can not change instantaneously. When the transistor switches on, the current is still zero. As time passes, the current increases as described by:

I=E*t/L

As t (seconds) (L is inductance in Henries, E is voltage)) increases, the current increases. In this circuit, I (current) hits only 30mA before the transistor shuts off. Incidentally, knowing that the voltage across the inductor is about 1.5V, the current hits 30mA, and that in one variation of the circuit having a 12 turn primary, the charge time is measured at 9.8uS, we can calculate the inductance of the primary as:

0.03=(1.5*9.8*10^-6)/L  L is about 490uH

The result is approximate due to inaccuracy in measurements, especially due to the 5% resistor used for RS1.

Measuring power and efficiency

The input power was calculated by multiplying the input voltage and current. Easy, as this is DC. This is why the two bypass capacitors, to assure that the voltage and current are close to pure DC in an attempt to reduce error.

The output power to the LED was more difficult to measure, as you can see the voltage and current are very non-linear. The peak RMS voltage and current can not be multiplied to get the power. If they were sine waves and you knew the phase relationship, you could calculate the power easily, but with these waveforms, you have a very nasty transient analysis problem. This stumped me briefly until I realized that, using my oscilloscope, I could capture one cycle of the waveforms and save them as a CSV (Comma Separated Value) file and write a simple program to calculate the power supplied to the LED. Here is what a snippet of the file looks like:

Time,Channel A,Channel B
(us),(V),(mV)

-10.03927886,0.01266518,0.00000000
-10.02927886,0.01266518,0.00000000
-10.01927886,0.01266518,0.00000000
-10.00927886,0.01266518,0.00000000
-9.99927886,0.01266518,0.00000000
~
-5.21927889,3.35459400,165.86810000
-5.20927889,3.38526600,166.12750000
-5.19927889,3.38587600,166.18850000
-5.18927889,3.35779900,166.18850000
-5.17927889,3.34482900,166.18850000
-5.16927889,3.34742300,166.18850000
~
9.99072102,3.16324400,109.33260000
10.00072102,3.17621400,109.39360000
10.01072102,3.17621400,109.65300000
10.02072102,3.16324400,108.41700000
10.03072102,3.13776100,105.88400000

Channel A is the voltage across the LED, channel B is the voltage across RS1. This file is then read into a spreadsheet and all one cycle is edited out. Then the edited file is passed through a program to calculate the LED power.

The program:

#!/usr/bin/perl

use strict;
use warnings;

my ($file_name);
my ($current_line);
my ($time);
my ($voltage);
my ($mAX10);
my ($count);
my ($sum);
my ($in_file);
my ($av_power);

# get file name
print "Enter file name: ";
$file_name = ;
chomp ($file_name);
unless (-e $file_name)
       {
       die ("***ERROR*** '$file_name' does not exist.\n");
       }

# open csv file
unless (open ($in_file, "<", $file_name))
       {
       die ("***ERROR*** Could not open '$file_name' for read, $!\n");
       }

$sum = 0;
$count = 0;
while ($current_line = <$in_file>)
      {
      chomp ($current_line);

      ($time, $voltage, $mAX10) = split (/,/, $current_line);

      $count++;
      $sum += $mAX10 * $voltage / 10;
      }  

# close file
close ($in_file);

# caculate average power
$av_power = $sum / $count;

# print result
printf ("\nAverage power: %.2f mW\n", $av_power);

The results are placed in the charts, as are the efficiencies calculated from them.

Conclusion

Of course, there is a lot more that could be done as far as changes and measurements, but at this point I'm getting tired of tinkering with this circuit. Perhaps in another article in the future I could look at more, there are plenty of ideas on the 'net. Higher power output, higher voltage, rectified and regulated output, the "supercharged" circuit mentioned earlier, many others. Perhaps the most obvious idea, and one mentioned early in this article is the effect of different toroids, and perhaps non-toroidal cores.