This is only a preview of the March 1996 issue of Silicon Chip. You can view 28 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:
Items relevant to "Programmable Electronic Ignition System For Cars":
Items relevant to "Automatic Level Control For PA Systems":
Articles in this series:
Items relevant to "A 20ms Delay For Surround Sound Decoders":
Articles in this series:
|
Programmable
Electronic Ignition
System For Cars
From time to time, many enthusiasts wish that
they could vary the ignition advance curve or
alter the dwell angle on the distributor of an old
car or motorbike. This simple but sophisticated
system will readily meet those needs.
By ANTHONY NIXON
This user programmable ignition
system can be easily integrated with
the SILICON CHIP High Energy Ignition
System (see May 1988), or readily
adapted to suit other systems. Its main
features are listed in Table 1.
As shown in the photographs, the
Ignition Programmer is built on a small
PC board which carries a keypad. All
data is entered via this keypad, so that
22 Silicon Chip
new advance curves and dwell angles
can be quickly programmed. To simplify the circuit and make construction
easy, the unit is based on the versatile
PIC16C84 microprocessor.
The following parameters can be
programmed into the system:
• The revs (RPM) at which ignition
advance begins;
• The revs (RPM) for full advance;
•
•
•
•
•
•
Maximum advance angle;
Rev limit;
Dwell angle;
Vacuum advance;
Number of cylinders; and
A 2-digit security code.
A useful feature of the system is that
it allows two sets of data to be entered,
either of which can be selected when
the ignition is turned on. For example, the module can accommodate
an engine which runs on both petrol
and gas, as it allows the timing to be
quickly changed for these different
fuels to get the best performance.
How it works
The circuit (see Fig.1) is fairly
simple, thanks to the PIC microprocessor (IC1). In operation, ignition
timing information from the points
Fig.1: the circuit is based on a PIC16C84 programmed microprocessor (IC1).
This processes timing information from the points (or some other pick-up) and
drives the High Energy Ignition System to switch the coil.
Table 1: Main Feat
ures
• User programmable
• Keypad data entry
• Security coded (2 di
gits)
• Can store two sets
of data
• Tachometer drive ou
tput
• Points or other sens
or input
• Automatic coil curre
•
•
nt switch
nning
off if motor not ru
7-segment LED di
splay
LED indicator for
initial timing
setup
conditioning circuitry on the High
Energy Igni
tion module is fed into
pin 1 (RA2) of IC1, while the ignition
coil is controlled from pin 2 (RA3).
This pin 2 output drives the coil via
the “business-end” of the High-Energy
Ignition System.
The keypad used is a standard 12key unit with * and # symbols. Its rows
connect to the RB3-RB6 outputs of the
microprocessor, while its columns
go to RB0-RB2. As it operates, the
microprocessor alternately takes its
RB3-RB6 outputs high and low. Thus,
when a key is pressed, the logic level
is sensed by one of the inputs RB0RB2 and the microprocessor takes the
appropriate action.
For example, if key “3” is pressed,
then RB3 of IC1 (pin 9) will be connected to RB2 (pin 8). Resistors R5-R7
(10kΩ) normally pull RB0-RB2 low.
RA4 (pin 3) of IC1 is the vacuum advance input, while S1 is a microswitch
which is actuated by the vac
uum
advance motor (see photo). When the
manifold vacuum is high, S1 is held
open and RA4 is pulled high via R8
(10kΩ). Conversely, when the vacuum
is low, S1 is closed and RA4 is pulled
low so that the microprocessor retards
the timing.
The 7-segment display is driven
from IC2, a 74HC164 serial-to-parallel
shift register. This receives serial information from pin 17 (RA0) of IC1 and is
clocked from pin 18 (RA1). It displays
such things as errors, programmable
system variables and which set of data
will be used.
IC3, an MC34064 undervoltage
sensing circuit, is used to ensure that
the microprocessor resets reliably
when the ignition is turned on. An
8MHz crystal, in conjunction with
C6, C7 & R4, sets the microprocessor
clock, while LED1 is driven from pin
13 (RB7) to provide points status indication (ie, it indicates whether the
points are open or closed).
The power supply uses a series
diode (D1) for reverse polarity protection, a zener diode (ZD1) to clip
any large spikes, and a 5V 3-terminal
regulator (REG1). The latter provides
a +5V supply rail for the ICs.
Fig.2 shows how the Programmer
Module interfaces with the SILICON
CHIP High Energy Ignition System. As
shown, the voltage across the points
is filtered and fed to Q2’s base via D5
and a 10kΩ resistor. The signal at the
collector has a 5V logic level and this
is the “POINTS” input signal to the
microprocessor on the programmer
module. The “COIL” output from the
programmer module is used to trigger
IC1, the MC3334 ignition chip.
IC1 in turn drives Q1 which is the
coil switching transistor. Zener diodes
D1-D4 protect Q1 from the high voltage
spikes generated by the back EMF of
the coil.
Ignition timing
In older engines, the centrifugal
force generated by weights spinning
in the distributor causes the engine
March 1996 23
Fig.2: here’s how the Ignition Programmer module interfaces with the High
Energy Ignition System. The coil output triggers the MC3334 ignition chip (IC1)
and this in turn drives the coil switching transistor (Q1).
timing to advance with increasing
revs. Additionally, a vacuum advance
mechanism increases the advance as
the manifold vacuum rises. This either
adds to or subtracts from the centrifugal advance, so that varying degrees
of advance are obtained for different
engine speeds and loads.
Electronic advance
In this system, the centrifugal advance is calculated according to engine RPM, while the vacuum advance
is either on or off, as determined by
the logic level on the vacuum advance
input (RA4, pin 3) of the microprocessor.
Because the advance is now determined electronically, the mechanical
centrifugal advance mechanism in
the distributor is clamped in the fully advanced position. To do this, the
advance weight return springs are
removed and the weights themselves
are wired so they are held in the fully
out position. In addition, the movable
vacuum advance plate must be clamp
ed so that it can’t move when the
vacuum actuator is removed.
In operation, the Ignition Programmer retards the ignition timing from
its preset maximum value, to give the
correct amount of advance to suit the
operating conditions.
As already mentioned, microswitch
S1 is operated by the vacuum advance
motor. It operates when the required
vacuum is reached in the intake manifold (note: this system is also used on
some production engines).
24 Silicon Chip
Rev limiting is achieved by excessively retarding the ignition when the
preset value is reached. All other variables are then ignored until the engine
revolutions fall below this value.
Microprocessor functions
Instead of generating look-up tables
for engine data, the program calculates
a set of variables based on the data
entered by the user and stores these
in the PIC’s internal EEPROM. When
the motor is sensed to be running, the
microprocessor uses these variables
to generate the timing of the output
waveform.
Some of the microprocessor’s ignition functions include monitoring the
engine RPM, advance timing, dwell
pulse width, maximum RPM, vacuum
advance pulse width and number of
cylinders. As all but the last of these
are dynamic and constantly changing,
the processor has to continuously
recalculate new data.
It is interesting to note that to create
the various pulse widths and functions while the engine is running, the
microprocessor only executes about 50
bytes of code and takes about 30µs to
do it. Most of the program memory is
taken up by the user interface, while
the rest is used for data generation, the
serial display and setup.
When the ignition routine is first
activated, the coil is turned on. If
the motor is not started within 10
seconds, the coil will switch off and
the system will enter MENU mode.
This eliminates the possibility of any
damage to the coil caused by leaving
the ignition on, without the motor
running.
The coil will also be switched off
if the motor stalls. In this case, the
system will stay in the ignition routine
and wait for the engine to be restarted
or the power to be switched off.
Construction
The Ignition Programmer is easy to
build, since all the parts except for
microswitch S1 are installed on a PC
board coded 05103961. Fig.3(a) shows
the parts layout on the PC board.
As always, check the PC board for
open circuit or bridged tracks before
you begin assembly. This done, fit
the resistors, diodes and sockets for
IC1 and IC2, then install the capacitors and other components. The LED
display plugs into a wire-wrap socket
(install this at full lead length), while
the keypad plugs into an 8-pin header
socket.
Make sure that the LED display is
correctly oriented when plugging it
into its socket – it must be mounted
with the decimal point(s) towards the
bottom of the board. The 8MHz crystal
can be mounted either way around but
take care with the polarity of the ICs
and LED1 – the anode lead of LED1
will be the longer of the two.
It will be necessary to solder a wire
to the +5V stake which is adjacent to
pin 18 of IC1 before you fit the keypad.
The keypad on the prototype was
secured using machine screws and
nuts (use nylon washers on the track
Fig.3(a): install the parts on the PC board as
shown here and take care if using a different
keypad to that shown – see text.
side of the board, to prevent shorts).
Adjust the assembly so that the keypad
is parallel to the PC board when it is
plugged into its pin header socket.
There’s just one wrinkle here – many
keypads have their connections at the
bottom instead of at the top. If you have
this type of keypad, then it’s simply a
matter of running a length of 8-way
ribbon cable between the keypad and
the PC board.
Note, however, that the pin connections to the keypad matrix will differ
from keypad to keypad. The numbers
Fig.3(b): this is the full-size etching pattern for
the PC board. Check the board carefully for
defects before installing any of the parts.
in brackets on the circuit diagram
(Fig.1) indicate the connections for
a Jaycar keypad (Cat. SP-0770) – (ie,
pin 2 of the keypad goes to pin 6 on
the PC board, pin 7 goes to pin 8, etc).
If you buy some other keypad (eg,
the Altronics Cat. S-5381), then use
the data supplied with the unit to
determine the connections.
Once the assembly is complete,
check all your soldered joints carefully and check the polarity of D1.
When you are satisfied that all is OK,
connect 12V from a power supply or
car battery to the terminals adjacent
to the keyboard connector.
Installation
The exact installation will depend
on your particular vehicle. If the unit
is going in a car, the programmer could
be mounted on the dashboard or centre
console. Note that the microprocessor
board should not be installed under
the bonnet, as the components used
are not rated for high temperatures.
For a motorbike installation, the unit
could be mounted in a weatherproof
box on the handlebars.
Be sure to run all wiring
in a professional manner,
using proper automotive
connectors to ensure reliability.
Fig.4 shows how the
unit is interfaced to the
SILICON CHIP High Energy Ignition System. Note
that it will be necessary
Fig.4: this diagram
shows how the Ignition
Programmer is connected
to the High Energy
Ignition (HEI) module.
Note that it is necessary to
remove some parts from
the HEI board if you are
adapting an existing unit.
March 1996 25
Make sure that all parts are
correctly oriented when building
the PC board and don’t forget the
wire link next to crystal X1.
to remove a number of parts from the
centre of the board if you are adapting
an existing ignition module.
Fig.5 shows the mounting details for
the microswitch S1. It is mounted on
a rightangle bracket which is attached
to the vacuum motor. The arm of the
microswitch sits in a slot cut into the
vacuum motor actuator and, in the
absence of vacuum, is normally held
Fig.5: the microswitch (S1) is mounted on the vacuum motor using a
right-angle bracket. At low vacuum (ie, ignition off or at high engine
loads), the microswitch arm is held down. Conversely, when the
manifold vacuum is high (ie, at light engine loads), the microswitch
arm is released.
26 Silicon Chip
down. When vacuum is present, the
actuator moves upwards and the microswitch arm releases.
Be sure to connect the leads to the
microswitch contacts exactly as shown
(ie, the lead from pin 3 of the microprocessor goes to the contact marked
“NO”). As mentioned previously, the
advance plate in the distributor must
be clamped at the maximum advance
position (see photo).
When the ignition is timed (using
a timing light), the vacuum advance
must be disabled. This is accomplished by removing and blocking the
vacuum hose, so that it can have no
effect on the vacuum switch.
To time the ignition with the engine
stopped, turn the crankshaft to the
correct position, then rotate the distributor until the LED just turns on.
This indicates that the points have just
opened. The LED will be off when the
microprocessor detects that the points
are closed.
Note that because the LED drive
signal frequency is proportional to the
engine RPM, this signal can be used to
drive a suitable tachometer.
Operation
When the module is initially powered up, it will enter one of three states.
These are as follows:
(1). If there is no valid data in the
EEPROM, the system will enter the
MENU mode and the display will show
“-”. This is what should be displayed
at the initial power up.
(2). If there is valid data but no security code has been programmed, the
system will begin its ignition routine
and wait until the motor is started.
The display will show the selected
data channel.
If the “9” key is pressed before the
motor is started, the system will exit
the ignition routine and enter the
MENU mode to enable the user to
make data changes. This option will
not work after the motor has been
started.
(3). If there is valid data and a security code has been programmed, the
display will be blank and the system
will not oper
ate until the security
code is entered. It will then show the
selected data channel.
If a mistake is made when entering
the first digit, you can press the “#”
key, then enter the digit again. This
function does not work for the second
digit, however. If it is entered incor
rectly, the microprocessor shuts down
until it is reset by turning the power
off and on again.
MENU access using the “9” key is
as detailed in (2) above.
The keypad used in the prototype has its connecting pads at the top and plugs
directly into the connector on the PC board. If you use a Jaycar or Altronics
keypad with the pads at the bottom of the unit, the connections will have to be
run using ribbon cable. Note, however, that the pin connections to the keypads
will be different (see text).
Keypad modes
(1) Keypad Power-up Mode: if key
7 is pressed while powering up, the
alternative channel is selected (other
keys have no function).
(2) Keypad Security Mode (after
power is first applied and if data is
valid):
Key
Function
#
Enter/exit code entry
0-9
Code entry (2 digits)
*
No function
(3) Keypad Ignition Mode (ignition on,
engine not running and data valid):
Key
Function
9
Enter menu mode
Other
No function
When the system is initially turned
on and no data has been entered into
the internal EEPROM, the ignition
won’t work. The system switches to
MENU mode automatically and this
is indicated by the display coming on
with only the centre segment lit.
When in MENU mode, the keypad
functions are as shown in the follow
ing list:
This close-up view shows how the microswitch arm is normally held down by
the vacuum motor actuator. The common contact (COM) of the microswitch is
connected to ground, while the NO contact goes to the PC board.
March 1996 27
are shown. Data needs to be entered
in the following manner, taking care
to enter the digits properly and in the
correct sequence:
Variable
Data
Digits
Allocated
Start advance RPM
800
4
Finish advance RPM
2000
4
Advance angle
30°
2
Cylinders
2
2
Dwell angle
30°
2
Rev limit RPM
5000
2
Vacuum advance angle 10°
2
Security code
59
2
Because all timing in now controlled electronically, the advance plate inside the
distributor must be securely clamped in the fully advanced position. In effect,
the Ignition Programmer retards the timing from this preset maximum to give
the correct value according to engine speed and load.
Key
1
2
3
4
5
6
7
8
9
*
0
#
Menu Mode
Clear EEPROM
Clear RAM data
Read RAM data
Write EEPROM data
to RAM
Enter new data to
RAM
Clear display
No function
Display data set
selected at power-up
(1 or 2)
No function
Create ignition data
No function
Exit to ignition
A more detailed explanation of
these various keypad functions is as
follows:
• Key 1: Clears the user data stored
in EEPROM.
• Key 2: Clears the user data stored
in RAM.
• Key 3: Displays the data stored in
RAM. Each data value entered has a
letter assigned to it. A decimal point
lights with the letters, to help differentiate between them and the numbers
while they are being viewed.
The data functions indicated by the
letters are as follows:
28 Silicon Chip
A. – RPM at start of advance
b. – RPM at end of advance
C. – Advance angle
d. – Number of cylinders
E. – Dwell angle
F. – Rev limit
G. – Vacuum advance angle
H. – Security code
To cycle through the data, press the
“*” key. After the security code has
been shown, the display wraps around
to the RPM at start of advance again.
To exit this display mode, press the
“#” key. No other keys has any effect
while reading data.
A typical example display is as
follows: A.0800, b.2000, C.30, d.02,
E.30, F.50, G.10, H.59.
Key
Data Read
0-9
No function
*
Cycle to next data
#
Exit data read routine
• Key 4: Gets the data from EEPROM
and puts it into RAM. To view this
data, press the “3” key and use the
“*” key to cycle through the data, as
explained above. Any data previously
in RAM will be overwritten.
• Key 5: Enters new data into RAM.
Initially, an “A” will be dis
played
to indicate the first data entry. For
simplicity, and as internal memory
is limited, no further letter delimiters
This data is entered exactly as follows: 0800 2000 30 02 30 50 10 59
There are a few things to note here:
(1) No further letter delimiters after
A are shown;
(2) After entering the security code,
“-” is displayed, indicating the end of
data entry;
(3) There are leading zeros for the
Start Advance RPM and for the Cylinder;
(4) 50 is entered for the 5000 RPM
limit; and
(5) Make sure that you don’t forget
the security code!
If valid data is detected on power-up with a non-zero value in the
security code, then this code must be
entered when the system is to be used
–eg, turn ignition on, press #, press
5, press 9 (code from data above).
The ignition routine will now begin
and the display will show the data
set selected.
If an incorrect code is entered, the
ignition routine will not begin and no
further response will be available from
the keyboard. Turning the ignition off
and then on again will allow the code
to be re-entered.
If you forget the code, the only way
to gain access to the system is to start
entering the 100 combinations one
by one.
Another example, this time with no
security code, is shown below:
Variable
Data
Digits
Allocated
Start advance RPM
650
4
Finish advance RPM
1500
4
Advance angle
12°
2
Cylinders
8
2
Dwell angle
0°
2
Rev limit RPM
4500
2
Vacuum advance angle 9°
2
Security code
None
2
Example Programming Sequence
A complete programming sequence (with no data entered) is as follows:
Action
Turn power on
Press 5
Enter all data
When finished
Display
A
DATA
-
Reviewing Data
Press 3
A
?
DATA
-
Press *
Press #
Calculate & Store Data
Press *
if OK
if error
& delimiters
finish reading
display flashes
?
if OK
when finished
if error
?
A
?
DATA
-
if OK
if error
if OK
if error
& delimiters
finish reading
Review EEPROM
Press 4
Press 3
Press *
Press #
To program the second data set, first turn the power off and then turn it on again
with key 7 pressed. The data is then programmed in and reviewed exactly as set
out above.
This data is entered exactly as follows: 0650 1500 12 08 00 45 09 00.
As well as the previous items
noted, if a zero dwell angle is entered, then a 1ms dwell angle will
be set automatically. If any angle is
calculated to be less than 1ms, then
1ms will be used. In addition, as the
engine RPM increases, a point will
be reached when the dwell width is
theoretically less than 1ms. When the
microprocessor detects this, it sets the
minimum to 1ms.
Important note: the dwell angle
referred to above is the angle through
which the points are open and not the
angle through which they are closed,
as is normally the case. The dwell
angle from any input device has no
effect on the system dwell setting.
However, it is good practice to set the
points normally, as specified by the
manufacturer. The microprocessor
debounces the input, whether points
or electronic sensors are used.
•
Key 6: Clears the display, so that it
shows “-”.
• Key 7: No function.
• Key 8: Shows current data set selected (1 or 2).
• Key 9: No function.
• Key *: Calculates and stores, in EE
PROM, new data that the system will
use when the ignition routine is active.
Valid data must have been entered by
the user. Care should be taken when
choosing this data, as values which
are too far away from standard may
not work with the system. Memory
constraints prohibit all but minor error
checking of input data.
If the number of cylinders is entered
as zero then an error will occur in the
calculations, as this will result in an
internal division by zero.
Data entry can be aborted by pressing the “#” key. If this is done, no
calculations can occur and there will
be no data in RAM which can be read.
Nor can it be stored in EEPROM.
PARTS LIST
1 PC board, code 05103961, 76
x 70mm
1 12-key keypad (see text)
1 8MHz crystal (X1)
1 8-pin PC male connector
(6mm pins)
1 8-pin PC female connector
(6mm shroud)
1 14-pin wire wrap IC socket
1 18-pin IC socket (for IC1)
4 3mm x 20mm bolts
12 3mm hex nuts
4 3mm insulating washers
9 PC stakes
Semiconductors
1 PIC16C84 programmed
microprocessor (IC1)
1 74HC164 shift register (IC2)
1 MC34064 power-on reset (IC3)
1 78L05 regulator (REG1)
1 1N4002 diode (D1)
1 1N4745 16V 1W zener diode
(ZD1)
1 LTS312 common anode
7-segment LED display (DS1)
1 red LED (LED1)
Capacitors
1 100µF 25VW PC electrolytic
1 47µF 25VW PC electrolytic
3 0.1µF 100VW MKT polyester
2 18pF ceramic
Resistors (0.25W, 1%)
6 10kΩ
9 1.5kΩ
1 2.2kΩ
1 22Ω
Note: the programmed micro
processor can be purchased for
$27.00 including postage from Mr.
A. Nixon, 20 Eramosa Road East,
Somerville, Vic. 3912.
Note that the display will flash
while it is calculating the new variables, then turn off when finished.
One major limitation of the system
is that the total value of the advance,
dwell and vacuum advance angles
must not exceed the angle between
cylinders. If this did happen, the
microprocessor would still be in the
middle of controlling the timing sequence from the previous trigger when
the points opened again. This in turn
would force new parameters to be
calculated, which would overwrite the
old ones and cause erratic operation.
In practice, this is not a problem
March 1996 29
angle of 15°, the dwell angle results
in a distributor angle of 30°, and the
vacuum angle results in a distributor
angle of 15°. This gives a total distributor angle of 60°, which is well over
the 45° maximum.
A more suitable set of parameters
would be:
Variable
Start advance RPM
Finish advance RPM
Advance angle
Cylinders
Dwell angle
Rev limit RPM
Vacuum advance angle
Security code
The completed unit can be installed on the dashboard or centre console, or fitted
into a weatherproof case and mounted on a motorbike. Do not mount the unit
under the bonnet, as the parts are not rated for high temperatures.
unless some “out of the ordinary”
values are entered, especially for
an 8-cylinder engine. The following
example explains this more clearly:
Variable
Start advance RPM
Finish advance RPM
Advance angle
Data
800
2000
30°
Cylinders
Dwell angle
Rev limit RPM
Vacuum advance angle
Security code
8
30°
5000
30°
59
The cylinder angle for an 8-cylinder
engine is 45°. From the above data, the
advance angle results in a distributor
Data
800
2000
12°
8
20°
5000
10°
59
The total distributor angle now becomes 31° and this represents reasonable ignition timing for an 8-cylinder
engine.
• Key 0: No function.
• Key #: This key terminates the
data entry mode while entering data.
Alternatively, it exits to the ignition
routine if valid data is available while
in MENU mode.
If a keypress error occurs, then ?
will be displayed. Keypress errors are:
(1) Pressing key 3 with no RAM data;
(2) Pressing key 4 with no EEPROM
data;
(3) Pressing key * with no data entered;
(4) Pressing key # with no valid
SC
data.
Fitting The Programmable Ignition System To A Motorbike
I have tested this system on a 1948
Harley Davidson motorcycle which
originally only had a twist grip advance retard on the handlebars.I also
replaced the points with a Hall Effect
transducer and thereafter had a fully
programmable, maintenance-free
ignition system. The major problem
was how to run it off a 6V supply
and this was overcome with a small
switchmode supply.
Another problem that I encountered was that the microprocessor
behaved erratically while the engine
was running. The solution involved
removing the old copper-core plug
leads and replacing them with suppressed ones.
The program as it stands at the
moment can only support distributors
30 Silicon Chip
that have even spacing between
cylinder angles – which covers most
vehicles. However, engines that have
irregular spacing (eg, Harley V Twins
with two cylinders and a 45° angle)
will fool the processor into retarding
the timing for one of the cylinders.
This is because the processor will
calculate an advance value for one
cylinder but the calculated value for
the other cylinder will be different
because the two cylinders are not
equally spaced at 180° around the
crankshaft. In my case, a spe
cial
program was written to cater for this.
If you want to eliminate the points,
one option is to strip down the existing
distributor and modify it for electronic
operation. Alternatively, you can use
a secondhand electronic unit from a
wrecker if one is available.
One advantage of keeping the
points is that if the electronics decide
to fail, the points can be connected
directly to the coil and the ignition
retarded (by rotating the distributor)
to provide a limp-home mode.
The next stage of development
would be to eliminate the distributor
completely and use the crank position as the timing reference. A crank
sensor is certainly favourable when it
comes to installing an electronic system but cost is another consideration
– a “distributorless” ignition requires
one dual output coil for every two
cylinders and these would be fed by
their own driver circuits, which in turn
would be controlled by dedicated pins
on the microprocessor.
|