// Set pin to Vcc
else // turn it off
// Set pin to ground
This results in the fanPin being set either high (+ 5)
or low (GND). As you can well imagine, the Arduino
isn’t able to supply much + 5 volt current to actually run
a fan. You have to use this pin to signal an external
device — some sort of transistor and/or relay
arrangement that turns the fan on and off. Since the fan
is almost certainly being powered by mains AC current,
you must really know what you are doing to accomplish
that step without killing somebody or burning down
your castle. My first recommendation is to thoroughly
test your system by turning an LED (a fan substitute) on
and off to verify that it is all working properly.
As of this moment, that’s all I’ve got on operating
the fan. Next month — assuming everything is working
properly — we should have the system fully hooked up
and tested. Then, we’ll return to the dangerous stuff. In
the meantime, wouldn’t it be useful to record all this
data we are collecting on the temperature and the
humidity, and when we are turning the fan on and off?
■ FIGURE 5: Arduino alarm clock.
Well, first we will want to know the ‘when’ part by
teaching our fresh air controller how to tell time.
■ FIGURE 6: Fresh air
controller board with
Teaching It to Tell Time
Fortunately, we just recently went through a bunch of
Workshops where we learned a lot about how to keep
dates and time on a computer. This began with the
January 2013 Workshop where we started looking at how
to use the Arduino proto shield to design and build an
alarm clock. We then continued through the April
Workshop. You can find excerpts of these on my articles
repository at blog.smileymicros.com. You can also
purchase the associated Arduino proto shield and/or the
proto shield alarm clock kit from the Nuts & Volts
For this section, I will assume you’ve already reviewed
that material and can refer back to it if you have
So, Where Do We Put the Clock?
Good question. The fresh air controller pretty much
fills out the Arduino proto shield, so where do we put it?
Well, remember those stacking headers? Right! We will
stack them. Figure 5 shows the alarm clock circuit built on
a proto shield PCB (printed circuit board).
For the fresh air controller board, you’ll need to add
connectors for the DHT22 temperature and humidity
October 2013 65