May 2017 63
you should measure 1.500 volts. Just
remember to subtract the 0.500V
offset if you calculate a temperature
from the sensor’s voltage output.
Don’t worry about the exact voltage.
The sensor has a typical tolerance of
To turn on an alarm when
temperature increases beyond a
specific point, an analog comparator
does the job. The LM393 offers
a good example. You get two
comparators in an eight-pin dual
inline package (DIP) but use only one
for the fridge monitor. The second
comparator stays unconnected. The
LM393 has two inputs — Vplus (pin 3)
and Vminus (pin 2) — and one output
(pin 1). The IC takes power at pin 8
and connects to ground with pin 4.
When Vplus > Vminus, the output
becomes a logic 1. When Vplus <
Vminus, the output switches to a logic
0; basically, a connection to ground.
This latter condition acts like a switch
to ground and it lets the comparator
control a small piezoelectric buzzer
connected between the power supply
and the comparator output. (Or,
you could use an LED as a visual
To use the comparator, connect
the Vminus input to the LM36 sensor
output. Connect the Vplus input to
a variable resistor; 10K ohms will
work well. This resistor lets you set
the “trip” voltage between ground
and the power supply voltage. Adjust
the resistor to the point where the
buzzer just turns on or just turns off.
Then, make a slight adjustment in the
direction that turns the buzzer off.
This change gives the comparator a
reference voltage at the comparator’s
Vplus input. When the sensor voltage
exceeds this “set point” voltage, the
buzzer turns on.
PUI Audio and Mallory Sonalert
manufacture loud piezoelectric
buzzers. Choose one in your hearing
range. AQll Electronics has a loud
siren (ES- 25) that operates from 6V
and will alert everyone in your house
to the open fridge door! You can
create a circuit on a piece of solder
breadboard. Try the SB300 solderable
PC breadboard available via Amazon.
For power, use four D dry cells. A
diode in the circuit drops the voltage
from six to about 5. 3 volts. That’s
within the range of recommended
voltages for the LM36 sensor.
[#12163 - December 2016]
Hit By A Speeding Card
My Raspberry Pi Model III uses a
microSD card. The cards are available
in different “speeds.” Is there any
significance to how “fast” a card I get?
The answer isn’t really clear cut.
Class- 10 SD cards are rated on
the basis of streaming a single file
to a clean (recently formatted) card.
Essentially, what would happen with a
Class-2/4/6 SD cards are rated
on multiple small files written to a
fragmented card. Still image cameras
where one has erased a few images.
One would hope that a Class- 10
used for multiple small files would not
be slower than a Class- 6 card, but this
is not always the case — especially
when used with a journaling file
system (the ratings are based on
FAT) where for single file writes one
basically has the data file and the
File Allocation Table; journaling file
systems — especially for something
like EXT3 or EXT4 (common for Linux
OS) — will have things like the data
file, inodes, journals, and bitmaps.
Flash memory needs to be erased
to all “1s” before it can be written;
writes can only convert a “1” to a
“0” but not the other way around.
Erasure is done in large chunks. When
doing small writes, the card allocates
a cleaned chunk. Then, if needed,
copies previously written data to that
chunk before adding the new data.
Higher quality cards have the
ability to “hold” multiple allocations
“open” at the same time. These cards
will function better on a journaling
file system than a card that only
holds two open allocations at a time
(which is all the Class- 10 streaming
model requires). Everytime a “two
allocation” card changes files, it has
to close/flush any data changes to the
card, then prepare a new “allocation”
if changes are expected for the next
file to be opened.
For FAT file systems, that means
just closing the data chunk and
opening another. For EXT3, that could
mean closing a data chunk, opening
an inode chunk and updating it, then
closing it to open the next file chunk.
Cards supporting six open allocations
can minimize the number of times
they have to perform the flush/close
operation. They can flush a data
chunk while still holding the inode/
bitmap chunks active.
This may not be a concern if the
device (RPI, Beaglebone Black) is
used in an embedded mode, where
the only data being written is a log
file from some running application.
If the device is being used as an
interactive computer where one is
compiling files, building applications,
etc., a high end Class 6 card may be
better suited than a low end Class
10 — even if Class 10 implies nearly
twice the transfer rate of Class 6. The
RPI “NOOBS” OS starts out on a FAT
system (it allows one to use native
Windows to create a new card), but I
believe the first step it performs is to
repartition the card with an EXT3 file
system, and copy the running OS into
that partition. The Beaglebone Black
OS images are currently EXT3 — and
need special tools to create a card
>>>YOUR ELECTRONICS QUESTIONS ANSWERED HERE BY N&V READERS
Send all questions and answers by email to email@example.com
or via the online form at www.nutsvolts.com/tech-forum