So, how do we fix the program
so that the alarm doesn’t sound
unnecessarily? For the time being, I’m
going to take the easy way out, but I
promise I’ll correct that before we’re
done with our temperature-measurement projects. (Really, I do!)
Since it doesn’t matter to me if the
freezer temperature is a couple of
degrees below 0º F, I’ll just assign a
value of 0 to temp whenever a
“wrap-around” occurs. Adding the
bolded if/then statement shown
below accomplishes that, and will
keep the alarm from sounding
whenever the freezer temperature
drops below 0º F:

Once I had resolved my little
freezer alarm problem, I was eager to
begin development on another one
of my projects: a temperature sensor
for my cold smoker. If you’re not
familiar with cold smoking, a Google
search will provide lots of relevant
information. Essentially, it involves
smoking various food items at
temperatures well below 100º F, so
the DS18B20 is more than adequate
for the task, and there’s no risk of
exceeding its maximum temperature
of +257º F. (Another assumption?)

However, my only LED-2x7
board was busy monitoring the
freezer, and I wanted to keep it there.
At first I thought I would just build
another LED-2x7 board, but then I
realized that I have a couple of other
projects that would also benefit from
a two-digit LED display. If you’ve
already built an LED-2x7 board, you
know that it takes a fair amount of
time to complete and I was in a hurry
to get started on the next project, so
I decided to see if I could simplify
the circuitry a bit by eliminating the
20M2 processor, and redesigning the
board so that it could be directly
inserted into any 20M2 breadboard
circuit. That way — in the immediate
future — I only need one additional
stripboard circuit which I can move
from project to project as necessary.
Then, when I complete a project I
can construct a custom stripboard for
it with whatever additional circuitry
may be required (e.g., a power
supply).

■ FIGURE 1. LED-2x7v2 schematic.

project, the most important change is
that the port B pins are all connected
to LED 1 (the ten’s digit), and the
port C pins are all connected to LED
2 (the one’s digit). As a result, each
LED digit pattern can be stored in
one eight-digit value, rather than the
16 bits that the original LED-2x7
project required. As we’ll soon see,
that’s what simplifies the software.

Figure 2 presents the stripboard
layout for the LED-2x7v2 board; a
larger version is available for
downloading at the article link. (The
pins of the 19-pin male header aren’t
visible in the layout because I
couldn’t find a way to get
LochMaster — the software I use to
design stripboards — to let me draw
anything beyond the outline of the
board.) It’s an easy board to
construct, so I won’t go into the
details. However, I will mention a
couple of points.