Source code for Arduino Uno app, used for converting distributor based Nissan engines to more modern coil on plug ignition. SR20-engine is used in master branch, but many other distributor based Nissan engines can be converted.
This application samples in two distributor signals, 'Camshaft Reference' & 'Camshaft Position', hereby refered to as 'CR' & 'CP'. It then syncs the firing sequence to Cylinder 1, and ignores CP information after sync has been achieved. It then alternates 4 digital outputs depending on which cylinder should fire. The digital outputs enter a separate logic AND component with the ECU Ignition signal, and the resulting signal is finally led to the correct coil on plug.
Coil on plug (COP) is a more modern way of starting the combustion process. This guide will not go into a full explanation of what COP is, so lets just list a few advantages of using COP versus classic distributor systems
Depending on your skill level, the hardest part of converting to COP will be the mechanical side. The wiring is not for beginners, but it's easy to follow the premade schematics.
If you go with smart coils you will need:
If you go with dumb coils you will need:
Arduino prerequisites:
If you want to convert another type of Nissan engine you first need to modify the number of pulses used for sync. Here is a great read which explains some of the different trigger discs found in various Nissans: http://datsun1200.com/modules/mediawiki/index.php?title=Nissan_Optical_CAS This application can easily be modified to work with the following Nissan engines:
SR needs 6 pulses https://www.youtube.com/watch?v=OISRDuSyMRY
-SR20DE Distributor: 6 pulses
-SR20DE Distributor(w coil): x pulses
-SR20VE Distributor: x pulses
-SR20 CAS: x pulses
To use the code for your engine type, verify how many small CP pulses occur during the large CR window. The code row that needs to be modified is the one inside the ISR1: "if (pos > 6)" Change this value to the correct amount of pulses for your engine.
The firing order is defined at the beginning of the code, inside a global variable. The default firing order is (1-3-4-2). If needed this can be modified to suit the engine you are using.
Schematics:
Electrical drawings for SR-style engine can be found as .png files in the repository.