This is only a preview of the June 2003 issue of Silicon Chip. You can view 29 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:
Items relevant to "Sunset Switch For Security & Garden Lighting":
Items relevant to "Test Your Reflexes With A Digital Reaction Timer":
Items relevant to "Adjustable DC-DC Converter For Cars":
Purchase a printed copy of this issue for $10.00. |
Test your reaction times
with a
DIGITAL
REACTION TIMER
By JIM ROWE
So you think your reaction time is pretty good. Cocky, eh? Well, you
might be surprised. This little project will let you test your own or
anyone’s reaction time and read it out accurately on a digital multi
meter. The ‘Brake!’ stimulus is a large red LED, while the subject’s
response can be sensed via a pushbutton, foot pedal switch or even
an optical detector, set up to sense the light from a car’s brake lamp.
E
VERYONE TAKES a finite time to
respond to any stimulus, whether
it’s the brake lamp from the vehicle
in front at 110km/h on the freeway,
touching a hot saucepan on the stove
or whatever.
There’s the short time for the nerve
impulses from your senses to travel to
your brain, the time for your brain to
respond and then a further short time
for outgoing nerve impulses to travel to
56 Silicon Chip
your limbs and stimulate the muscles
to produce your reaction.
These three delays are usually
lumped together into a single quantity
known as your reaction time: the total
time taken for you to actually respond
to such a stimulus.
Your reaction time varies depending
on whether you respond with your
hand or your foot. It also depends on
your state of health, alertness, psycho-
logical outlook and whether you have
recently taken drugs or alcohol.
The reaction time for a normal
healthy adult seems to vary from
150-300ms (milliseconds) for a hand
response and from 400-800ms for a
foot response (eg, hitting the brakes).
If you are driving a vehicle and your
measured reaction times are significantly longer than these times, you
are an “accident waiting to happen”.
www.siliconchip.com.au
It’s designed to be a low-cost but
accurate short-interval timer, suitable
for a whole range of purposes (not
only reaction). There is no case (cost
saving #1), the push-button switches
are mounted in old film cannisters (or
anything else you wish – cost saving
#2) and there is no output circuitry or
display, because the output is read
directly on any digital multimeter –
cost saving #3.
You don’t need to be a rocket scientist to work out why. Consider driving
at 70km/h. At that speed, you’re travelling a distance of 19.4 metres every
second or almost two metres in each
100ms. So if it takes you (say) 500ms to
respond to an emergency by stepping
on the brake pedal, your car will travel
almost ten metres before the brakes can
even begin to slow you down.
Some safety experts have been lobwww.siliconchip.com.au
bying for years to make reaction time
testing mandatory for driver’s licence
renewals. It hasn’t happened yet – but
in the meantime you can measure
the reaction time of all your driving
friends, to judge whether they should
be on the road or not . . .
Uses a digital multimeter
This new Reaction Timer uses a
digital multimeter to read out the time
in milliseconds; you just switch it to
the 2V DC range.
The unit runs from a 9V battery or
DC plugpack. It measures the time you
take to press the Stop button (or a foot
switch) after the “Brake” LED is lit and
converts that time into a DC voltage
(1ms = 1mV). So your digital multimeter can read reaction times directly.
A reading of 335mV corresponds to
a reaction time of 335ms, and so on.
June 2003 57
58 Silicon Chip
www.siliconchip.com.au
Fig.1 (left): the circuit uses a 1kHz
clock pulse generator based on IC1c.
Its pulses are gated through to
binary counter IC3 (via IC2c) during
the time that the “Brake” LED (LED
1) is illuminated. The counter outputs
are then fed to a ladder DAC to
produce an analog voltage for the
DMM.
Using a DMM for the readout keeps
the circuit simple and the cost low.
It also keeps the current drain low
as well, so the tester will operate for
quite a long time from a standard 9V
battery. The current drain is only 4mA
when the LED is not lit, rising to 14mA
when the LED is on.
Can you jump the gun?
Nope. But you can have fun trying!
To make it impossible to ‘jump the
gun’ – even when you’re measuring
your own reaction time – there’s a
built-in variable time delay before the
‘Brake!’ LED is lit, after the Set button
is pressed.
So even if you press the Set button
yourself, or notice when the operator
presses the button, there’s no way of
guessing when the LED will light. It
could be anything from a fraction of
a second up to a few seconds, before
the LED lights and your reaction time
begins to be measured.
You are therefore forced to concentrate on the LED, and then push
the Stop button as soon as you see it
light up.
The measuring range of the timer
is from zero to 1023ms, or just over
one second. If your reaction time is
longer than this, the timer’s output
voltage drops back to zero and starts
again. This is hardly a problem though,
because if your reaction time is longer
than 1023ms you should probably be
a passenger, not a driver!
How it works
At the heart of the timer is a simple
clock pulse generator producing a
string of pulses at a rate of one pulse
per millisecond (ie, 1kHz).
These clock pulses are controlled
by a logic gate, which is opened only
during the time that the ‘Brake!’ LED
is illuminated. Pulses from the gate
are then fed to a binary counter which
counts how many pulses have been
allowed through the gate.
We then use a simple digital-to-analog converter (DAC) to convert the count into a DC output voltage,
www.siliconchip.com.au
ready for measuring by a DMM.
That’s the basic idea. Now we can
look at the circuit of Fig.1 in some
detail.
The 1kHz clock pulses are produced
by the circuitry around IC1c, one section of a 40106 or 74C14 hex Schmitt
trigger inverter. This is connected as
a relaxation oscillator, with the 5kΩ
variable resistor VR1 used to adjust its
oscillation rate to exactly 1kHz.
The pulses from IC1c are fed to
gate IC2c, the main timing gate. IC2c
is one section of a 4093 quad Schmitt
NAND gate. The pulses which IC2c
allows through are fed to the clock
input of IC3, which is a 4040 12-stage
binary counter. We only use 10 of the
12 outputs, as this allows us to count
up to 1023 (one less than the 10th
power of 2).
Ladder DAC
The 10 outputs of IC3 are in binary
form, each one swinging between 0V
and 5V as the counting proceeds. The
combination of 10 binary outputs is
converted into an equivalent analog
DC voltage by the DAC ‘ladder network’ of 10kΩ and 20kΩ resistors.
This simple but effective DAC
ensures that each output is given the
correct ‘binary weighting’ at the output. That is, the effect of each counter
output halves with its position down
the ladder. Output O8 produces half
the output voltage of O9, O7 produces
half that output again and so on.
As this basic DAC produces an output voltage varying from 0V to just on
5V, we use the two additional 12kΩ
and 3.3kΩ resistors connected from
the DMM output to earth to form the
lower half of a voltage divider. This
reduces the output voltage range to 0
- 1.023V, ensuring that the DMM will
read directly in millivolts.
So IC1c, IC2c, IC3 and the resistor
ladder network are essentially the core
of the timer, able to count a time period
and convert it into an equivalent DC
voltage.
Now let’s see how we make this timer measure reaction times. Gate IC2c
is controlled by an RS flipflop formed
from gates IC2a and IC2b (4093). When
this flipflop is in the Set state with
IC2b pin 4 high, gate IC2c is ‘open’
and allows 1kHz pulses through to
the counter.
At the same time transistor Q2 is
turned on by the logic low at the output of IC2a (pin 3), via the transistor’s
If you mount the pushbutton switches
in a film cannister or similar, it’s a
good idea to fit a large flat washer to
stop the switch being forced through
the plastic due to over-exuberance!
10kΩ base resistor. This turns on the
‘Brake!’ LED. This LED remains alight
while the timer is actually measuring
a reaction time, ie, until the person
being tested pushes the STOP button.
When the person being tested
presses the Stop button (either S2, or
a remote switch via CON2), this pulls
pin 1 of IC2a low, which switches the
RS flipflop back to its reset state. The
output of IC2b goes low, turning off
gate IC2c to stop the counter, while the
output of IC2a goes high at the same
time which turns off Q2 to extinguish
the LED.
But what switches the flipflop into
the set state in the first place, to start
the timer and light the LED? Now
that’s a little more tricky – which is
why we’ve left it until last.
Random start delay
The flipflop is switched into the
set state by applying a brief logic low
pulse to pin 6 of IC2b; we could do
this by connecting the Set button S1
(or a remote switch via CON1) to this
pin via a simple RC debounce circuit
like that used for the Stop button S2.
But this would turn on the LED and
timer immediately, leaving the timer
susceptible to errors caused by a subject “jumping the gun”.
As a result, we’ve introduced a variable delay between pressing S1 and the
actual turn-on of the flipflop, which
“randomises” the turn-on procedure.
This works as follows. Schmitt inverters IC1f and IC1e are both connected
as relaxation oscillators, similar to
the clock oscillator (IC1c) but with
both working at much lower frequencies. IC1f runs at about 10Hz while
June 2003 59
Parts List
1 PC board, code 04106031, 76
x 128mm
1 momentary contact pushbutton
switch (S3)
2 momentary contact pushbutton
switches (S1,2) OR
2 3.5mm PC-mount stereo jacks
(CON1,2)
1 3.5mm PC-mount stereo jack
(CON3)
1 2.5mm concentric power socket (CON4)
4 rubber feet, screw mounting
type
4 M3 x 6mm machine screws
with M3 nuts
1 3.5mm mono jack plug
1 1-metre length of light-duty
figure-8 cable
2 banana plugs (one red, one
black)
2 3.5mm mono jack plugs
(optional)
2 2.5m lengths of shielded audio
cable (optional)
2 pushbutton or foot switches
(optional)
1 5kΩ horizontal trimpot (VR1)
IC1e runs at around 8Hz, determined
mainly by the 4.7µF capacitors and the
82kΩ or 100kΩ resistors.
Both these oscillators produce an
output in the form of very narrow
negative-going pulses. This is due to
the effect of the 1kΩ resistors and diodes D1 or D2 which make the 4.7µF
capacitors discharge very rapidly on
every half-cycle. So both outputs are
at the logic high level for about 99% of
o
No.
o 1
o 3
o 1
o 2
o
11
o 1
o 1
o
13
o 1
o 2
o 1
60 Silicon Chip
Value
1MΩ
100kΩ
82kΩ
22kΩ
20kΩ
15kΩ
12kΩ
10kΩ
3.3kΩ
1kΩ
330Ω
Semiconductors
1 40106 or 74C14 hex Schmitt
trigger (IC1)
1 4093 quad Schmitt NAND gate
(IC2)
1 4040 12-stage binary counter (IC3)
1 78L05 3-terminal regulator
(REG1)
1 PN100 NPN transistor (Q1)
1 PN200 PNP transistor (Q2)
1 10mm bright red LED (LED1)
6 1N4148 diodes (D1-D6)
1 1N4004 power diode (D7)
Capacitors
1 10µF tantalum
3 4.7µF tantalum
1 2.2µF tantalum
6 100nF monolithic (code 100n or
104)
Resistors (0.25W 1%)
1 1MΩ
1 12kΩ
3 100kΩ
13 10kΩ
1 82kΩ
1 3.3kΩ
2 22kΩ
2 1kΩ
11 20kΩ
1 330Ω
1 15kΩ
the time and only at logic low level for
about 1% of the time. In other words,
the oscillators have a very high duty
cycle or mark-space ratio.
Because the two oscillators are
running at different frequencies, these
narrow negative-going pulses coincide
only occasionally. So by combining
them in the AND gate formed by
diodes D3, D4 and the 22kΩ resistor,
we end up with a voltage across the
resistor which is at logic high level
most of the time, only occasionally
going low very briefly. This becomes
our source of pseudo-random pulses
for triggering the flipflop.
The occasional low pulses are inverted by IC1d and then fed to one
input of NAND gate IC2d, which controls when they are allowed through to
pin 6 of IC2b. The remaining circuitry
using Q1, diodes D5 & D6 and inverter
IC1b is used to ensure that the flipflop
is switched to the set state on the arrival of the first ‘random’ pulse from
IC1d after the Set switch S1 has been
pressed.
They also ensure that the flipflop
can’t be retriggered again for some
time, so that it switches to the reset
state as soon as the Stop button is
pressed, and remains in that state. This
works as follows.
While the flipflop is in the reset
state, the output of inverter IC1b is
high. This means that the 4.7µF capacitor connected between pin 12 of
IC2d and 0V could potentially charge
up to logic high via D6 and the 22kΩ
resistor, except for the fact that transistor Q1 is switched on by the 10kΩ
resistor connected to its base.
But if the Set button S1 is pressed,
Q1 turns off and the 4.7µF capacitor
charges up rapidly, bringing pin 12
of IC2d to logic high level. IC2d then
turns on, allowing the next ‘random’
pulse from IC1d to pass through to the
flipflop and switch it to the Set state.
Because of the high value of the
1MΩ resistor connected in parallel
with the 4.7µF capacitor, the capacitor
takes about 10 seconds to discharge
when S1 is released. This means that
you only have to press S1 briefly and
the circuit remains ‘primed’ and ready
Resistor Colour Codes
4-Band Code (1%)
brown black green brown
brown black yellow brown
grey red orange brown
red red orange brown
red black orange brown
brown green orange brown
brown red orange brown
brown black orange brown
orange orange red brown
brown black red brown
orange orange brown brown
5-Band Code (1%)
brown black black yellow brown
brown black black orange brown
grey red black red brown
red red black red brown
red black black red brown
brown green black red brown
brown red black red brown
brown black black red brown
orange orange black brown brown
brown black black brown brown
orange orange black black brown
www.siliconchip.com.au
Fig.2: install the parts on the PC board as shown in this full-size wiring diagram and photograph.
to let through the next trigger pulse
from IC1d, even if this doesn’t arrive
for a few seconds.
But how do we prevent the triggering circuit from being able to turn on
the flipflop a second time, after the
Stop button S2 has been pressed?
That’s the purpose of D5 and its
series 10kΩ resistor, because they
ensure that any charge on the 10µF
capacitor is rapidly drained away as
soon as the flipflop is switched on.
When the flipflop switches to the Set
state, the output of IC1b goes low,
diofde D5 conducts and the capacitor
discharges through the 10kΩ resistor
in less than 100ms.
Reset function
When the timer’s flipflop is switched
off by the Stop button (S2), counter
www.siliconchip.com.au
IC3 simply stops counting with its
outputs remaining at the millisecond
count that was reached. This means
also that the timer’s DC output remains
fixed, giving you as much time as you
need to read the DMM and record the
time reading.
Reset switch S3 resets the counter
to zero so you can perform another
reaction time measurement. Associated with switch S3 is a 100kΩ resistor
and a 100nF capacitor which form a
‘de-bounce filter’. This is followed by
inverter IC1a which provides a positive-going reset signal for IC3 when
the button is pressed.
As well as being a de-bounce filter,
the 100kΩ resistor and 100nF capacitor also form a ‘power-on reset’ circuit
to reset IC3 as soon as power is connected to the circuit.
Power for the circuit can come from
a 9V battery or 9V DC plugpack. This
is fed through diode D7 to prevent
reversed-polarity damage and is then
passed through 5V regulator REG1.
Trigger options
You have two options regarding the
timer’s Set triggering. The simpler approach is to use on-board push-button
S1 but this means that the person being
tested will be well aware when you
have ‘started the ball rolling’.
The alternative approach is to fit
socket CON1 instead of S1 and connect to it a remote pushbutton (or
foot switch) via a length of shielded
cable and a suitable plug. The remote
pushbutton can be mounted in a film
container or some other small case that
can be handheld.
June 2003 61
Fig.3: this is the full-size pattern for the single-sided PC board used in this
project. It can also be downloaded from www.siliconchip.com.au/Shop/10/1976
This allows you to press the Set
button out of the test subject’s sight
(although, as we’ve said before, there is
a random time period after this switch
is pushed to prevent cheating!).
The same two approaches are available for the Stop triggering, where
you can again use either on-board
pushbutton S2 or a remote pushbutton
connected via CON2.
In this case there’s also a third option; instead of connecting a simple
pushbutton via CON2, you can connect a small optical sensor circuit, so
the timer can be stopped by an optical
signal of some kind; eg, the stop lamp
of your car.
In this way, you could simulate an
actual braking situation (without the
risk of a collision!).
As shown on the circuit, the optical
sensor can consist of a BP104 or similar photodiode, a 47kΩ resistor and a
PN100 transistor.
Putting it together
Virtually all of the timer’s circuitry
fits on a small PC board measuring 76
x 128mm and coded 04105031. The
component overlay diagram is shown
in Fig.2.
The only off-board wiring consists of
the cables running to your DMM and
to a 9V battery or plugpack supply,
plus those to the remote Set and Stop
buttons if you elect to use them.
The PC board assembly is intended
to be used ‘as is’, supported by four
small rubber feet.
Before starting assembly, inspect the
62 Silicon Chip
copper side of the PC board carefully
and make sure there are no hairline
cracks in the copper tracks, or solder or
copper bridges shorting them together.
Fix any defects.
Then start by fitting the two wire
links to the top of the board. One of
these is just to the left of trimpot VR1,
while the other is just to the left of IC2
and IC3. This second link should be
made from a short length of insulated
hookup wire.
Next, fit the various connector
sockets to the board: DC power socket
CON4, DMM output socket CON3 and
the optional sockets CON1 and CON2
for the remote Set and Stop buttons.
Note that the PC board has holes and
pads to match either type of commonly available board-mounting 3.5mm
stereo sockets, so there shouldn’t be
any problems.
If you’re not fitting CON1 and CON2,
you can fit push-button switches S1
and S2 instead, plus the Reset button
S3, which goes at the front centre of
the board. Note that S3 must be fitted
with its ‘flat’ side towards the back of
the board. This also applies to S1 and
S2, if you fit them.
Next you can fit trimpot VR1; you
may also need to slightly enlarge the
PC board holes before the pins will
pass through easily. The board has
holes to allow either common type of
mini trimpot to be fitted.
The resistors can be fitted next,
using the colour codes in the parts
list as a guide. If you’re not confident
about reading the colour codes, use
your DMM to check the resistor values.
It’s also a good idea to fit the resistors
with their colour codes reading in the
same directions, to make checking and
troubleshooting easier in the future.
With the resistors fitted, you can fit
the remaining low-profile parts: signal
diodes D1-D6 (all 1N4148 or 1N914)
and the polarity protection diode D7 (a
1N4004). Take special care to fit all of
these diodes the correct way around,
as shown in the diagram of Fig.2.
If you don’t, the timer either won’t
work at all, or you’re likely to get some
very strange results...
Once the diodes are soldered in
place you can fit the small monolithic
capacitors, and then the tantalum and
electrolytic capacitors.
Don’t forget that the tantalum and
electrolytic capacitors are polarised,
and must be fitted into the board with
the correct polarity. You should find
each one’s polarity clearly marked
on its body, and the positive side is
indicated on the overlay diagram to
guide you.
All that remains is to fit transistors
Q1 and Q2, voltage regulator REG1,
the 10mm LED and the three ICs. The
main things to watch here are that
you make sure to fit each one in its
correct location and with the correct
orientation as shown in the overlay
diagram of Fig.2.
REG1 is in the same type of TO92 package as Q1 and Q2, so don’t
confuse them. Note that some 10mm
LEDs don’t have a ‘flat’ moulded into
their plastic pack, so the only easy
way to check their polarity is by the
longer length of their anode lead.
Therefore, make sure you fit LED1 to
the board with this longer lead on the
side nearest IC3.
We suggest that you solder the
LED’s leads to the board pads with
the bottom of the LED package only
about 8-9mm above the board. This
allows you to bend both leads forward
by about 30°, so that the LED is tilted
towards the front.
Because all three ICs are of the
CMOS type, it’s a good idea to take
precautions to prevent them from being damaged by static electricity while
you’re handling and fitting them. The
best way to do this is by making sure
that the PC board’s copper tracks,
your soldering iron and yourself are
all at earth potential for this part of
the operation.
To earth yourself, you can use a
www.siliconchip.com.au
conductive wrist strap, connected to
an earthed water pipe via a length of
flexible insulated wire. This also allows you to drain away any charge on
the board copper by simply touching
it before you fit the ICs.
Once the ICs are fitted, the final step
in the board assembly is to fit the board
with small rubber mounting feet, using
four M3 x 6mm machine screws and
M3 nuts.
You also need to make up a lead to
run from the timer to your DMM. This
should have a 3.5mm jack plug on
one end and a pair of banana plugs at
the other. If you use red/black colour
coded cable for this lead and fit red and
black banana plugs, this will make it
easy to connect up to the DMM with
the correct polarity every time.
Mind you, most DMMs these days
have auto polarity, so it’s not really a
problem.
If you’re using remote Set and Stop
switches, you’ll also need to make up
the remote switch leads. These can
use single-core shielded wire for the
plain pushbutton or foot-switch leads,
fitted with mono 3.5mm jack plugs.
You only need to use shielded stereo
cable and a stereo jack plug for the
optical Stop sensor, because the extra
wire and jack connection are needed
for the photodiode bias voltage.
Checkout & calibration
Your reaction timer should now be
complete and ready for checkout and
calibration. The first step is to connect
it to a 9V battery or nominal 9V DC
plugpack. Use your DMM to check
the voltage at pin 14 of either IC1 or
IC2, or pin 16 of IC3 (measured against
board earth, such as the lefthand end
of the two resistors between CON3
and CON4). You should read +5V at
all three of these IC pins.
The LED should not be lit but if
you briefly press button S1, the LED
should light soon afterwards – within
a few seconds. If 10 seconds pass and
the LED still hasn’t begun glowing, try
pressing S1 again briefly. This should
cause the LED to light within another
few seconds. If not, you’ve probably
made a wiring error. So remove the 9V
supply and look for a reversed diode
or transistor . . .
Once the LED does light, try pressing Stop button S2. This should extinguish the LED immediately. If you have
connected the timer’s output lead to
your DMM, it should now indicate a
steady DC voltage somewhere between
0V and 1.023V. If you then press the
Reset button S3, the voltage should
drop back to zero.
Assuming the above checks are
successful, your Reaction Timer is
working correctly and all that remains
is to calibrate it so that your reaction
time readings will be accurate. This
can be done quite easily, although you
do need access to either a calibrated
oscilloscope or a frequency counter.
These days, many of the better DMMs
incorporate a frequency meter.
If you don’t have access to either of
these instruments, you might have to
simply set trimpot VR1 to the centre
of its adjustment range and hope for
the best.
If you do have access to a calibrated
scope or frequency counter, accurate
calibration is a snack. All you have to
do is connect the (high impedance)
input of either instrument to either pin
6 of IC1 or pin 8 of IC2 and read the
frequency of the square wave signal.
Then adjust VR1 until the frequency
reads as close as possible to 1kHz
(1000Hz).
That’s it. With the clock pulse rate
set to 1kHz, the timer’s output voltage
should be within 2% or better of the
reaction time period in milliseconds.
Camera shutter timer?
While we haven’t tried it, we imagine that this circuit (especially the
main timing oscillator, counter and
DAC) would also be quite useful as a
short interval timer – eg, for checking
camera shutter speeds. Obviously the
“random start” oscillators (IC1e, IC1f)
would not be needed, nor would the
“Brake” LED or its associated circuitry.
One way to sense the “lens open”
time would be to use a phototransistor
or photodiode to detect light coming
through the lens. Again, we must emphasise that we haven’t tried this but
we would imagine the phototransistor
could be used to simply control IC2c,
which in turn would allow oscillator
pulses from IC1c into the counter on
“light” and stop them on “dark”. SC
Looking for real performance?
• Learn how engine management systems work
• Build projects to control nitrous, fuel injection and turbo
boost systems
160 PAGES
23 CHAPTE
RS
Fro m the
pub lish ers
of
• Switch devices on and off on the basis of signal frequency,
temperature and voltage
• Build test instruments to check fuel injector duty cycle, fuel mixture and brake and coolant temperatures
• Speedo Corrector, Turbo Timer & Digital Thermometer Projects
Price: Aust. $A19.80 plus $A10 P&P ($A12 P&P NZ; $A18 P&P elsewhere).
See the order form in this issue.
Intelligen
t
turbo timer
I SBN 095
852
9 7809
5
294 - 4
8 5229
4
$19.80 (inc GST)
TURBO B
OOST
& nitr
ous fuel co
ntrollers
6
NZ $22.00 (inc
GST)
How eng
in
manageme e
nt works
Order by phoning (02) 9939 3295 & quoting your credit card number; or fax the details to (02) 9939 2648;
or mail your order with cheque or credit card details to Silicon Chip Publications, PO Box 139, Collaroy, NSW 2097.
www.siliconchip.com.au
June 2003 63
|