posted Oct 28th 2011 10:01am by
Mike Nathan
filed under:
led hacks,
Microcontrollers

Our own [Mike Szczys] recently sat down and put together a great tutorial on building a Larson Scanner. The ubiquitous circuit is usually one of the first few projects on a budding hackers list of things to build, since they are just so darn fun.
Simple versions of the scanner sweep back and forth lighting the LEDs without any sort of transition between them. The configuration most familiar to us all as featured in Knight Rider and Battlestar Galactica are a bit more complex, and have a fading trail of light that follows behind the leading edge of the sweep. [Mike] notes that this fading is traditionally accomplished through the use of capacitors, which cause the light to gradually fade as the animation sweeps across the LED array. He decided to take a different route with his circuit, relying on PWM control of the LEDs instead.
Mike put together a simple circuit using an ATmega168, a handful of resistors, and of course, an array of LEDs. Utilizing interrupts and PWM, he was able to accurately recreate the iconic light sweep without the use of any capacitors. One big benefit to his design aside from the lower component count is the fact that he can easily adjust the speed of the sweep as well as the fading properties with a few small code tweaks.
Be sure to check out his blog at some point, where he shares his code, some circuit diagrams, and plenty more details on how his scanner was built. In the meantime, take a look at the video below to see the result of [Mike’s] work.
Read the rest of this entry »
posted Aug 15th 2011 11:06am by
Mike Nathan
filed under:
pcs hacks

[hedgehoginventions] wrote in to share a little modification he made to his video card in order to keep it from overheating during strenuous 3D tasks. Having swapped out the stock cooler on his Nvidia 9600GT graphics card, he found that it did not need to utilize the fan while doing mundane things like checking email, but that it still required extra air flow while playing games.
He figured he get the fan to shut off by tweaking the PWM signal, but he found that he could not get the duty cycle under 20% using software, which still caused the fan to run at all times. The circuit he built takes the PWM signal output by the card, cleaning it up before converting it to a corresponding DC voltage. The fan then runs at the same speed it would if driven directly by the PWM signal, though it can now turn off completely when not required.
It’s a nice way to do automatic fan control when you can’t otherwise get your GPU fan to shut off. Nice work!
posted Aug 10th 2011 6:06am by
Mike Nathan
filed under:
arduino hacks,
tool hacks

If you are planning on creating some sort of Nixie tube display, you will undoubtedly need to find yourself a high voltage DC power supply. If you don’t want to add a transformer to your project, you can always opt to build a boost converter instead. [Andrew Moser] shows us just how easy it is to build one, discussing the theory behind simple boost converters along the way.
Boost converters are often driven by dedicated ICs, but in this case the PWM signal from an Arduino does the job just fine. [Andrew] covers the process of choosing the proper components for the circuit, discussing duty cycles and components to avoid lest your boost converter die an untimely death.
He shows us how to implement a feedback system to get a more precise output voltage, but as Lady Ada has shown us, an open loop works pretty well too.
For the beginners that want to just get things up and running, his instructions and code should be sufficient, but [Andrew] provides plenty of reference links for those looking to delve deeper into the subject.
posted Jul 26th 2011 6:01am by
Mike Szczys
filed under:
arduino hacks,
led hacks

Community collaboration is a great thing. Take the Arduino PWM library for shift registers. Some folks at the Arduino forum pitched in and helped [Elco] trim off a bunch of clock cycles by using the Rotate Over Carry instruction. Now he’s reduced the overhead per shift-register from 108 down to just 43. So far this doesn’t mean more possible outputs – 768 is still quite a lot – but does it means better precision when max outputs are used. This effectively doubles the brightness levels for 768 LEDs from 16 up to 32.
We’re at a loss for what to link to here. [Elco] has a new page for the library. There’s the original forums thread but we didn’t see much of interest there. We found some stuff in the comments of this Reddit post. And of course, if you have no idea what we’re talking about go back and read the original feature.
posted Jul 22nd 2011 1:30pm by
Mike Szczys
filed under:
Microcontrollers

Pulse Width Modulation is definitely the preferred method of dimming an LED with a microcontroller, but we were interested in hearing about a different method called Binary Code Modulation. BCM does the same thing as PWM, it turns the LED on and off very rapidly so that your eye cannot detect a flicker. The brightness level is a result of the average amount of time the LED is on versus when it is off. This is called duty cycle and although it can be the same percentage for both PWM and BCD, there is a fundamental difference.
While PWM usually uses a cyclical on/off cycle (30% on, 70% off, repeat) BCD uses a cumulative cycle. As you can see above, each successive bit of binary code carries double significance compared to the previous bit. Now just assign a duty cycle based on your precision, and have an interrupt fire for each bit of the counter. The graph above shows some highs and some lows combining to reach the target duty cycle. An interrupt is used for each bit, and pin changes are made in the service routine.
The benefit of this system is that it is scaleable without adding overhead. You’re already running the interrupts so servicing 8 or 128 LEDs doesn’t have vastly different needs as it would with PWM. The big downside is that the more bits of precision you use, the faster your processor must run so that the eye doesn’t detect the lengthy on or off cycles of the higher bits as visible flickering.
Thank you [Yetihehe] for tipping us off about a link that [Tomas Martinsen] left when commenting about an Arduino library for up to 768 PWM outputs.
posted Jul 20th 2011 8:01am by
Mike Szczys
filed under:
arduino hacks,
led hacks

Here’s an Arduino library that will let you drive a very large number of LEDs. [Elco Jacobs], an electrical engineering student, is the author of the library. He has a work-study job that has him helping out others with their electrical projects and he was constantly being solicited for methods to control droves of light emitting diodes. This was the motivation that led him to produce the dazzling 16 RGB LED example seen in the video after the break.
His setup doesn’t use expensive LED drivers, but instead utilizes 595 shift registers which are both common and cheap. He calculates that it is possible to control up to 96 of these shift registers, each driving 8 LEDs, with reasonably satisfying results. This is thanks to his well-optimized code that manages to drive the clock pin of the registers at 1.33 MHz. This optimization is done by writing each command in assembly, which allows him to precisely count the cycles. Each individual pin takes 12-13 cycles to address, totally 9984 cycles at worst when addressing the maximum number of outputs.
[Elco] thinks this is as fast as he can make the routine run, but he is asking for help with testing. If you think you know how to squeeze out a few more cycles, make sure you join in on his forum thread.
Read the rest of this entry »
posted Jun 26th 2011 1:09pm by
Mike Szczys
filed under:
Microcontrollers

Those following the ProtoStack tutorials will be happy to hear that there is a new installment which explains Pulse Width Modulation. If you’ve never heard of PWM before, it’s a method of generating a signal that is logic 1 for a portion of the time and logic 0 for the remainder of the time. It is the most commonly used method for dimming an LED, and that’s [Daniel's] example in this tutorial. But you’ll also find it used in many other applications such as servo motor control and piezo speaker control.
[Daniel] starts off with a brief explanation of duty cycle, then moves on to some examples of hardware and software PWM. Many of the AVR microcontrollers have a hardware PWM feature that allows you to configure a pin that toggles based on a target timer value. This is demonstrated using an ATmega168, but a method of using interrupts and your own code is also covered in case you don’t have a hardware PWM pin available.
posted May 17th 2011 3:01pm by
Mike Nathan
filed under:
led hacks

[Evan] is one of those neighbors you only wish you had.
His neighbors were renovating their basement for use as home theater, and he stopped by to check out how things were coming along. While there, he suggested they add some LED lighting to their shelving unit to make them pop. His neighbors were game, so he sourced some cheap RGB LEDs online and began working on the circuits and firmware needed to control the lights. His neighbors wrote some custom software that interfaces with iTunes to create a neat visualization in the shelving unit whenever music is played.
Once everything was complete, his neighbors informed him that they wanted an additional 20 overhead can lights and a set of 4 wall sconces wired up as well. Needless to say he was pretty excited, so he got busy wiring up the remainder of the basement.
He pushed the installation’s PIC microcontroller about as far as he possibly could, resulting in the awesome show seen in the video below.
Needless to say, it’s pretty impressive, though we wish we could have a peek at the code used to run everything. Wink, wink, nudge, nudge.
Read the rest of this entry »