This is only a preview of the September 1991 issue of Silicon Chip. You can view 44 of the 96 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:
Articles in this series:
Articles in this series:
Articles in this series:
|
-•
TIMEOUT
ULTRASONIC APPLIANCE MINDER
Ultrasonic switch
for mains appliances
Are you one of those people who goes to sleep
while watching TV or who inadvertently
leaves mains appliances on? This project
monitors an area using ultrasonic sensors & if
no movement is detected for a preset period, it
switches the controlled appliance off.
By JEFF MONEGAL
Switching a lamp off after the baby
has falle n asleep is just one of the
many uses for this proj ect Other possible uses include automatically
switching off outdoor lights along a
path, or turning off an iron, a radiator
or a desklamp.
And why leave the TV going while
you drift off into slumberland? After
all, the life of a TV tube depends on
the hours of use. This project can
automatically switch your TV off if
you pass out on the couch or if the
kids lose interest and abandon the
set.
70
SILICO N CH IP
To op erate the project, you simply
plug it into the mains , plug the appliance to be controlled into the mains
socket mounted on one end of the
case, and press the ON/ OFF button.
The green STANDBY LED now goes off,
the appliance turns on and the red
MOVE LED flash es each time movement is detected.
The movement detector used h ere
is a proven design but instead of triggering an alarm system , it simply resets a timer. If this timer is reset before its time limit expires , the controlled appliance remains on. However,
if no movement occurs for a preset
time , then the detector will not reset
the timer and the applianc e turns off.
The time for which no movement
can occur before the appliance is turned off is set during construction and
can be anywhere in the range from 230 minutes. Once the controlled appliance has been turned off, it can
only be turned on again by pressing
the ON/OFF button. Repeated pressings
of the ON/OFF switch simply toggle
the appliance between on and off.
A small warning lamp on the front
panel flashes just before the time-out
expires. This is useful for those times
when no movement has occurred in
front of the TV (eg, during a gripping
susp_ense movie) and you want the
TV to remain on. Alternatively, the
lamp can be replaced with a buzzer so
that you get an audible indication that
the time-out period is about to expire.
How it works
Refer now to Fig.1 which shows the
circuit details of the Ultrasonic Ap pliance Minder. It can be roughly split
into four sections: an ultrasonic receiver (ICl, ICZ & IC3a); an ultrasonic
transmitter (IC3d, IC3e & IC3f); a timer
circuit & relay driver (IC4, IC5, Q3Q5, etc); and a power supply (Tl, D8D12, REGl) .
Ultrasonic waves generated by the
transmitter bounce around the room
and eventually find their way back to
the receiving transducer. Its output is
fed to ICla which is connected as a
variable gain amplifier due to the presence of trimpot VRl in the feedback
loop.
The non-inverting input of ICla is
biased to half supply (½Vee) by two
lO0kQ resistors, while the associated
lOµF capacitor provides decoupling.
This sets the outpl!lt at pin 1 to half
supply when no signal is applied, so
that we get maximum signal swing in
both the positive and negative directions. VRl varies the gain ofICla from
about 13.5 (at maximum resistance)
to about 4.5.
Following ICla, the amplified signal is coupled to inverting amplifier
stage IClb. This stage has a gain of 39,
thus giving the total maximum gain of
approximately 500. From there, the
signal is applied to a level detector
circuit consisting of Dl, Rl, RZ and
Cl. Cl charges on the positive going
peaks of the amplified signal and discharges at a slower rate through RZ on
the negative signal peaks.
What happens is that a DC paten-
tial is established across Cl. This potential remains steady as long as the
signal picked up by the receiving
transducer is at a steady level. However, if an object disturbs the ultrasonic field, the varying signal levels
reaching the transducer cause the DC
potential across Cl to vary.
These signal variations are coupled
through CZ to pin 2 of IC2 . This stage
operates as a high-gain inverting amplifier with its bias set to about 1V by
the lMQ & 150kQ resistors on the
non-inverting input (pin 3).
If the detected voltage across Cl
rises above this 1V reference, pin 6 of
ICZ swings low, thus turning on Ql
and QZ. The 4.7µF capacitor at the
input ofIC3a now quickly charges via
QZ and its 470Q collector resistor.
Thus, pin 2 of IC3a switches high and
so Q7 turns on and lights the MOVEMENT LED to indicate that movement
has been detected
At the same time , the high on pin 2
of IC3a resets counter stage IC4 via
DZ. When movement ceases, Ql and
QZ switch off and the 4. 7µF capacitor
at the input of IC3a discharges via its
parallel lO0kQ resistor. Pin 2 of IC3a
then switches low again and Q7 and
the MOVEMENT LED turn off.
Refer now to IC5a; this is one half
of a dual 4013 D-type flipflop which
operates in toggle mode due to the
lO0kQ resistor connected between its
Q-bar output and the Data (D) input at
PARTS LIST
1 PC board, code ACT ONE
1 plastic utility case
1 pushbutton switch
1 12V miniature relay with
240VAC 1OA contacts
1 11 VAC mains transformer
1 pair 40kHz ultrasonic
transducers
1 12V miniature lamp or buzzer
1 mains plug and mains cord
1 surface-mount mains socket
1 1OA fuse and fuseholder
1 miniature 40kHz crystal
2 200kQ miniature vertical
trim pots (VR 1,VR2)
4 rubber feet
4 6mm-long standoffs
11 nylon screws & nuts
12 plastic cable ties
Semiconductors
1 TL072 dual op amp (IC1)
1 TL071 op amp (IC2)
1 40106 hex inverter (IC3)
1 4040 binary counter (IC4)
1 4013 dual flipflop (IC5)
1 78L08 8V regulator (REG1)
2 BC558 transistors (Q1 ,03)
3 BC548 transistors (Q2,Q5,Q7)
2 80437 transistor (Q4,Q6)
61N4148 diodes (01-06)
61N4001 diodes (07-12)
1 5mm red LED (LED1)
1 5mm green LED (LED 2)
Capacitors
2 1OOµF 16VW electrolytic
2 22µF 16VW electrolytic
2 1OµF 16VW electrolytic
1 4.7µF 16VW electrolytic
2 1µF 16VW electrolytic
7 0.1 µF monolithic
1 .001 µF ceramic
2 680pF ceramic
1 220pF ceramic
1 1OpF ceramic
1 4.7pF ceramic
1 2.2pF ceramic
Resistors (0.25W, 5%)
21MQ
1 560kQ
1 390kQ
1 270kQ
2 150kQ
13 100kQ
1 47kQ
1 27kQ
4 22kQ
7 1OkQ
3 4. 7kQ
3 1kQ
1 470Q
Miscellaneous
Most of the parts are mounted on a small PC hoard & this in turn is secured to
the lid of the case using nylon screws & washers. The relay is mounted on a
separate outrigger board if mains appliances are to be controlled.
Insulated hookup wire, mainsrated cable, heatshrink tubing .
SEPTEMBER 1991
71
signals then drive the 40kHz transducer for high power operation, or
the transducer can be connected between pin 10 of IC3e and ground for
low power operation.
Power for the project is derived from
the mains via transformer Tl. Its secondary output is applied to bridge
rectifier DB-Dl 1 which then drives an
8V 3-terminal regulator (REG1) via
D12 . D12 is there is isolate the current
pulses drawn by the lamp and relay
from the regulator circuit.
Construction
·{'
The bodies of the two ultrasonic transducers, the pushbutton switch and the
fuseholder are sheathed in heatshrink tubing to provide additional mains
isolation. Mount the fuse lower down than shown here, to clear the PC board.
pin 5. Actually, the two flipflops inside IC5 are connected in parallel but
that doesn't affect the way the circuit
operates. The RC timing circuit on the
D input (pin 5) provides debouncing
for the switch contacts. Each time Sl
is pressed , it pulls the clock (CK) input high and the flipflop toggles.
Assume initially that IC5 is set with
its Q output (pin 1) low and its Q-bar
output high. When Sl is pressed, IC5's
clock input (pin 3) is pulled high and
so the Q output switches high and Qbar goes low. This turns Q5 and the
STANDBY LED off. At the same time,
Q6 turns on and the relay closes to
power the external appliance.
The low on Q-bar (pin 2) now reverse biases D3 and thus pin 11 of IC4
is pulled low by the associated 100kQ
resistor. IC4, a 12-stage binary counter, is now free to count the pulses on
its clock (CK) input from Schmitt trigger oscillator of IC3b.
If movement is detected by the ultrasonic receiver, IC4 is reset by IC3a
and counting starts again. However, if
no movement is detected, IC4 continues to count the clock pulses from
IC3b until eventually its Q12 output
(pin 1) goes high. This reverse biases
D6 , thus enabling Schmitt trigger oscillator IC3c.
IC3c operates with a frequency of
about 1Hz. It drives Q3 which then
drives Q4 to flash the TIMEOUT lamp
72
SILICON CHIP
(or pulse a buzzer). This indicates
that the timing period has almost finished, which means that you must
move (if you are still awake) to prevent the appliance from switching off.
If movement is still not detected,
then a short time later pin 13 of IC4
will also go high. When this happens,
the associated 100kQ resistor (on the
anodes of D4 & D5) pulls the RESET
pin ofIC5 high. IC5 now resets with Q
low and Q-bar high and so the
STANDBY LED turns on and the appliance switches off.
Trimpot VR2 sets the period for
which no movement must be detected
before the appliance switches off. By
using the component values shown,
that time can be varied from about 2
minutes to 30 minutes. If longer or
shorter times are required, it's simply
a matter of changing the value of the
timing capacitor.
Fig.2 shows the parts layout on the
main PC board. Begin construction by
inspecting the PC board for any open
or shorted tracks. When this has been
done, install the two links on the top
of the board but don't install the three
bottom links at this stage.
If you have decided to use IC sockets , now is the time to install them.
This done, install the passive components (resistors and capacitors), then
the diodes and transistors. Check that
all polarised components are correctly
oriented. Fig.1 shows the pinout diagrams for the transistors.
When installing the transistors ,
push them down onto the PC board as
far as they will comfortably go before
soldering their leads. Be sure to use
the correct transistor at each location,
as the circuit uses a mixture ofNPN &
PNP types. Note also that diodes D8D12 are 1N4001 types, while the remaining 'diodes are all 1N4148s.
The remaining components can
now be installed, along with the insulated links on the underside of the
board. Make sure that the ICs are correctly oriented and don't overheat the
crystal, otherwise it could be damaged.
Although there is provision on the
main PC board for the relay, it must be
mounted on a small "outrigger" board
if mains appliances are to be switched
Ultrasonic transmitter
IC3d and IC3e are wired as a standard 2-gate oscillator. This operates at
40kHz due to the 40kHz crystal in the
feedback path. Note that the crystal is
fed from a voltage divider network
(100kQ and 22kQ) to keep the drive
within safe operating limits.
IC3finverts the output from IC3e so
that we get complementary output signals (ie, signals that are 180° out of
phase). These complementary output
Fig.1: the circuit consists of an
ultrasonic receiver (ICl, IC2 & IC3a);
an ultrasonic transmitter (IC3d-f); a
timer circuit & relay driver (IC4, IC5,
Q3-Q5, etc); and a power suppy (Tl,
DB-D12 & REGl). VR2 on IC3b sets the
timing period. If no movement is
detected, QB & Q12 of IC4 eventually
both go high & reset IC5, thus turning
off the appliance.
+BV
!+
luF
10pF
4.7pf
1M
4.7
100k
10k
390k
ULTRASONIC
RECEIVER
10D~
1!220p
R2 ,
47k
Cl
0.1
100k
02
0.1
·sc54B
E
100k
101
.. t
I
D2
1N4148
D3
I~· l
">o• '
T
T
•
)
)
,olcK
as 13
__.
VR2
200k
IC31
~
EICIB
ULTRASONIC
tri
-0
tri
::0
HIGH
POWER
I TRANSMITTER
(/)
tri
0.
680p
Q
LOW
,POWER
ELJc o(1_)
I
co
co
'-'
ULTRASONIC APPLIANCE REMINDER
w
0
4
0.1'
+BV
fi'h
-012 , ....
01
l
)
8< r
>
•iM
"( I
17
100k
+
F1
A
10A
--0--.0---.----
8
'-'
""-I
~-
IC5a
4013
!!ISET
22''
~
0:,
5
100k
1
I
1
3::
J
8D437
-6.
PLASTIC
SIDE
-3
Tt
-
t
'
680pf'!
3
1cK
04
TI MEOU T'
r - ---------,
T
14
LAMP OR
BUZZER
150k
0.1
T
0.1I
"I
11,R ~~4~0121 • · ~
10k
22
T
+
l
116
1N4148
IC3b
T T
100..:
11V
240VAC
VI EWED FROM BELOW
N •
f
)
1our ,
10
I
, +Bv
r--- - - - - - - -7
I
<at>
I
i- - - - - - - - - - - - l
I
I
I
:
I
I
I
I
I
ELEPHANTHIDE
MAiNS COVER
I
I
<at>
*
\
f
~ V E T°WN)
MAINS PANEL
SOCKET
Fl~
CORD GRIP
GROMMET
ULIBASOlilC
*
fj)
<at>
CASE LID
LINKS UNDER PCB -
-
-
* COVER WITH HEATSHRINK TUBING
Fig.2: take care with component orientation when installing the parts on the PC
board & use mains-rated cable for all 240VAC wiring. Don't forget the links
under the PC board.
(see Fig.2). This is done to keep dangerous main voltages away from the
main board.
Alternatively, for switching low
voltages, the relay can be installed on
the main PC board. The relay contacts
are then used as a normally open
switch. If you are using this option,
74
SILICON CHIP
delete the mains socket and all associated mains wiring.
When the boards have been completed, the case can be drilled to accept the hardware. Use the front panel
label as a marking temr,late to locate
the holes for the two LEDs, the pushbutton switch, the warning lamp and
the transducers. The holes for the
transducers are best made by first drilling small pilot holes and then reaming
them out until the transducers are a
tight fit.
The main board is mounted on the
lid of the case on 6mm plastic standoffs and secured using nylon screws
and nuts. You will also have to drill
holes in the base to mount the power
transformer and relay board , plus
l
I!. . AM
il ~1'"N'1'1:I
I
- - - - - - - - - ~ - C•i)'
This view inside the completed prototype shows how the mains cables are
bound so that if a lead does come adrift, it cannot short against anything. Note
that nylon screws are used to mount all the hardware items in the case.
holes in each end to accept a cordgrip
grommet, fuseholder and surfacemounting mains socket. Mount the
fuseholder down near the bottom of
the case, to keep it away from the PC
board (note: it should be further down
than on the prototype).
The front panel label can now be
attached, the hardware mounted in
position and the wiring completed as
shown in Fig.2. Note that nylon screws
& nuts are used to secure the relay
board, mains terminal block and
power transformer to provide isolation from the mains. As a further safety
measure, the bodies of the two ultrasonic transducers and the pushbutton switch must be sleeved in heatshrink tubing (see photo).
The front panel items are all wired
using light-duty hookup wire but you
must use mains-rated cable for all connections to the power transformer,
fuseholder, mains socket and relay
contact terminals. The mains cord
enters through one end of the case
and is anchored by the cordgrip grom-
CAPACITOR CODES
0
0
0
0
0
0
0
0
Value
IEC Code
EIA Code
0.1µF
.001µF
680pF
220pF
10pF
4.7pF
2.2pF
100n
1n
680p
220p
10p
4p7
2p2
104
102
681
221
10
4.7
2.2
RESISTOR COLOUR CODES
0
0
0
0
0
0
0
0
0
0
0
0
0
0
No.
Value
4-Band Code (5%)
5-Band Code (1%)
2
1MQ
560k.Q
390k.Q
270k.Q
150k.Q
100k.Q
47k.Q
27k.Q
22k.Q
10k.Q
4.7k.Q
1k.Q
470.Q
brown black green gold
green blue yellow gold
orange white yellow gold
red violet yellow gold
brown green yellow gold
brown black yellow gold
yellow violet orange gold
red violet orange gold
red red orange gold
brown black orange gold
yellow violet red gold
brown black red gold
yellow violet brown gold
brown black black yellow brown
green blue black orange brown
orange white black orange brown
red violet black orange brown
brown green black orange brown
brown black black orange brown
yellow violet black red brown
red violet black red brown
red red black red brown
brown black black red brown
yellow violet black brown brown
brown black black brown brown
yellow violet black black brown
1
1
2
13
1
1
4
8
3
3
SEPTEM BER 1991
75
met. Leave sufficient cord inside the
case to reach the fuseholder and mains
terminal block.
Install about 45mm of heatshrink
tubing over the leads to the fuseholder
before connecting them to the terminals. After soldering, push this tubing
over the body of the terminals and
shrink it to a tight fit using a hot
airgun.
Do not install the Active lead between the mains terminal block and
the relay board at this stage. This lead
is only installed after the unit has
been checked for correct operation.
Don't forget to connect the earth lead
between the PC board and the terminal block - see Fig.2.
After the wiring has been completed, use plastic cable ties to bundle the wires together, as shown in
the photographs. In particular, you
should ties the mains leads together
so that if one lead does come adrift, it
cannot move and short against anything.
Final checkout
To test the unit, first check your
mains wiring carefully, then close the
lid of the case and apply power. The
STANDBY LED will usually now come
on, while the MOVEMENT LED should
flash briefly if there is movement in
front of the transducers. Adjust the
sensitivity control, VRl, to ensure that
the ultrasonic range can be varied.
Now press the ON/OFF button. The
STANDBY LED should go out and the
relay contacts should close. If this
checks out, set VR2 to minimum (fully
anticlockwise) and check that the
relay drops out after about two min-
Because there are exposed mains connections on top of the transformer, it
should be covered with insulation to prevent accidental contact. This piece of
insulation is secured by one of the transformer mounting screws & to the side of
the case using a nylon screw & nut.
utes if there is no movement in front
of the sensors. Note: you can simulate
this by disconnecting a lead to one of
the transducers.
Finally, install the active mains lead
between the transformer and the relay board. The controlled appliance
should now toggle between on and off
when you press the ON/OFF button
and should automatically switch off
if there is no movement during the
timing period.
Troubleshooting
If it doesn't work, first use your
multimeter to check the supply rails.
You should get +8V from the regulator and this voltage should also be
present on the positive supply pins of
Where to buy the kit
Kits for this project are available from CTOAN Electronics, PO Box 33,
Condell Park, NSW 2200. Phone (02) 708 3763. There are three variations :
• Kit 1: includes PCBs, mains transformer, relay, 40-kHz crystal & ultrasonic
transducers. Price $39.95 plus $4.00 p&p.
• Kit 2: includes all of Kit 1 plus on-board components, pushbutton switch, LEDs
& lamp. Cost $54.95 plus $4.00 p&p.
• Kit 3: includes all of Kit 2 plus plastic case, adhesive front panel label,
fuseholder, mains socket and mains cord & plug. Cost $69.95 plus $4.50
p&p.
CTOAN Electronics offers a full repair service for this kit. The cost is
$20.00 plus $5.00 return postage. Only kits built as described in this article
and with good quality soldering will be accepted for repair.
Note: Copyright of the PC board for this project is retained by CTOAN
Electronics.
76
SILICON CHTP
the ICs. A low rail indicates that either the regulator, a supply diode or
an IC has been incorrectly oriented.
It often helps if you can pinpoint
the fault to a specific section of the
circuit. Assuming that the supply rails
are correct, here's what to look for:
• Symptom: relay doesn't close on
each alternate pressing of Sl. Check
circuit around IC5 & Q6 and check D4
& D5 for correct orientation. If the Q
output of IC5 goes high on alternate
presses of Sl, check Q6.
• Symptom: circuit times out regardless of movement; MOVE LED does not
flash. Check that pin 6 of IC2 swings
low when movement is present. If
OK, check Ql & Q2. Ql's collector
should swing high if movement is
detected, while QZ 's collector should
go low.
If no signal is present at pin 6 of
IC2, use a CRO to check for signal at
the output of the transmitter. If this is
OK, check for signal at the outputs of
ICla & IClb when there is movement.
• Symptom: MOVE LED flashes but circuit times out regardless of any movement. Check orientation of DZ & D3,
• Symptom: warning lamp flashes
continually during timing period.
Check orientation of D6.
• Symptom: warning lamp does not
flash just before timing period expires.
Check around IC3c, Q3 and Q4.
• Symptom: circuit does not time out
if there is no movement. Check circuit around IC3b & IC4. Check D4 &
D5 for correct orientation.
SC
|