FIGURE 7. Fan with
PWM controller.
fans with the boost feature.
The latest version combines both features into a single
device. There is a setup routine that sets the controller to
fan or light mode. If you hold down the “increase” button
during power-up, the controller is put into light mode. If
you hold down the “decrease” button while turning on the
power, the controller is put in fan mode. This setting is
saved in EEPROM. Since I use these PWM controllers as
parts of other projects, I only need one version now that I
can easily switch back and forth, depending on what I am
working on.
With the appropriate hardware, this code can be
adapted to a variety of uses. When driving a robot, for
example, you can gradually ramp up the duty value in a
loop so that the wheels don’t spin from the sudden full-on
activation. If you use it to control lights, you could gradually
turn them on and off.
When you look at the C code, you’ll see statements
bracketed by #ifdef DEBUG and #endif statements. The
serial output and heartbeat LED statements are enclosed in
these so they can be disabled easily in the release version.
Finished
Once I knew the circuit would work, I sent the Gerber
files to Silver Circuits for manufacturing the boards. I
refined the software while I waited for the boards to come
back. The board has a position labeled J1 which is where
the incoming power is connected if you are not including a
switch in the design. If you are including the switch,
external connector J2 is connected to the pads marked
“IN.” Power to the load — via external connector J3 — is
connected to the pads labeled “OUT.” The square pads are
positive. Please note the circuit was primarily designed for
controlling low voltage lights and brushless computer fans.
There is not any built-in
protection against transients or
surges coming in from the load.
Figure 7 shows the
controller attached to the side
of a pair of fans. I can now
easily adjust the speed on these
from “Hurricane” to “Mild
Breeze.” Figure 8 shows the
controller integrated into my
under-the-shelf LED light bar.
This photo only shows the first
three of the eight LEDs that are
Figure 8. Workbench light
with PWM dimmer.
58 SERVO 06.2010