Building a Tiny “Joule Thief”

Yesterday I got a “Joule Thief” (a.k.a. Armstrong self-oscillating voltage booster) circuit up and running on a breadboard. The circuit was more complex than it needed to be, with a tangle of wires, because things got messy while debugging. But now that I know which parts connect to which, it’s time to simplify.

The goal is to make it small and compact enough to package together as a single-battery LED flashlight. That general goal broke down to the following parts:

  1. Minimize physical size. Since the coil is the largest single piece (other than the AA battery) it makes sense to align the diameter of the coil to the battery and pack everything else as tightly inside as I can.
  2. Minimize component count. Most Joule Thief examples on the internet (including the top picture on the Wikipedia page) soldered the legs of the individual components together. No circuit board needed.
  3. Friendly to hand soldering. There are some ready-made Joule Thief circuits for sale on the internet using surface mount components and a circuit board. I wanted something I can build by hand and maybe use as a soldering teaching project to be shared on the internet.

After a few iterations, I have something I’m happy to share with the world. This is purely about the mechanical assembly – the electronic schematic is identical to the one in the Wikipedia article linked at the top of this post.

An overview in words:

  • The resistor for the NPN transistor base is installed between the collector and emitter. The resistor acts as physical separation in order to avoid a short-circuit.
  • The transistor and LED are pointing in opposite directions, allowing their pins to point towards each other and soldered together. The aforementioned resistor keeps the LED anode and cathode separate.
  • The transistor is stuffed into the middle of the coil, utilizing the center volume.

The build sequence in pictures:

1 - Transistor
Transistor with the base bent in preparation for resistor installation.
2 - Transistor Resistor.jpg
The 1K Ohm resistor is installed on the base, between collector and emitter.
3 - Transistor Resistor Coil
The coil has two wires wound together. One end of this dual-coil is facing the camera, the other end facing away. Since we need to wire up the coil in opposite directions, we’ll bend one wire of the front pair towards the back, and the opposite back side wire to the front.
4 - Coil prep.jpg
The two wires now facing away from the camera are soldered together to become the positive terminal of the circuit. One of the two wires facing the front will be soldered to the resistor, and the other to the emitter.
5 - Transistor in Coil
Transistor in the center of the coil. Now the coil wires can be soldered.
5a - Resister soldered
Resistor soldered to one coil wire, all the others have been trimmed short in preparation for attaching the LED.
6 - LED
LED is soldered to the circuit, as is a wire to act as negative (return) wire.
7 - AA
Install the whole assembly in front of a 3D-printed AA battery tray: Let there be light!

Building a “Joule Thief”: Adventure in Analog Electronics

One of my early memories as a little kid playing with my battery-powered toys was the realization that battery exhaustion is not an absolute thing. A set of AA batteries that could no longer run a motorized toy aren’t completely useless – they could be installed in an electronic toy and make that light and beep. I turned it into a little game for myself: swapping batteries around trying to figure out which tired worn batteries would work in which toys.

A well-meaning adult saw this activity and thought they saw a poor child frustrated by dying batteries. He or she (I have no memory of the person, only their action) tried to help by taking away the worn batteries and giving me a fresh pack of AAs. They were understandably confused when their well-intended kindness were rewarded by an upset toddler in tears.

Many years later I would learn how electric motors demand more current than microprocessors along with their effect on battery power output, thus explaining my childhood observation. I understand what’s going on now, but I still try to pull every bit of power out of a non-rechargeable battery before they are disposed.

Which is why my eyes lit up when I learned of a circuit that can power a LED from a “dead” battery. Wikipedia says the official description is “Armstrong self-oscillating voltage booster” but it’s filed under “Joule Thief“, the pun name that I usually see.

This type of electronics projects venture beyond the digital world I’m familiar with. There’s no voltage representing 1 and 0, instead it works with voltage that oscillates. Specifically, I’ve never worked with the fields generated by wires coiled around a toroid core. The first few attempts – using either hand wound coils or savaged from electronics – failed. And I didn’t understand enough to diagnose if it’s the coil or the circuit.

This time around, I took a shortcut: I bought a pack of coils with customer comments that confirm they can be used for building Joule Thieves. This way, if the circuit didn’t work, I knew it was my fault and not the coil. And indeed, the first few attempts failed because the coil was not correctly connected to the rest of the circuit. (The key phrase I missed in the Wikipedia article: “the two windings are connected in opposing directions”.)

Attached is the picture of the first iteration that actually worked, powered by a “dead” AA battery. This circuit is unnecessarily complex because I had been moving parts and wires, around trying to understand where I made my mistake. But now that I have a working Joule Thief I can start simplifying and make a more compact version.

Joule Thief v1

Investigating the Infamous Relay Bypass for Monoprice Maker Ultimate (Wanhao Duplicator 6)

This week my 3D printer stopped working mid-print. All motor movement, heating activity, and cooling fans stopped simultaneously. However, the control panel is still responsive and so is the LED light strip. Time to hit the web and see what I can find.

My printer is a Monoprice Maker Ultimate, which is a rebranded Wanhao Duplicator 6. Which is in turn a knock-off of the Ultimaker design, though not a literal clone of any specific Ultimaker model.

A web search of my symptoms found a known point of failure with this product: the main 24V relay. The popular explanation is that Wanhao cloned somebody else’s circuit board, removed the features that would use the relay, and used a cheap relay that’s always on. So the recommended workaround is to solder a wire to bridge the legs of the relay and bypass it. “It doesn’t do anything anyway.”

I was skeptical of this explanation because if Wanhao is really just cutting costs, they would skip the relay entirely: no relay is cheaper than any relay! There must be more to this story.

But first, a check to see if the relay is indeed the fault. A quick visual inspection confirmed that there’s a problem with my relay, indicated by the melted hole in the side.

D6 Relay hole

For additional confirmation, we temporarily bridged the pins as recommended by forum posters. When done with the power on, it brought the always-on heat break and circuit board cooling fans immediately to life. Relay failure confirmed.

What does the relay do?

Turning off this relay cuts power to all 24V components: Motors, fans, and heaters. In normal operation, there’s no situation where the 5V components (micro-controller, display, LED strip) are running without the 24V components, so the answer must be related to abnormal operation. Our best hypothesis: this relay is a safety switch in place to halt the system if the 5V subsystem should fail. If that happens, it makes sense we’d want to shut down all the 24V parts too. And now that we have a plausible description of the relay as a safety feature, bypassing it with a soldered wire seems like a bad idea.

Why did the relay fail?

This part was easier to figure out. When I ran my printer with my Kill-A-Watt meter, it indicated the power draw jumps by over 300 watts when both heaters are active. So even ignoring the cooling fans and motors, the print bed and filament heaters together draw over 12.5 amps from the 24V plane.

Typing in the designation on the relay “SRD-05VDC-SL-C” found its datasheet, which says the relay can handle 10 amps. So the printer was designed such that the relay exceeded its rated capacity anytime both heaters are active. Not exactly a great design. The relay tolerated this overworked condition for many months but this week it could take no more.

The correct solution, then, would be to replace this relay with a higher-rated unit that can handle 15+ amps continuously. (12.5 for heaters + motors and fans + margin.) Unfortunately relays are not standardized in their footprint so I failed to find a drop-in higher-capacity replacement. (I found the Omron G5LE series with the same footprint, but with the same 10A maximum for DC so I’d be no better off.) Hooking up a beefier relay to the circuit board via wires is a possibility but intimidating. 300 watts of electricity is very good at finding minor flaws and turning them into big problems.

What do we do?

To summarize, the candidate solutions are:

  1. Bypass the relay with a wire as per internet forums: Seems like a bad idea to bypass a potential safety feature.
  2. Install an exact replacement: Known to work until it doesn’t.
  3. Install a higher-rated drop-in replacement: Great idea but such a replacement could not be found.
  4. Install a higher-rated unit elsewhere in the box, connect to the circuit board via wires: Adds many points of potential failure and >300W of power is unforgiving of flaws.

I’d love #3 but I couldn’t find a beefier relay with identical footprint. #1 and #4 are asking for trouble. For the immediate future, I choose #2 as the least-bad solution.

Building a Lithium Ion Battery Pack with S-8254A Protection IC

Encouraged by my earlier success buying somebody’s implementation of an IC reference design off Amazon, I went looking for more. The previous project used a MP1584 chip to regulate the variable voltage of a battery to a constant level for a Raspberry Pi 3. Now I want to improve upon the battery side.

The battery pack had three 18650-sized lithium-ion battery cells in series. These cells were salvaged from an old Dell laptop’s power pack. Since they were ten years old, there’s a bit of a question mark hovering over them. A battery pack that simply wires them in series risks over-charging or over-discharging the weakest cell. This abuse of lithium-ion cells usually ends in a fire.

I searched for a battery management circuit board to help me avoid setting my projects on fire. I settled on this item which is built around the Seiko Instruments’ S-8254A IC. This circuit board will monitor individual cells. If any of the voltage levels exceed safe limits for lithium-ion cells during either charging of discharging, the chip will disconnect the whole pack.

Once everything was connected according to instructions, I have a battery pack that I can use with much higher confidence.

BatteryManager

Using my Astro-Flight power meter, I put this battery pack through a full charge and discharge cycle. Something I was squeamish to do before the battery protection board. Upon completion of the cycle, the power meter counted 1.65 amp-hours. The text printed on the cells say LGDA2E18650, which had a nominal 2.25 amp-hour capacity when new. Ten years old and 73% of nominal capacity is not bad, and perfectly usable for a wide range of future projects.

Powering the Raspberry Pi 3 With MP1584 Voltage Step-Down Converter

The Raspberry Pi 3 is a very impressive piece of hardware for the price, but it has its flaws. One challenge is supplying power to a Pi 3. Like all the Pi boards, power is supplied via a standard micro USB plug. This implies the Pi only needs USB level power with its specified maximum of 0.5 amp @ 5 volts = 2.5 watts. In reality, this USB port is abused beyond the specified range. The Raspberry Pi foundation recommends the power supply for a Pi 3 should supply up to 2.5 amp @ 5 volt = 12.5 watts. Five times the USB specification maximum.

None of the USB power sources I already had could handle this workload. I originally had ideas about running a Pi 3 off of a portable USB charger, but that failed under the vastly greater power draw. I went looking online for solutions.

I needed an efficient DC to DC voltage regulator that can handle the maximum power draw of a Raspberry Pi 3 without consuming a lot of power itself. Since the voltage of a battery changes as it drains, the converter needs to handle a range of input voltages while holding the output voltage steady.

The MP1584 chip from Monolithic Power Systems fit the bill, but I didn’t want to deal with a tiny surface mount IC, nor do I have the skill to design the supporting circuit required. Consulting with a few electronics hardware hobbyists, I got the recommendation to take the reference design out of the datasheet and build that.

And then, an even better recommendation: If it’s a popular chip, and its reference design is good enough, somebody would have mass-produced it and put it on Amazon. And indeed, they have. A lot of vendors, in fact, from all around the world.

I scrolled through a few of the listings but didn’t really have a good feel on how to judge one vendor against another. So I took the easy way out: I clicked on the “Amazon’s Choice” link to this offering.

Once the module arrived, I soldered battery connectors to the input and a micro USB plug to the output. I adjusted the output voltage to 5 volts, and connected everything to power up my Raspberry Pi 3.

PiVoltage

So far it has worked very well. The Raspberry Pi 3 stayed running through tasks that demanded extra power, that would previously trigger a low-power brownout with my existing USB power sources. The output voltage held steady as the battery drained.

Functional, inexpensive, and I didn’t even have to deal with surface mount components! This was a win.