This is only a preview of the June 2004 issue of Silicon Chip. You can view 17 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. Items relevant to "Dr Video Mk.2: An Even Better Video Stabiliser":
Items relevant to "An RFID Security Module":
Items relevant to "Fridge-Door Open Alarm":
Items relevant to "Courtesy Light Delay For Cars":
Items relevant to "Upgraded Software For The EPROM Programmer":
Purchase a printed copy of this issue for $10.00. |
Universal circuit fits all vehicles:
Courtesy
light delay
for cars
Give your car that luxury feel by extending
the time that your cabin lights remain on
once the car doors have closed. For that
extra touch of class, the lights fade to
darkness at the end of the time period.
By JOHN CLARKE
A
COURTESY LIGHT DELAY
is a great feature for your car.
It enables you to see to insert
the ignition key and find your seatbelt
when it is dark outside, without having
to leave the door open.
However, many cars lack this feature, particularly older models. When
the car door is opened, the cabin lights
do light up but as soon as the door is
closed, the lights go out. This happens
just when you are about to get settled
into the seat. Of course you can fumble
around and find the interior switch
but wouldn’t it be nice if the lights
stayed on automatically for a short
time instead?
And wouldn’t it be classy if the lights
faded out at the end of the timing period
instead of a sudden switch off?
Another feature that would be useful is to have the courtesy light(s)
automatically switch off whenever
the parking lights are switched on.
This would allow you to drive off if
ready to go, before the courtesy lights
had timed out.
The final feature of this new design
is its ease of installation. Past courtesy
siliconchip.com.au
light delay circuits have presented real
problems for installation because of
the various wiring combinations for
courtesy lights in modern cars.
In presenting this new design, we
particularly wanted solve the connection problems presented by the
popular “Electronics Australia” design
from the April 1997 issue. This design
needed to be built in one of four versions, meaning that it was a game of
chance if the car’s wiring configuration was not known. By contrast, in
our new design, the same circuit will
work in all cases.
Courtesy light circuits
The automotive industry is renowned for its lack of standardisation
when it comes to car wiring and this
is certainly revealed when it comes to
lighting circuits. Fig.1(a) and Fig.1(b)
show how the courtesy lights can be
wired. Some cars will have the lights
connected to the +12V supply rail
and the door switches connecting to
the car chassis, while other cars will
have the opposite connection, with the
courtesy lights connecting to chassis
and the door switches connecting to
the +12V rail.
Note that we have shown only two
lights and two switches. Some cars
will have more switches (one in each
door plus a manual courtesy switch
inside) and more lights. The switches
are all wired in parallel and extra lights
are also wired together in parallel.
All of the courtesy lights switch on
whenever one of the door switches
is closed. This occurs when a door is
opened. When all doors are closed,
all the switches will be open and the
courtesy lights will be off.
Similarly, the two possible tail light
connections are shown in Fig.1(c) and
Fig.1(d). The tail lights are on when
the lights switch is closed. This switch
would also power the parking lights
at the front of the car but this is not
shown in this circuit.
Main Features
•
•
•
•
•
•
•
Adjustable delay period from
7-40s
Lights fade out at end of time
period
Courtesy lights switch off if
parking lights switched on
No standby current drain from
battery when lights are off
Universal circuit works with
any 12V car system
Low parts count
Easy to install
June 2004 71
Fig.1(a)
Fig.1(b)
Fig.1(c)
Fig.1(d)
Fig.1: the two possible wiring configurations for the courtesy lights are
shown at Fig.1(a) and Fig.1(b), while Fig.1(c) and Fig.1(d) show the
alternative tail light wiring configurations.
For our Courtesy Light Delay circuit
to work, we simply need to connect
it across one of the door switches.
We also need to connect it to the tail
light wiring, so that the courtesy lights
are immediately switched off if the
tail lights are switched on during the
timing period.
In practice, this means that the
Courtesy Light Delay requires just four
connections to the car’s wiring. Two
wiring leads connect across the door
switch, while the other two connect
directly across one of the tail light
filaments.
How it works
Fig.2 shows the full circuit details
of the Courtesy Light Delay. It comprises a Mosfet (Q1), an optocoupler
(OPTO1), a diode (D1), a diode bridge
(BR1) and a few capacitors and resistors.
Q1 acts as a switch. It’s effectively
wired in parallel with the door switches and switches power to the courtesy
lights during the timing period, when
all door switches are open.
Fig.2: the circuit uses Mosfet Q1 to switch power to the courtesy lights
when the car’s door is closed (ie, the door switch opens). Trimpot VR1
sets the time delay, while bridge rectifier BR1 monitors the tail lights and
switches off Q1 via optoisolator OPTO1 if the tail lights are switched on.
72 Silicon Chip
Note that the door switches are
marked with plus and minus signs in
Fig.1(a) and Fig.1(b). The positive rail
of the delay circuit connects to the plus
side of the door switch, while the negative rail connects to the minus side.
In operation, the circuit derives its
power from the vehicle’s 12V battery
via the courtesy lamp filaments. As
a result, the lamps act as low-value
resistors in series with the supply.
However, because the circuit draws
so little current when it is operating,
there’s very little voltage drop across
the lamp filaments and so the circuit
operates from almost the full battery
voltage.
Note that the current flows via the
courtesy lamp filaments– it doesn’t
matter whether the lamp filaments
connect directly to the +12V supply
as shown in Fig.1(a) or to ground as
in Fig.1(b).
The circuit operation is as follows.
When a car door is opened, one of the
door switches closes and the courtesy
lights switch on as normal. During this
time, the switch shorts out Mosfet Q1
and so there will be no voltage across
the courtesy light delay circuit; ie,
between its plus and minus terminals. As a result, capacitor C1 will be
discharged via R1, while C3 will be
discharged via resistors R3 and R4.
Subsequently, when the door switch
opens again (ie, the door is closed), the
courtesy lights will go out and there
will be close to 12V across the drain
and source of Q1. This voltage also
immediately appears across a series
connected network consisting of capacitor C1, diode D1 and capacitor C2.
Initially, C1 has a much lower
impedance than C2, since it has 10
times greater capacitance – ie, 470µF
vs 47µF. As a result, C2 is rapidly
charged via C1 and so has almost the
full supply voltage across it soon after
power is applied to the circuit.
In practice, if we ignore the voltage
drop across diode D1, capacitor C1 will
initially have about 1.1V across it and
C2 will have 10.9V across it.
What happens now is that C1
charges to the 12V supply via resistor R1. During charging, the voltage
on the negative side of C1 gradually
drops to the negative supply rail. At
the same time, diode D1 prevents C2
from discharging since it is reverse
biased. As a result, C2 remains with
about 10.9V across it.
At this point we need to understand
siliconchip.com.au
how Mosfet Q1 works. These devices
have three terminals, called “gate”,
“drain” and a “source”.
When the gate voltage is at the same
voltage as the source, the Mosfet is off
and no current flows. However, when
the gate voltage rises to its threshold
of around 3-4V, the resistance between
the drain and source suddenly goes
low and so current can flow between
these two terminals. In practice, the
drain-source resistance depends on
the gate voltage and is at its lowest
(about 0.1Ω) when the gate voltage is
more than 10V above the source.
Now take a look at the circuitry
involving capacitor C3, resistors R3
& R4 and the optocoupler (OPTO1).
When power is first applied (ie,
when the door is closed), C3 initially
behaves like a short circuit (since it is
discharged). As a result, current flows
via R3 and switches on the transistor
inside the optocoupler, thus clamping
Q1’s gate at its the source voltage. At
this point, C2 has about 10.9V across
it (as already stated) but is prevented
from quickly discharging since it is
isolated from the optocoupler by resistor R2 (100kΩ).
Capacitor C3 now quickly charges
via resistors R3 & R4 and removes the
base drive to the optocoupler’s transistor about 1ms after power is applied.
However, this time period is so short
that it does not allow C2 to discharge
to any extent.
Now that the optocoupler’s transistor is off, Q1’s gate voltage will be
equal to the voltage that’s across C2.
As a result, Q1 switches on to drive
the courtesy lights.
From this, it might appear that the
courtesy lights will briefly switch off
when the door is closed, before the
circuit switches them back on again.
In theory, this is true but the “offtime” is so short that it is virtually
unnoticeable.
So why do we use the optocoupler
to briefly hold Q2’s gate low (ie, for
Fig.3: install the parts on the PC board as shown here, taking care
to ensure that the polarised parts are all oriented correctly.
that 1ms period)? The answer is that
without this feature, Q1 would switch
on as soon as C2’s voltage reached
the Mosfet’s conduction threshold of
3-4V. This would effectively “kill” the
supply to the circuit and prevent C2
from charging any further. C2 would
then quickly discharge via VR1 and
the 220kΩ resistor to below Q1’s gate
threshold and so the courtesy lights
would go out again almost immediately.
By contrast, by using the optocoupler to hold Q2’s gate low for 1ms, C2
charges to above 10.9V before Mosfet
Q1 switches on. And that means that
C2 must then discharge from 10.9V
down to below 4V before Q1 switches
off (and switches off the courtesy
lights).
The time it takes to do this gives us
the delayed on period for the lights.
VR1 allows this delay period to be
adjusted by varying the discharge
resistance for C2.
At the end of the timing period, the
lamp fades out as Q1’s resistance rapidly increases as its gate voltage falls
below about 5V. This means that the
voltage across Q1 gradually rises from
about 0V when it is fully on to 12V
when it is off. As a result, capacitors
C1 & C3 slowly charge to the 12V supply, via R1 and R3 & R4 respectively.
This slow rate of charge prevents C1
from recharging C2 and stops C3 from
switching the optocoupler’s transistor
on again.
Tail light circuit
As mentioned earlier, the circuit
turns the courtesy lights off immediately if the parking lights (or the
headlights) are turned on. This is
achieved using bridge rectifier BR1
and the optocoupler.
In practice, we don’t monitor the
parking lights or the headlights directly. Instead, the circuit monitors
the tail lights, since these are always
on with both the parking lights and
the headlights.
As shown, the bridge rectifier is
connected directly across the tail
lights (ie, in parallel with one of the
lamps). When the tail lights are on,
there is 12V across them and this is
applied to BR1, which then drives the
LED inside the optocoupler via a 680Ω
current-limiting resistor.
This in turn switches on the transistor inside the optocoupler and so Q1
switches off and the courtesy lights
go out.
So the optocoupler performs a dual
function: (1) it forms part of the initial
1ms delay circuit and (2) it plays a
vital role in switching off the courtesy
Table 1: Resistor Colour Codes
o
o
o
o
o
o
o
siliconchip.com.au
No.
1
1
1
1
1
1
Value
220kΩ
100kΩ
22kΩ
10kΩ
680Ω
470Ω
4-Band Code (1%)
red red yellow brown
brown black yellow brown
red red orange brown
brown black orange brown
blue grey brown brown
yellow violet brown brown
5-Band Code (1%)
red red black orange brown
brown black black orange brown
red red black red brown
brown black black red brown
blue grey black black brown
yellow violet black black brown
June 2004 73
they fit into the allocated holes. This
device is fitted with a small U-shaped
heatsink and the assembly is secured
to the PC board with a screw and nut.
The PC board is mounted inside
the case by simply clipping it into the
mounting clips. Before doing this, you
will have to mark out and drill two
holes in one end of the case, to allow
for wire entry to the screw terminals.
These holes are located 11mm down
from the lip and 18mm in from the
outside edge of the case and are made
using a 6mm drill.
Note: for 24V operation, change both
C1 and C2 to 470µF 25V and change
the 680Ω resistor to 1.2kΩ.
Installation
The completed PC board clips into the side pillars of a standard plastic case.
Note the small heatsink fitted to Mosfet Q1, to keep it cool.
lights when the tail lights are switched
on.
Note that the connections to the
tails-lights can be made without any
regard as to the polarity. That’s due to
BR1, which ensures that the positive
voltage rail is fed to the anode of the
Parts List
1 PC board, code 05106041, 78
x 46mm
1 front panel label
1 plastic box, 82 x 54 x 31mm
1 mini heatsink, 19 x 19 x 10mm
2 2-way PC board mount screw
terminals, 5.08mm spacing
1 M3 x 10mm screw & nut
Semiconductors
1 MTP3055E 14A 60V Mosfet
(Q1)
1 4N28 optocoupler (IC1)
1 W04 1.2A bridge rectifier (BR1)
1 1N914, 1N4148 diode (D1)
Capacitors
1 470µF 16V PC electrolytic (C1)
1 47µF 16V PC electrolytic (C2)
1 100nF MKT polyester (C3)
Resistors (0.25W 1%)
1 220kΩ
1 10kΩ
1 100kΩ
1 680Ω
1 22kΩ
1 470Ω
Miscellaneous
Automotive wire, connectors,
mounting brackets, etc.
74 Silicon Chip
optocoupler’s internal LED.
The wiring arrangement of the tail
light circuit is also unimportant since
the circuit simply monitors the voltage
across the lamps.
Construction
All the parts for the Courtesy Light
Delay are mounted on a PC board
coded 05106041 (78 x 46mm). This
then clips into a standard plastic case
measuring just 82 x 54 x 31mm.
Fig.3 shows the assembly details.
Begin by checking the PC board for
any shorts between tracks or breaks
in the copper. That done, remove the
corners of the PC board if this hasn’t
already been done, so that the board
clears the four pillars inside the case.
Now for the parts assembly. First,
install the resistors in the positions
shown, followed by diode D1 and the
optocoupler (OPTO1). Table 1 shows
the resistor colour codes but it’s also
a good idea to check each one using a
digital multimeter before installing it
on the board.
Take care when installing D1 and
OPTO1 – they must be oriented as
shown (see also Fig.1 for the device
pinouts).
Next, install trimpot VR1 (this may
be coded 105), then install the three
capacitors, bridge rectifier BR1 and
the two 2-way terminals. Again, check
to make sure that BR1 and the two
electrolytic capacitors (C1 & C2) are
oriented correctly.
Finally, install Mosfet Q1 by bending its leads at right angles so that
The Courtesy Light Delay can be
mounted in any convenient location
under the dashboard. It’s up to you
how you secure it, since the circumstances will vary from vehicle to
vehicle.
To connect the unit, you will need
to access one of the car door switches
and the tail light connections. Note
that some door switches will have two
wires, while others will only have a
single wire connection. In the latter
case, one contact is connected directly
to chassis at the switch mounting
position.
Note also that it’s important to get
the door switch connections to the unit
the right way around – ie, the positive
door switch connection must go to the
positive rail of the Courtesy Light delay. You can quickly determine which
is the positive door switch connection
by using your multimeter to measure
the voltage across the door switch
when it is pushed open.
If there’s only a single wire running
to the switch, this will be the positive
(the chassis connection is negative).
It’s a good idea to disconnect the
vehicle’s battery before running the
wiring, to prevent any inadvertent
short circuits. Note that all wiring
should be run using proper automotive
cable and connectors.
The “Tail lights” terminals on the
Courtesy Light Delay are simply connected across one of the tail lights. You
can access this wiring either directly
at the tail lights or at the lights switch
or the fusebox.
Alternatively, you can connect these
terminals across one of the parking
lights at the front of the car. It doesn’t
matter which way around you connect
siliconchip.com.au
Fig.4: here are full-size artworks for the PC board
etching pattern and for the front panel.
them, since the bridge rectifier automatically caters
for both polarities (as explained previously).
Once the wiring is complete, reconnect the battery
and check that the courtesy lights remain on after the
door is closed. Now turn the parking lights on – the
courtesy lights should immediately go out again.
You can now trigger the courtesy lights again and
set the “lights-on” delay period using VR1. Turning
VR1 clockwise will increase the delay period.
Troubleshooting
If the courtesy lights are always on, it may be because the door switch terminals have been connected
with reverse polarity. If that happens, the courtesy
lights turn on via the intrinsic reverse diode inside
Q1. Simply swapping the leads to the door switch
will fix this problem.
If the lights do not remain on after the door is closed
(and the connections are correct), check that there
is no voltage applied to the “Tail light” terminals on
the PC board. If there’s no voltage here, the problem
will be on the PC board itself.
The first step is to carefully check the copper side of
the board for missed solder joints and solder bridges
between adjacent tracks. That done, check that all
components are oriented correctly and that they are
in their correct positions.
Finally, check that there is 12V between the drain
and source terminals of Q1 when the door switches
are open (ie, with the doors closed). If there is no
voltage here, check your wiring back to the door
SC
switch.
siliconchip.com.au
June 2004 75
|