Introduction: Wave JT - Larson Scanner With Joule Thief

About: I am an electronic artist living in Upstate New York. I work with LEDs, microcontrollers, and analog electronics to create objects that I find beautiful.

I love LED chasers. A bunch of LEDs neatly turning on and off on a precise timing - lights running one way, then the other way… It's relaxing, soothing, and hypnotic.
There are so many LED chaser/scanner/sequencer circuits out there, some are made with discreet transistors, some based on logic ICs, and more and more others are using microcontrollers.

There is one thing in common with all of the LED chaser circuits you find on the net - none of them can operate with just one alkaline battery!

Most of us know that LEDs need at least 2.2V or so to light. Blue and white LEDs require even higher, typically 3.2V. So obviously you can't use just one AA battery to operate an LED chaser. But we all know that there is Joule Thief that boosts voltage high enough to light any LEDs. Why not use that to operate an LED chaser?


Missing Link
Joule Thief is a nickname for this simple voltage boost circuit, predominantly used to light LEDs with one battery cell. However Joule Thief can be used to power more than just LEDs. I decided to power a microcontroller circuit with Joule Thief. (Although I ended up still lighting LEDs.)

Step 1: Features

Wave JT is not only powered by a single AA battery, but it's feature rich. Here are the highlights of the Wave JT.
  • Compact & streamlined design.
  • Uses only one AA battery (or any 1.5V battery you can hook up to).
  • Works well with rechargeables (NiMH or NiCd) too. 
  • Eight LEDs, each with its own 256 level brightness control.
  • Energy efficient - works even with a run-down battery, down to 0.6V (0.8V to startup).
  • Versatile PIC microcontroller based LED chaser/scanner/sequencer.
  • Many light animation patterns to choose from.
  • Speed control via multiple taps of a button (double/triple taps to speed up/down).
  • Start up "Quick-select" mode to choose from top 8 of over 16 patterns.




Step 2: Technical Overview

Brief Background on Joule Thief
"Joule Thief" circuit is an inductor based voltage booster circuit to light LEDs with low supply voltage. The original circuit was published in 1999 and has been quite popular. You can see the principle of the circuit here: http://en.wikipedia.org/wiki/Joule_thief

My version is a variation that uses single coil inductor, to make the inductor easily obtainable. I designed the circuit using readily available parts only, to make it an ideal DIY project.


Why Joule Thief?
There are many options to create 5V from low voltage. First of all, there are many ICs made specifically for this purpose. Those ICs are usually simple to use, and very energy efficient. However they are not cheap - typically a few Dollars a piece.
Compare that with a Joule Thief - two transistors, two resistors, a capacitor and an inductor together is still cheaper than just the IC. Plus you know how the circuit works, instead of just taking a black box someone created. I think this is an important point for Makers.
As it turned out, a simple Joule Thief circuit that I used here is more than adequate for supplying power for microcontroller project. The fact that microcontroller can actively regulate the Joule Thief's output voltage (more on this later) to improve overall efficiency makes this simple arrangement attractive.


Some Thoughts on Efficiency
I see a lot of discussion made about conversion efficiency of voltage converter circuit (Joule Thief included). No matter how efficient we make the converter, there will be some energy loss. So why use a voltage booster when you can simply use more batteries?
While a simple Joule Thief circuit like the one used with Wave JT does not have very high efficiency in converting voltage, it does allow us to use one battery instead of two or three. The net result is that there will be less batteries consumed because only one battery is used at a time (instead of two or three).

Step 3: Circuit

The power supply (voltage booster) part of schematic shows somewhat typical Joule Thief circuit, plus a few extra parts.

D1 (Schottky diode) and C2 form a rectifier to create DC voltage out of the Joule Thief. Zener diode D2 is added to "clamp" or limit the voltage at 5.1V to prevent damaging the microcontroller (maximum voltage this chip can withstand is 6V). Without the Zener diode there, the output voltage from the boost circuit can go over 6V when no LEDs are lit.

When the battery is first connected, the voltage charges the capacitor C2, then nothing happens until SW1 is closed. Once the SW1 is closed, current goes through R1 to turn on Q2, and the Joule Thief circuit starts working. In a fraction of a second, the voltage at C2 reaches high enough for the microcontroller to start up. Once the microcontroller starts running, it puts PWR signal high, so that the Joule Thief will keep running even after SW1 is open. (Power-on latch) 
Note that after initial power up, microcontroller watches its own supply voltage via A/D converter and adjusts it slightly below the zener voltage, so to not waste precious power from the battery. "PWR" connection to the microprocessor does this by turning on/off bias current to Q2.

This "PWR" pin has two purpose; one is to control the booster circuit, the other is to read the status of the button switch. (this arrangement saves a precious microcontroller pin.)
The button switch SW1 is more than a power switch, it provides pattern change, animation speed change (double tap to increase the speed, triple tap to decrease the speed). Microcontroller reads the button state by periodically turning the "PWR" pin into an input pin. This happens roughly every 8 milliseconds (125 times/second). The reading of the button takes about 2 microseconds each. The booster circuit turns off during this 2 microseconds, but it won't be felt because capacitor C2 supplies the power during that period.

PWM LED Brightness Control
Each of eight LEDs can have its own brightness level. Brightness is specified (in firmware) in 8 bit number 0 - 255. Timer interrupt routine reads the brightness levels and turn on/off each LED accordingly, in sync with the hardware PWM signal. (PWM frequency is 31.25kHz. Interrupt occurs every 32 microseconds with firmware version 1.0)
Brightness change is very smooth - using the same PWM technique as my Aurora projects. Unlike other PWM implementations, the curve of brightness change is not linear, but exponent (anti-logarithmic). This is important because our eye's response to brightness change is more or less logarithmic, therefore LEDs need to change brightness in the opposite fashion.
With Wave JT, the hardware PWM output is used as a precision clock to drive the LED bus (common line that connects to all LEDs) and "COLx" pins select which pulse to turn on the LED that's connected to.
(Please see my Aurora 9x18 instructable for deeper explanation if you are interested.)

Step 4: Firmware Functions

Besides the obvious - animating the LEDs, Wave JT firmware does a few things (as of version 1.0).


Regulate Joule Thief output voltage (microcontroller supply voltage)
Firmware monitors the supply voltage by using the A/D converter - instead of connecting one of the input pins to the supply voltage, A/D converter samples built in fixed reference voltage using the supply voltage as the A/D reference voltage. The result is the inverse number of the supply voltage. The A/D result works out to be: 512/supply_voltage. Comparing this number against predetermined threshold to turn on/off the Joule Thief circuit effectively regulates the supply voltage. This voltage is set slightly below the Zener diode voltage of 5.1V to avoid letting the Zener diode shunt the voltage - wasting energy.


Check If the Button Switch is Pushed
The firmware also routinely check to see if the button is pushed. Since the button switch is multiplexed with the pin that controls the Joule Thief, the job is a bit tricky.

The firmware first changes the pin from output to input mode. Which means that the pin becomes high impedance. Put it another way, Joule Thief circuit gets turned off. At this point, the pin voltage should go low, unless the button switch is closed. So the firmware simply reads the pin status, and turns the pin back to output mode. This happens roughly every 8 milliseconds or 125 times/second.

Now the button state is checked against the timer to see if it's held long enough. If too short, the button push is ignored as a noise. If the push is long enough, a counter is incremented to check for single or double taps. Firmware waits for a predetermined period for another button tap. When it times out, an event is created as to single/double tap, or button held down.


Animate the LEDs
Now the most important function of all - animate the LEDs! I use the word animate because Wave JT doesn't just "blink" the LEDs, but changes LED brightness smoothly up and down in full 8 bit levels.

The animation engine works in a parametric manner. It takes a few parameters to specify; base update rate (speed), the direction of the movement (left/right), threshold level that one LED triggers the adjacent LED to start changing brightness level among other things. By changing these parameters you can create endless patterns of animation.

Step 5: Parts & PCB

All parts should be easy to obtain from usual sources, such as Digikey or Mouser.

Parts List
8x 3mm or 5mm LED (Any color you want. "Super bright" type recommended. Make sure to use the same LEDs for all of them.)
1x 4.7k ohm (R1)
1x 100k ohm (R2)
8x 39 ohm (R3-10)
1x 10pF Ceramic Capacitor (C1)
1x 0.1uF Ceramic Capacitor (C3)
1x 33uF 10V Electrolytic Capacitor (C2) (Larger values like 100uF are ok, but probably too big physically.)
1x 47uH Axial Inductor (L1) (Pretty much anywhere between 47 to 470uH would work.)
1x BAT85 or SD103 Schottky Diode (D1)
1x 1N5231B 5.1V 500mW Zener Diode (D2)
2x MPS2222A or equivalent NPN BJT (Q1-2)
1x PIC16F1823 or PIC16F1824 (PIC16F1824 has more program memory)
1x Tactile Switch (SW1)
2x Battery Clips

LEDs
LEDs should be of "super bright" variety. Standard LEDs are not bright enough for this circuit. Either 3mm or 5mm sizes can be used, however the PCB is somewhat optimized with 3mm LEDs. 5mm LEDs hang off the edge of the PCB a slight bit.
Make sure to use the same LEDs for all eight of them. (Of course you can experiment mix & matching if you like...)

PCB
PCB layout can be downloaded as PDF, so you can etch your own board if you like. Custom 2 layer PCB and kit are available for sale as well. (Go to theLEDart.com)
* If you make your own PCB, you might want to program the PIC before soldering, as non-plated holes won't function as a pseudo connector for ICSP. You can use IC socket as well.

Step 6: Construction - Assembly

Since it's powered by just one AA battery, I wanted to make Wave JT as small as possible. The width of Wave JT is flush with the AA battery and the holders, so it looks like a little extension to the AA battery itself.
As with my Night Joule Thief, battery holder is incorporated into to the PCB, making it easy to assemble, and convenient to use.

Wave JT uses only through-hole components. If you have done a fair amount of soldering, it will only take an hour or so to assemble. However due to its high density parts placement, it might not be suitable for your first-time soldering project, but it's still beginner friendly.

Assembly
The assembly is very straight forward. Insert the parts into the PCB, and solder them. Start with lower profile components and move on to larger, taller ones. Below I'm listing the order of assembly.

  1. R1: 4.7k ohm (yellow-purple-red-gold)
  2. R2: 100k ohm (brown-black-yellow-gold)
  3. R3-10: 39 ohm (orange-white-black-gold)
  4. D1: Schottky Diode (Watch the polarity - align the mark on the PCB)*
  5. D2: Zener Diode (Watch the polarity - align the mark on the PCB)*
  6. L1: 100uH Axial Inductor
  7. PIC1: PIC16F1824 or PIC16F1823 (Watch the orientation - the dot on the IC faces left)
  8. C1: 10pF Ceramic Capacitor
  9. C3: 0.1uF Ceramic Capacitor
  10. Q1-2: MPS2222A or equivalent (NPN BJT)
  11. SW1: Tactile Switch
  12. C2: 33uF Electrolytic Capacitor (Watch the polarity. Stripe on the capacitor marks the negative lead. The positive lead goes into the hole with "+" sign.)
  13. LED1-8: LED (Watch the polarity. Match the shape to the silk screened shape.)
  14. Two Battery Clips

*D1 and D2 look very similar. Be careful not to mix them up.

Transistors, diodes, electrolytic capacitor and LEDs have polarities, so make sure to insert them in the correct orientation. Battery holders need a bit of force to snap into the holes. They attach from the back side of PCB as you can see in the picture.

Once everything is soldered in place, double check the part placement, orientation and solder joints for shorts and bad (cold) connections.

Step 7: Programming the Microcontroller (PIC)

Now it's time to program the microcontroller. Due to the tight space, the 5 pin ICSP programing connector is located on the backside of the PCB. Insert a 5 pin header's longer side into a PICKit 2 or 3, or connect it to another programmer. Then insert the short end of the 5 pins into the holes on the back of the PCB - marked ICSP. Make sure that the MCLR pin goes into the hole with a triangle mark. PICKit has a same marking to indicate the MCLR pin.

Download the HEX file provided, fire up Microchip IDE or PICKit software, and program the PIC.
*Since the battery is not connected, you need to supply the power from the programmer. You can find this in the "Options" menu.
Refer to the screen shots - I recommend setting the Vdd to 4.9V, just to be sure not to let the zener diode shunt too much current. (I never had any problems using 5V so for, but better safe than sorry.)

*** UPDATE ***
The assembler source file (wave_jt-1.1.asm.zip) is uploaded. Now you can modify the firmware to modify and/or add new functions!

Step 8: Turning It On

Now after checking and double checking to make sure there are no errors in the assembly, insert a battery and push the button switch.
The unit should turn on and LEDs should start animating. A single "tap" of the button changes the animation to the next pattern. A "double" tap increases the animation speed. A "triple" tap decreases the animation speed. Finally, holding the button down for a second will turn off the power.

There are so many animation patterns to flip though (17 patterns in FW version 1.0), I created a "quick select" mode. Then you turn on the unit, hold down the button for a second. The LEDs will start lighting up one by one, from left to right. Each LED corresponds to the number 1 to 8, when you let go of the button, you are selecting that animation pattern. So you can choose the from the first eight patterns very quickly at the power up. 9th pattern and over will have to be chosen by single taping the button afterwords.

If you just "tap" the button to power up the unit, Wave JT will play the last animation pattern that it was on.

That's it for the operation. Pick your favorite animation pattern, change the speed to your liking. And enjoy!

Step 9: Performance

This little LED chaser performs very well. It's surprisingly bright for using just one AA battery.
Current drawn from the battery is somewhere between 10 to 70 mA, depending on how many LEDs are lit and at what brightness. I think it averages around 40 - 50 mA, which means a fresh cell should last at least 40 hours!

Wave JT works with battery voltage down to 0.6V (although the LEDs will be very dim). Start up requires 0.8V (0.78V actual test). In most cases "spent" or "exhausted" batteries still has 1V or so, which means there is plenty of juice left to enjoy Wave JT. It's like getting something for free when you are able to reuse those otherwise useless batteries.

Wave JT also works very well with rechargeable NiMH and NiCd batteries.

Kit & PCB

Wave JT kits and PCBs are available for purchase.

Please go to: https://www.theledart.com/products/wave-jt-kit

LED Contest with Elemental LED

Runner Up in the
LED Contest with Elemental LED

Green Tech Contest

Participated in the
Green Tech Contest