This is only a preview of the January 2021 issue of Silicon Chip. You can view 42 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "AM/FM/SW Single-Chip Digital Radio":
Items relevant to "MiniHeart: A Miniature Heartbeat Simulator":
Items relevant to "The Bass Block Subwoofer":
Items relevant to "Busy Loo Indicator":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
For those times when
you DON’T want to
be interrupted . . .
I’m
busy.
Go
away!
OK, it’s a bit tongue-in-cheek . . . but it could have other, more serious,
uses. The Busy Dunny Door Warning flashes a bright LED light on the
door when you, ahem, don’t want someone barging in. When you leave
and open the door the light goes out! It’s a simple idea with a real simple
circuit – but it makes a superb beginner’s project . . .
T
he idea for this little project
came about when avid SILICON
CHIP reader John Chappell was
sitting, reading his latest copy . . . and
the dunny door burst open, with obvious embarrasement all around.
So maybe he had taken a bit longer than normal; maybe he was so engrossed in the magazine that he didn’t
hear anyone yelling out . . . but it started him thinking how to avoid the delicate situation in the future.
One problem was that the door lock,
umm, didn’t.
So without replacing the lock, how
78
Silicon Chip
to let others know that the best seat in
the house was, umm, occupied – without the embarrasement!
Light bulb LED moment
Of course, that was the answer: a
bright, flashing LED that would let
others know not to barge in.
If it was made somewhat automatic
– ie, it turned off when the outhouse
door opened to let him out, so much
the better. And this really simple circuit is the outcome.
Original by John Chappell
Australia’s electronics magazine
When the pushbutton (S1) is
pressed, both the LED mounted on
the door and the internal LED start
flashing.
Why two LEDs? One is the ultrabright warning LED mounted on
(or through) the dunny door to warn
others that it is occupied. The second
(internal) LED merely confirms that
the circuit is operating.
Overkill? Perhaps - but at the cost of
a 10c LED and a 5c resistor, it doesn’t
add much cost to the project.
When the dunny door is opened, a
magnetic reed switch resets the cirsiliconchip.com.au
You’re looking at the entire
project! On the left is a reed switch and magnet
which turn the LED off when the door is opened. At right
is the door-mounted ultrabright LED, while the internal LED in
this case is integrated with the pushbutton “start” switch
cuit and the LEDs turn off. It really is
that simple!
As we said earlier, it makes a great
beginner’s project. Parts are as cheap
as chips; it’s battery operated (and
the battery will last for yonks) and it
doesn’t use any of those pesky surfacemount devices that beginners have so
much difficulty soldering.
Total assembly time shouldn’t be
much more than an hour.
The circuit
It’s shown in Fig.1 – and as you can
see, there’s not much to it!
It’s based on a 4093B CMOS quad
2-input Schmitt trigger NAND gate
chip (IC1). Now if all those words
scare you, don’t worry: see the panel
“What is a NAND gate?” and all will
be revealed.
The four NAND gates are configured
in different ways.
IC1a is an inverter: when its inputs
are low, the output is high (and vice
versa).
With the door closed, the magnet
pulls the “normally open” reed switch
closed, which in turn means IC1a’s
inputs are both low – so the output
is high.
IC1b and IC1d form a latch with the
inputs to IC1d normally high. Think
of a latch just like a door latch: it’s
normally at rest but needs someone
to actuate it.
In this case, when the push button
siliconchip.com.au
(“Start”) switch is pressed, the latch
is reset by forcing pin 12 of IC1d low
which forces the output, pin 11, high.
This also enables IC1c, with its 47kΩ
resistor and 10µF capacitor, to start
oscillating, with its output going high
and low at a rate set set by the time it
takes the tantalum capacitor to charge
and discharge – in this case the rate is
about one second.
As it goes low, the two LEDs connected in series between its pin 10
output and +9V become forward biased and therefore light up.
Incidentally, you can change the
flash rate by changing the resistor and/
or capacitor. Increasing either (or both)
will slow the rate down and, as you
would expect, decreasing will speed
the rate up.
When the door is opened, the reed
switch opens (when the magnet moves
away), IC1a inputs go positive because
of the 100k resistor connected to
9V and the circuit reverts to its dormant state.
Power
The circuit is powered by a single 9V
battery which, due to the intermittent
drain, should last for almost as long as
its shelf life. For the same reason, no
on/off switch is provided or needed.
(Of course, if you decide to read War
and Peace during your “visits” you
might not get quite that life).
l
l
Fig.1: the circuit consists of
one quad Schmitt NAND gate,
designed to flash an ultrabright
LED mounted on the door. It
is actuated by S1, the “Start”
switch and automatically turned
off when the door is opened.
Australia’s electronics magazine
January 2021 79
Fig.2: the PCB component
overlay will help you
place the components in
the right positions. Watch
the polarity of IC1, the
diode and LED and both
of the capacitors. This
PCB is different from
the photo at right in that
it has “extensions” on it
to allow it to snap into
place in the Jiffy box.
These can be cut off if
not needed.
The battery snap leads can connect
to a header set, or feed under the board
and up through the hole at bottom left
before soldering to their respective
pads from the board top. This gives
some strain relief to prevent the rather
thin leads breaking off.
A 1N4004 silicon diode is included
in series with the battery to prevent
damage if you try to connect the battery
back-to-front (surprisingly easy to do!)
A single 10µF capacitor bypasses (or
filters) the 9V supply. While a tantalum capacitor is specified in the parts
list, you will probably note from the
photos that a standard 10µF 16V electrolytic was used. Either is fine – but
the other 10µF capacitor (on pin8 of
IC1c) should be a tantalum.
Construction
There are only ten components to
solder to the PCB and only five of these
are polarised: the 4093B IC, of course,
the on-board LED, the 1N4004 diode
and the two capacitors. Fit the resistors first – as well as reading the colour
codes in the parts list, use your multimeter to confirm their value.
In the case of the tantalum capaci-
The PCB photo is
reproduced larger than
life size. It is of an early
prototype and there are
some differences between
the overlay and this board
– for example, S1 and
LED1 are both housed in
the same bezel (you can
use this type or a separate
LED and switch). Also
in this case, the battery
connector is “hard wired”
to pads on the board and
using the hole at lower left
for strain relief.
tors, the + marked on their body goes
to the + mark on the PCB. (“Ordinary”
electros have the – leg marked; this of
course goes to the – mark on the PCB).
Similarly, make sure the stripe on
the diode aligns with the stripe on the
PCB. Finally, note the notch on the end
of the quad gate IC: it goes closest to
the right edge of the board.
The anode of the internal LED is the
longer of the two leads – again, it goes
to the “A” marked on the PCB.
S1, the “start” switch, should be soldered direct to the PCB.
The reed switch and external LED
both connect via thin insulated wires
to their respective screw terminals on
the PCB (reed switch to CON1; LED
to CON2). Watch the LED polarity –
make sure the anode connects to the
A marking on CON2.
Before drilling the case and mounting the completed PCB, connect the 9V
battery and check operation. Hold the
door magnet close to the reed switch,
then press S1. Both LEDs should start
flashing; move the magnet away from
the reed switch and they should stop
flashing.
If none of this happens, check your
The battery snap wires
are quite thin, so they go
through a strain-relief hole
in the PCB before soldering
to their respective pads.
As mentioned in the text,
the capacitor at lower
right is specified in the
parts list as tantalum but
here, a standard electro
is adequate. The other
capacitor (the yellow
component) should be
tantalum due to their lower
leakage.
80
Silicon Chip
Australia’s electronics magazine
component placement, orientation
and soldering. With so few components, there is very little else that
could go wrong. If all else fails, measure the battery voltage when the circuit should be on. It should be at or
very close to 9V.
Mounting the PCB
The board sits upside-down in the
Parts List –
Dunny Busy Warning
1 PCB, 38.5 x 49mm; code 16112201
1 UB5 Jiffy case, 83 x 54 x 31mm
[eg, Jaycar HB6025]
1 reed switch set (reed switch &
magnet - often sold for alarm
systems – eg, Jaycar LA5027)
1 small momentary contact
pushbutton switch (S1) #
2 mini PCB mount connectors
1 4093 quad Schmitt NAND gate (IC1)
1 1N4004 diode (D1)
1 ultrabright red LED [eg, Jaycar
ZD0102]
1 standard red LED #
Suitable mounting for internal and
external LED
1 9V battery snap
1 9V battery
Capacitors
2 10µF 16V tantalum
Resistors (0.25W, 1%)
2 100kW (brown black yellow brown)
1 47kW (orange violet orange brown)
1 1kW
(brown black red brown)
# we used a pushbutton switch with
an integrated LED; provision is made
on the PCB for this or for separate
switch and LED.
siliconchip.com.au
Fig.2: the PCB mounts
upside-down in the
case, held in place
by the notches in the
case edge. The
component at left (on
the red/black wires)
is the ultrabright LED
which mounts on the
door.
jiffy box – the board is designed to
snap into the captive guides on the
box sides. You’ll need to drill holes
in the bottom of the case (which becomes the top!) for “start” switch (and
internal LED).
If the start switch is soldered directly to the PCB, you need to be quite accurate with the hole placement.
Another hole is needed in the top of
the case (which becomes the bottom!)
for the wires to go off to the reed switch
and to the door LED.
Mounting the door hardware
The exact location of the warning
LED is entirely up to you – whatever
gives the best visibility.
That might be actually through the
door . . . or it could be on the door
jamb. A wide variety of LED bezels is
available, some of which are designed
to work through a door or jamb.
Or you might simply glue the flat
base of an ultrabright LED to the outside of the door, with a couple of fine
holes for its leads/wires.
The reed switch and its magnet need
to be placed so that when the door is
closed, the magnet comes very close
to the reed switch (without hitting
it!). It’s probably best to have the reed
switch on the door jamb and the magnet on the door.
What is a NAND gate?
There are handy reed switch sets
which come in plastic holders with
screw holes, intended for alarm systems (eg, Jaycar LA5027). There are
others which are intended for completely concealed mounting – the reed
is recessed into the jamb and the magnet mounts inside the door. (eg Jaycar
LA5075).
Using it
That is simplicity itself!
When you go into the dunny, you
press the momentary action (ie, normally open) “Start” switch (S1). This
starts both LEDs flashing (the internal
LED to assure you that you don’t have
a flat battery).
It stays that way until you open the
door to leave. As the magnet moves
away from the reed switch (S2) it
opens, turning off the circuit, ready
for the next occupant.
The “automatic” reed switch turnoff
is included because of the high likelihood that someone will forget to manually turn it off, resulting in a queue
at the door of an unoccupied dunny!
We could have made it fully automatic (ie, LEDs start flashing as soon
as you entered) but deemed the extra
complication not worthwhile. But for
experimenters, it wouldn’t be hard
SC
to do.
Two types of reed switch, both suitable for this
application. The type at left (Jaycar LA5072) is
designed for surface mounting (hence the mounting
holes) while the type above (Jaycar LA5075) is fully
concealed, mounting in holes drilled in a wooden door
(or window) frame. There are two halves – the reed switch
itself (on the right in both cases) and the actuating magnet. The
switch is normally open, closing when the magnet is brought into close proximity.
siliconchip.com.au
Inside the 4093B chip there are four
identical gates, each one operating
completely independently of the others
(but with a single power supply). That’s
why it’s called a “quad”.
First, we’ll look at an AND gate. Think
of a gate as you would a gate in a fence.
It can be either open or closed. With two
gates, BOTH have to be in the same state,
open or closed, to have any effect. With
an AND gate, if both inputs are high, the
output will be high. If either is low, the
output will be low. That’s why it’s called
an AND gate.
But the 4093 has extra circuitry in
each gate which “inverts” the output.
So instead of both inputs going “high”
resulting in a “high” at the output, both
inputs going high result in a “low” at
the output (and vice versa). This makes
it a NAND gate, an abbreviation for NOT
AND. The little circle at the gate output
tells you that it is a NAND gate (an AND
gate won’t have the circle).
Australia’s electronics magazine
Before we leave the AND/NAND gate,
you’ll often see another type of simple
gate, the OR/NOR. With this gate, as its
name implies, either input – one OR the
other – can be high to bring the output
high.
But if it’s a NOR gate, as distinct from
an OR gate, the output will be inverted
(just like the difference between NAND
and AND gates).
Finally, where does the “Schmitt Trigger” part come from?
In most gates, the transition between
the high and low states is fairly wide – it
needs to be below a certain voltage to
be low (close to 0V) and above a certain
voltage to be high (much closer to the
supply voltage). Voltages between the
low and high states are not defined.
However, this is often undesirable,
so circuitry is included inside the gate
which makes the transition from low to
high or high to low much more defined
due to hysteresis. This is called a Schmitt
Trigger.
January 2021 81
|