This is only a preview of the July 2011 issue of Silicon Chip. You can view 30 of the 104 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 "Ultra-LD Mk.3 200W Amplifier Module":
Items relevant to "A Portable Lightning Detector":
Items relevant to "Rudder Position Indicator For Power Boats":
Items relevant to "A Look At Amplifier Stability & Compensation":
Items relevant to "Build A Voice-Activated Relay (VOX)":
Purchase a printed copy of this issue for $10.00. |
Triggers devices on and off with sound
Build
a VOX
By JOHN CLARKE
Traditionally, VOX circuits toggle a transmitter on as you speak
into a microphone and off again when there is silence. But VOX
circuits can be used anywhere you want to turn something on
when a sound occurs or you speak into a microphone. You could
use it turn on a light, an amplifier or maybe even unlock a door.
VOX
stands for Voice
Operated eXchange
and it is also the
Latin word for ‘Voice’. A VOX circuit
switches on a relay whenever a signal
reaches a set threshold. The relay
switches off once the signal level
drops below the threshold and after
a short delay.
They are used in communications,
public address systems, surveillance,
security and general purpose electronics.
For communications, a VOX switches a transceiver from receive to transmit whenever the person speaks into
the microphone. This frees the operator for other tasks as a separate switch
is not needed to talk. Many intercoms
and public address systems are also
automated in a similar way.
82 Silicon Chip
A VOX circuit can be used to mute
any sound until it reaches a set level.
That way a public address system will
ignore background noise and remain
quiet, until someone intentionally
speaks into a microphone. For security and surveillance, a recorder can
be switched on whenever a noise is
sensed by a microphone.
But it doesn’t have to be a microphone which causes the VOX action.
For general-purpose use, any audio
signal can used to switch the relay.
Our design
In line with the above comments,
our VOX design has two inputs, both
of which will accept the same types
of audio input. First is a stereo 3.5mm
jack socket which will handle both
mono and stereo signals, while the
second input is for mono inputs only
and is via screw terminals.
You can connect an electret or
dynamic microphone. Electret microphones require a bias voltage which
can be selected with a jumper link
(LK1). For stereo signals connected
via the 3.5mm socket, a jumper link
provides mixing of the left and right
channels into a mono signal.
Signal sensitivity can be adjusted
to cover a wide range from microphone levels up to line levels of 2V
RMS. With sufficient signal, the relay
switches on and remains on until the
signal level drops to below a threshold
level. An adjustable delay sets the time
taken for the relay to switch off once
this threshold is reached.
The relay has two sets of changeover
contacts which will suit a variety of
siliconchip.com.au
Features
•
•
•
•
•
•
•
•
•
12V operation
Electret or dynamic microphone or line input
3.5mm jack socket or screw terminal inputs
Mono or stereo signal
Adjustable sensitivity
Adjustable delay
Hysteresis prevents relay chattering at threshold
DPDT relay
Power and relay LED indication
switching applications. LEDs are included for visual indication of power
and of relay switching.
Because of the wide variety of possible uses for a VOX, our module is
simply presented as a PCB which you
can install to suit your application.
Or if you wish, it can be fitted into a
plastic “UB3” case measuring 130 x
68 x 44mm.
As you can see from the features at left,
our new VOX is quite a versatile beast!
It can be used in practically any application
which requires triggering from a sound source –
and that sound source can itself be just about anything!
a supply that is decoupled from the
11.4V supply via a 1k resistor and
a 100F capacitor. This decoupling
prevents supply variations entering
the input to the amplifier to cause
false triggering.
If the electret microphone is connected via the stereo jack socket input,
the electret is connected between the
ground terminal (sleeve) and the tip
of a mono jack plug. Again, link LK1
is inserted for electret power.
If an electret is not used and signal is applied via the jack socket or
screw terminals, the link (LK1) is left
disconnected. Stereo signals can be
connected via the stereo jack socket
and the signal is mixed down to mono
using 10k resistors for each channel.
This stereo mixing occurs when link
LK2 is inserted.
Dynamic microphones do not require bias current; in fact they should
not be connected to a circuit providing
electret bias, hence the reason for LK1.
A 100nF capacitor couples the
mono signal to op amp IC1a. Its noninverting input, pin 3, is biased from
the decoupled supply via two 100k
resistors. This sets the ampli-fier
output to swing symmetrically about
Circuit details
a nominal half-supply voltage. The
The VOX comprises a dual op amp
half supply will vary from about 5.3V
(IC1) that functions as a signal amplito about 5.6V, depending on whether
fier and threshold switch. The relay
or not an electret microphone is conis driven from the second op amp via
nected.
a transistor.
Diodes D1 and D2 are included to
Input signals come in via the 3.5mm
clamp any signal to +0.6V above the
jack socket (CON1) or via a 2-way
decoupled supply and -0.6V (ie, below
screw terminal block (CON2). For the
the 0V rail). They protect the IC1 input
screw terminal input,
if an excessive signal is
one terminal is conapplied.
nected to ground while
IC1a is connected as a
Power supply:.................... 12VDC at 50mA
the other is applied to
non-inverting amplifier
Trigger sensitivity:............. Adjustable from 2mV (microphone) to 2V (line)
the amplifier stage via
with a gain of 2 when
Maximum signal input: ..... 50V rms
a 10k resistor.
VR1 is set to zero ohms
Signal frequency range: ... 16Hz to >600Hz
When an electret
and a gain of about 1000
Attack time:........................ 10 cycles with signal at threshold voltage
microphone is used,
when VR1 is set to its
(faster attack if signal is above threshold)
bias current is selectmaximum. The actual
Hysteresis:......................... 0.44V at the 2.06V threshold
ed when link LK1 is
gain when VR1 is set to a
Delay time:......................... Adjustable from 100ms to 10s
closed. The 10k bias
high value is dependent
Electret bias current:......... ~320
A
resistor is connected to
upon the signal frequency
Relay contacts (DPDT):...... 5A (maximum of 50V recommended)
siliconchip.com.au
July 2011 83
Specifications
1k
10k
LK1
LK2
CON1
100 F
16V
K
100k
100nF
3
8
IC1a
2
100
1
D4 1N4148
10 F
47k
K
A
D3
1N4148
4
100 F
1k
A
SENSITIVITY
1k
7
IC1b
VR2
100k
K
1k
VR1 1M
5
6
47pF
LK1: ELECTRET BIAS
LK2: STEREO
1M
K
NP
K
100k
10k
POWER
2 x 10k
100 F
16V
A
LED1
A
ALTERNATIVE
ELECTRET OR
SIGNAL INPUT
4.7k
100 F
16V
A
D2
1N4148
+
10 F
16V
100nF
D1
1N4148
3.5mm
JACK SOCKET
CON2
+11.4V
2.2k
100nF
IC1: LM358
10 F
AC SIGNAL TO DC
CONVERTER (RECTIFIER)
AMPLIFIER
SC
2011
VOICE ACTIVATED RELAY
DELAY
SCHMITT TRIGGER
1N4148
1N4004
A
A
K
K
84 Silicon Chip
D3
D4
4148
4148
47pF
4.7k
47k
10k
1k
4148
1k
100k
4.7k
A
K
100 F
CON5
NO
COM
1M
VR2
100k
100 F
NO
COM
NC
X OV
4004
Q1
D6
10k
10k
CON4
1k
2.2k
100nF
D2
10 F
100nF
1k
4148
100k
10k
10k
CON1
NC
RELAY1
11170210
VR1
1M
IC1
LM358
100nF
10 F
LK2
SIG IN
100 F
10k
GND
LED2
NP
100 F
LK1
0V
4004
+12V
CON3
K
10 F
100
D5
A
LED1
CON2
and the open- loop gain of the LM358
op amp.
The 47pF capacitor is included to
provide a steep roll-off at high frequencies, to ensure IC1 does not oscillate.
However, it is the open-loop gain of the
amplifier that sets the bandwidth. For
example at a gain setting of 100 (when
VR1 is 99k), the roll-off caused by the
47pF capacitor is about 34kHz.
Roll-off due to the open-loop gain is
at around 6kHz. With VR1 set for a gain
of 1000, the 47pF rolls off frequencies
above about 3.4kHz. But the open-loop
gain begins to roll off beyond about
600Hz.
Low frequency rolloff is set at about
16Hz. This is due to the 1k resistor
and 10F capacitor connected in series
to the inverting input.
The output signal from op amp IC1a
is fed to a rectifier involving diodes
D3 and D4, to convert the AC signal
to a DC voltage. As pin 1 swings above
its resting position of 5.7V, the 10F
capacitor discharges via diode D4 into
the 100F capacitor at D4’s cathode.
When pin 1 swings below 5.7V, the
10F capacitor discharges via D3. The
100F capacitor then charges with repetitive pulses provided by the 10F
capacitor.
Op amp IC1b is connected as a
Schmitt trigger comparator, with the
inverting input at pin 6 tied to a voltage
divider comprising a 10k and 2.2k
resistor across the 11.4V supply. Pin
D1
Fig.1: complete circuit diagram of the VOX, or Voice Activated Relay. It’s all based on one IC, an LM358, which performs
the dual function of signal amplifier and comparator/schmitt trigger. A handful of other components complete the circuit.
Fig.2: everything mounts on the one PCB, shown here in both diagram and photo
form. The only thing “missing” from the PCB is the microphone which must be
mounted off the board, as it will “hear” the relay pulling in and releasing and
more than likely trigger in error. It can be mounted on a short pair of wires if
you wish, or as long away as necessary using a shielded microphone cable.
siliconchip.com.au
D5 1N4004
K
A
+12V
A
0V
RELAY
LED2
K
RLY1
K
D6
1N4004
4.7k
CON5
A
NC
COM
NO
10k
B
CON4
C
Q1
BC337
NC
COM
NO
E
10k
RELAY DRIVER
BC337
LEDS
B
K
A
E
C
6 sits at about 2.06V and is bypassed
with a 100nF capacitor.
IC1b’s non-inverting input, pin
5, monitors the voltage across the
100F capacitor via a 47k resistor.
When the 100F capacitor voltage is
below pin 6, IC1b’s output at pin 7 is
low; close to 0V. When the capacitor
voltage rises above pin 6, pin 7 will
go high to about +10V. So provided
the AC signal fed to rectifier is enough
to produce more than 2V across the
100F capacitor, pin 7 of IC1b will go
high and this will turn on transistor
Q1 and the associated relay.
Now one of the problems with a trigger circuit like IC1b is that it will not
switch cleanly from high to low since a
very slight change in the voltage across
the 100F capacitor could mean that it
switches back and forth very rapidly.
This would have the result that the
relay would chatter, ie, also switch on
and off very rapidly.
We fix this by adding hysteresis
to the circuit, by including the 1M
resistor between pin 5 and 7. What
now happens is that when the output switches high, it also pulls pin 5
slightly higher, 0.35V higher than the
100F capacitor voltage. This means
that the capacitor has to discharge by
this amount before the IC1b will go
low again. This stops the relay chatter.
The 100F capacitor is continually discharged via VR2 and the 1k
resistor. So if signal from IC1a is not
siliconchip.com.au
Parts List – VOX
CON3
1 PCB coded 01207111, 106 x 61mm
1 DPDT 12V relay, 5A contacts (Jaycar SY-4052, Altronics S4190C) (RLY1)
1 3.5mm stereo socket PCB-mount (Jaycar PS-0133, Altronics P0092))
(CON1)
2 2-way PCB-mount screw terminals with 5.08mm pin spacing (CON2,CON3)
2 3-way PCB-mount screw terminals with 5.08mm pin spacing (CON4,CON5)
1 electret microphone insert (MIC1) (if required – see text)
11M horizontal mount trimpot (Code 105) (VR1)
1100k horizontal mount trimpot (Code 104) (VR2)
2 2-way pin headers with 2.54mm pin spacing (LK1,LK2)
2 2.54mm jumper shunts
4 M3 tapped spacers (optional)
4 M3 x 6mm screws (optional)
1 length of hookup wire or single cored shielded cable
Semiconductors
1 LM358N dual op amp (IC1)
1 BC337 NPN transistor (Q1)
4 1N4148 switching diode (D1-D4)
2 1N4004 1A diodes (D5,D6)
2 3mm red LEDs, 1 red and 1 green (LED1,LED2)
Capacitors
3 100F 16V electrolytic
1 10F Non Polarised (NP) electrolytic
2 10F 16V electrolytic
Codes:
3 100nF MKT polyester
1 47pF ceramic
Resistors (0.25W 1%)
4-Band Code (1%)
1 1MΩ
brown black green brown
2 100kΩ
brown black yellow brown
1 47kΩ
yellow purple orange brown
6 10kΩ
brown black orange brown
2 4.7kΩ
yellow purple red brown
1 2.2kΩ
red red red brown
4 1kΩ
brown black red brown
1 100Ω
brown black brown brown
continuously replenishing the 100F
capacitor, the voltage will drop in
level. VR2 sets the delay period from
when IC1b is triggered high to when
its output goes low in the absence of
signal from IC1a.
The VOX runs from a 12V supply
and diode D5 is included for reverse
polarity protection. LED1 indicates
when power is present.
Construction
The VOX is assembled on a PCB
coded 01207111 and measuring 106
x 61mm. All of the components are
mounted on the PCB, apart from the
microphone which must not be – it
needs to be off the board so that it
does not attempt to retrigger the
F Value IEC Code EIA Code
0.1F
100n
104
NA
47p
47
5-Band Code (1%)
brown black black yellow brown
brown black black orange brown
yellow purple black red brown
brown black black red brown
yellow purple black brown brown
red red black brown brown
brown black black brown brown
brown black black black brown
circuit whenever it “hears” the relay
switch off.
The PCB is sized to clip into the
integral side slots of a UB3 utility
box measuring 130 x 68 x 44mm. If
you are using this box, make sure the
left edge of the PCB is shaped to the
correct outline so it fits into the box,
clearing the internal corner pillars.
That way the 3.5mm socket can pass
through the end of the box. It can be
filed to shape if necessary, using the
PCB outline shape as a guide.
Begin construction by checking
the PCB for breaks in tracks or shorts
between tracks or pads. Repair if
necessary. Check hole sizes for the
components and for the corner mounting holes.
July 2011 85
Another view of the VOX PCB showing in detail the input and power
sockets. It can be driven from an electret microphone (as shown here),
a dynamic microphone (with the bias link LK1 left open) or indeed from
virtually any audio source from 2mV (microphone level) right up to
2V (higher than most line levels). The sensitivity pot (closest
to the input sockets) can be adjusted to cater for
this range. The other pot (closest to
the relay) adjusts the length of
time the relay stays closed
once it is triggered.
Assembly can begin by the inserting
the resistors. When doing this, use
the colour codes in the parts list to
help in reading their values. A digital
multimeter can also be used to measure each value. Next come the diodes,
remembering these must be mounted
with the orientation as shown. There
are two types of diodes; the smaller
1N4148s are D1-D4 while the larger
1N4004 types are D5 and D6.
IC1 can be soldered directly into
the PCB (or you can use a DIP8 socket
if you wish). When installing the IC
(and socket), take care to orient them
correctly. Orientation is with the notch
positioned as shown.
Capacitors can be mounted next.
The electrolytics must be oriented
with the shown polarity except for
the NP (non-polarised) type that can
mount either way.
Mount the transistors and trimpots
VR1 and VR2. VR1 is the 1M trimpot
and could be marked with its value or
with the coding 105. The 100k VR2
could be marked as 104.
LED1 and LED2 are mounted about
5mm above the PCB. The anode is
the longer lead and is placed in the
uppermost hole.
The 2-way pin headers for LK1 and
LK2 can be mounted now, followed by
the 3.5mm socket, the relay and the
screw terminals. CON1 and CON2 are
2-way terminals that are first attached
by sliding the dovetail sections of each
together. Similarly for the CON3 and
CON4 terminals, these are slid together
before being mounted on the PCB.
Make sure the wire entry side face the
outside of the PCB.
86 Silicon Chip
We mounted the PCB on four 6mm
long tapped spacers, held in place with
M3 x 6mm screws but this is entirely
up to you and your application.
If using an electret microphone,
this should be mounted so that it does
not touch the PCB and connected via
multi-strand hookup wire for short
(less than 30mm) leads or using single
core shielded cable for longer runs.
The shield wire connects to the GND
terminal (for the 3.5mm jack plug, the
GND is the sleeve). Signal connects
to the second screw terminal for the
screw terminal input or the tip connection of the 3.5mm jack plug.
For a signal input other than a microphone, apply the signal to either the
screw terminals or via a 3.5mm jack
plug. One channel connects to the tip
terminal and the other channel to the
ring terminal.
Link selection depends on whether
you are using an electret or dynamic
microphone or a mono or stereo signal
connection. LK1 should be linked only
when the electret microphone is used
and removed for a dynamic mic.
LK2 should have a jumper link for a
stereo signal. You wouldn’t normally
have both LK1 and LK2 in position
at once but there are stereo electret
microphones around so it is possible
(though why you’d want to use one in
this application is a bit beyond us!).
Apply 12V power and adjust VR1 so
that the relay triggers at the required
signal level. Similarly, adjust VR2 so
that the relay switches off after the
desired time period. The delay should
be as short as possible but not so short
that it drops out while speaking.
If the Voice Activated Relay does
not work, first check your soldering
to make sure there are no dry joints,
solder bridges or dags, etc.
If the visual inspection looks OK,
check voltages on the circuit. There
should be about 11.4V between pins
4 and 8 of IC1. Pin 3 of IC1 should
be around 5.7V to 5.3V. Pin 6 of IC1b
should be at about 2V.
Incorrect voltages may be because
of incorrect resistor values or a short
or open circuit connection. Check that
LED 1 lights. Output of IC2 at pin 7
should be near 0V when no signal is
applied (or when no sound is detected
by the microphone).
With sufficient signal applied, the
pin 7 output should go to around 10V,
the relay should switch on and LED2
should light. The relay should switch
off after the preset time period when
there is no signal.
9V operation?
We know we will be asked the question! Some constructors may wish to
use the VOX as a stand-alone device
– so we’ll answer it already!
No, operation from 9V would be
quite unreliable, especially if the battery is a bit flat. And the 50mA current
draw would put the battery in that state
pretty quickly!
Most of the circuit would be fine at
9V but the 12V relay would not be at
all happy (if indeed it worked at all).
Substituting a 5V relay may be an
option, with a resistor in series with
the coil but it may not be possible to
get one which fits the PCB without
modification.
SC
siliconchip.com.au
|