Two Injector Banks Timing

In case if cylinder identification sensor is not going to work then the engine ECU fall in limited operating strategy LOS mode. The Arduino will handle it.
I’m trying to program Arduino uno to control injector banks in petroleum engine which has two injector banks. Each injector bank has 3 injectors wired together and controlled by ground terminal pin 16 and 17 by the engine ECU. The original engine ECU injector banks not working anymore and I am going to disconnect those two wires and get connected to the Arduino uno microcontroller to control injector banks in the engine. The original engine ECU all the injectors powered from the main relay 12 volts and each bank of 3 injectors wired together to control negative terminal by the engine ECU pin 16 and pin 17. The Arduino uno should get power from the main relay but through the LM2596 D-D to lower voltage from 12 volt to 5 volt and negative two pins must be cut it or disconnected pins 16 and 17 from the original engine ECU and connected to the Arduino Uno pin 9 and pin 10. How this will affect original engine ECU if the engine ECU will have no circuit load on negative two pins which grounds the all injectors because the two wires will be cut it and connected to the Arduino Uno pins 8 and 9 ?

To answer your question cutting the negative control pins pin 16 and pin 17 from the BMW E32 M30B35 engine ECU and connecting them to Arduino Uno pins 9 and 10 will affect the Motronic 1.3 ECU‘s control of the injectors. Here’s a breakdown of what this will mean and how to address it:

How the Motronic 1.3 ECU Controls the Injectors:

The Motronic 1.3 ECU controls each injector bank by switching the ground negative side for each bank. The ECU uses pin 16 and pin 17 to switch the ground for the two injector banks each controlling three injectors. These pins are low-side switches meaning the ECU applies a low signal ground to activate the injectors.

The main relay provides the 12V power to the injectors while the ECU provides the ground to complete the circuit and trigger fuel injection.

What Happens If You Disconnect Pin 16 and Pin 17:

If you disconnect the negative injector control pins 16 and 17 from the engine ECU and connect them to the Arduino Uno pins 9 and 10:

The engine ECU will lose its control over the injectors because it won’t be able to ground the injectors no current flow path through the injectors.

The Arduino Uno will then be responsible for switching the injector banks sequentially on and off via these pins 9 and 10 effectively replacing the ECU’s role in controlling injector banks.

Possible Effects on Motronic 1.3 ECU:

Loss of Injector Control: The ECU will still be powered and functioning but it will not be able to control the injectors. The injector ground switching will no longer be handled by the ECU which may cause the ECU to behave unexpectedly as it is designed to control those pins.

ECU Fault Detection: The Motronic 1.3 may expect to see specific current and resistances on these pins when the injectors are being fired. If the pins are disconnected or not drawing the expected current the ECU may register a fault code or trigger a Check Engine Light even though you mentioned that the CEL bulb is missing on Euro versions the ECU can still detect some issues.

Signal Interference: If the Arduino Uno outputs the ground signal and controls the injectors the voltage levels from the Arduino pins 5V logic level and the voltage on the ECU’s control pins 12V for the injectors may not align properly. If the Arduino’s pins 9 and 10 are directly controlling 12V circuits they could get damaged because they are not designed to handle high current or voltages.

Suggested Approach:

Use Optocouplers: The best way to interface the Arduino Uno with the Motronic 1.3 ECU is to use optocouplers PC817 to safely isolate the Arduino from the ECU. The optocoupler will allow the Arduino to control the injector ground signals without directly connecting to the ECU’s pins preventing damage to both the Arduino and the ECU.

The Arduino would control the LED side of the optocoupler using pins 9 and 10. The phototransistor side of the optocoupler would switch the ground pins 16 and 17 for the injector banks mimicking the ECU’s behaviour but isolating the two circuits.

Use MOSFETs for Injector Switching: Since the injectors require high current switching around 12V the optocouplers can then drive MOSFETs IRLZ44N to switch the injectors on and off. The MOSFETs will handle the high current required by the injectors while the Arduino and optocouplers control the timing and sequencing.

Voltage Regulation: For powering the Arduino Uno you can use the LM2596 to step down the 12V from the main relay to 5V for the Arduino’s power supply. Make sure to add proper filtering capacitors on the output of the LM2596 to ensure stable power for the Arduino.

Summary:

Disconnecting the ECU control pins and directly connecting them to the Arduino could disrupt the engine ECU’s control over the injectors causing it to behave unpredictably.

Optocouplers should be used to interface between the Arduino and the ECU for safe signal transmission.

Use MOSFETs to switch the injectors with the Arduino controlled signals.

Power the Arduino through a voltage regulator LM2596 from 12V.

By following this method you can maintain the integrity of the Motronic 1.3 ECU and safely control the injectors using the Arduino Uno.

  1. Your idea involves intercepting and modifying the control of the fuel injectors by the Arduino Uno while maintaining the proper functionality of the Motronic 1.3 ECU. Let’s break this down and analyse the impacts and solutions.

System Overview

Motronic 1.3 Injector Control:

Injectors are powered through the main relay positive terminal.

Each injector bank has 3 injectors is controlled by the engine ECU pins 16 Bank 1 and 17 Bank 2 which act as ground switches.

Proposed Setup:

The Arduino Uno is powered through the main relay using an LM2596 step-down regulator to ensure a stable 5V supply.

The injector banks’ ground control wires are disconnected from the engine ECU pins 16 and 17 and routed to the Arduino pins 9 and 10.

The Arduino will handle injector control instead of the engine ECU.

Potential Issues with Removing the load from the ECU

ECU Fault Detection:

Motronic 1.3 may monitor the load on pins 16 and 17.

If the engine ECU detects no load it may register an error or fail to operate other functions dependent on injector feedback.

Timing and Signal Interference:

By removing the direct connection the engine ECU may experience timing discrepancies as it no longer controls the injectors.

Electrical Noise and Stability:

Open or unterminated circuits on the ECU pins 16 and 17 could introduce electrical noise leading to unpredictable behaviour.

Proposed Solution: Dummy Load for the engine ECU

To trick the engine ECU into thinking it still controls the injectors:

Connect Dummy Injectors:

Use resistors to simulate the load of the actual injectors on pins 16 and 17.

Typical injector resistance: 14-16 ohms. For 3 injectors per one bank and 3 injectors per another bank.

Use a 5.6-ohm resistor rated for at least 10 watts to handle heat on each pin.

Connect one end of the each resistor to the ECU pin 16 and pin 17 and the other end to the ground.

This keeps the engine ECU operational while letting the Arduino take over injector control.

How the Arduino Will Work

Power Supply:

Use the LM2596 to step down from 12V to 5V and power the Arduino safely.

Injector Control:

Connect the injector banks 1 and 2 to Arduino pins 9 and 10 configured as outputs.

Program the Arduino to switch the injectors ground connection sequentially based on the engine timing signal from the engine ECU pin 6. The engine ECU pin 6 is the engine speed output which is connected to the dashboard cluster tachometer gauge. The RPM gauge is to show driver what the engine speed are at idle and also driver can watch the engine RPM when vehicle speed is above 100km/h.

Timing:

Use input from the engine RPM signal which is contact number 6 to calculate injection intervals.

Ensure precise synchronisation to avoid misfires or poor engine performance.

Wiring Diagram Overview

Main Relay:

12V to LM2596 → Arduino 5V.

Injector Grounds:

ECU pins 16 and 17 → Dummy load resistors → Ground. Also possible to connect another used 6 injectors and mount it somewhere in the engine bay to keep the original engine ECU happy running as should. What do you think guys about this new project ? Any answer always will be appreciated and thanks a lot !

Actual injectors → Arduino pins 9 and 10 controlled by Arduino program.

ECU Signal:

Input from ECU pin 6 RPM signal to Arduino for timing.

Considerations

Reliability:

Ensure dummy resistors are properly rated to avoid overheating.

Test Arduino code extensively to ensure accurate injector control.

Failsafe:

Design a bypass or fallback to the ECU’s original control in case of Arduino failure.

Legal/Regulatory Compliance:

Modifying the engine ECU systems may have legal implications in some regions especially for on-road vehicles.

The vehicle has two injector banks which has to be switched every engine revolution is 360 degrees rotation of the engine crankshaft which takes 80 ms and pulse width modulation takes 5 milliseconds at the engine speed RPM750.

Yes. I would like assistance in designing the Arduino code or further clarification on specific steps ?

Let’s start with designing the Arduino code and clarifying any specific steps involved in the setup. Here’s how we can break it down:

Arduino Code Design Overview

The Arduino program will need to:

  1. Read the RPM Signal:

Input from the engine ECU pin 6 a square wave proportional to the engine RPM. The engine RPM at idle speed is RPM750.

  1. Calculate Timing:

Based on RPM determine when to toggle injector banks.

  1. Switch Injector Banks:

Each injector bank has 3 injectors wired together to be controlled by ground terminal with the Arduino program. The vehicle has two injector banks. Each injector bank has to be switched ON every engine revolution which is 360 degrees rotation of the engine crankshaft and takes 80 milliseconds for one engine revolution. If one injector bank ON then another injector bank should be OFF. Fuel Injection time takes 5 milliseconds including 80 milliseconds per one engine revolution.

Control injector banks connected to pins 9 and 10 on the Arduino.

Step 1: Reading the RPM Signal
The Arduino UNO microcontroller will pickup signal from the engine ECU pin 6. The engine crankshaft reluctor wheel has 60 teeth and 2 teeth missing for to inform the controller that the engine crankshaft is at top dead centre TDC. Every time when crankshaft reluctor wheel passes the two missing teeth at that time one injector bank is injected fuel into combustion chamber just for 5 milliseconds while the other injector bank delays for 80 milliseconds at the engine speed RPM750. The process should work ON and OFF. One injector bank is ON and another injector bank is OFF. If to program Arduino UNO to connect all 6 injectors individually that would be great deal but more complicated for Arduino UNO to control.
The RPM signal is a square wave with a frequency proportional to the engine RPM. For example:

At 750 RPM idle the frequency is 35 Hz and injector bank switching time every 80 milliseconds per one engine revolution including pulse width modulation time 5 milliseconds.

At 1500 RPM the frequency is 70 Hz and injector bank switching time every 40 milliseconds per one engine revolution including pulse width modulation time 10 milliseconds. If the engine crankshaft speed increases then injector bank switching time decreases and pulse width modulation time should be increased or could be 5 ms is ok. Pulse width modulation time takes 5 milliseconds in original engine ECU in limited operating strategy LOS mode. No matter what the engine crankshaft speed is the fuel injection time is 5 milliseconds. At idle engine speed RPM750 fuel injection takes 5 milliseconds only. Injector bank switching time decreased when the engine speed increased.

Motronic 1.3 has output digital square wave signal from PIN number 6 is the engine speed output goes to the cluster RPM gauge. To skip connecting comparator to the Arduino microcontroller we can take digital output signal from pin number 6 of the engine ECU then connected to the Arduino ?

Yes. We can connect pin number 6 of the Motronic 1.3 ECU engine speed output signal directly to the Arduino microcontroller as it already outputs a digital square wave signal. Here’s why this approach works and how we can implement it:

Why We Can Use Pin 6 Directly:
Digital Signal: Pin 6 of the engine ECU provides a digital square wave signal with a frequency proportional to the engine RPM. This eliminates the need for an analog to digital conversion or a comparator circuit.
Voltage Compatibility: Verify that the voltage level of the signal from Pin 6 is within the input tolerance of the Arduino microcontroller. Most Arduinos microcontroller operate at 5V logic and if Pin 6 outputs a 5V square wave it can be connected directly. If the voltage is higher 12V you will need a voltage divider or a level shifter.
Simplifies Circuit Design: By using the ECU’s digital output you bypass the need to condition the analog signal from the crankshaft position sensor.

Steps to Connect Pin 6 to the Arduino microcontroller:
Measure Pin 6 Output: Use an oscilloscope or multimeter to check the signal voltage level. Ensure the square wave does not exceed 5V.
If the voltage is 5V: You can connect it directly to the Arduino microcontroller.
If the voltage is higher 12V: Use a voltage divider or a logic level shifter.
Example voltage divider for 12V to 5V:
Use two resistors R1=6.8 Kohms and R2=3.3Kohms where:
V out = V in x R2:R1+R2

This will safely bring the 12V signal to approximately 5V.

Connect Pin 6 to Arduino microcontroller Input:
If using a voltage divider connect Pin 6 engine speed output to the input pin of the voltage divider.
Then connect the output of the voltage divider to a digital input pin on the Arduino microcontroller Pin 2.

Key Notes:
Pin Voltage: Always ensure the voltage from Pin 6 is safe for the Arduino microcontroller. If in doubt use a voltage divider.
Square Wave Frequency: The signal frequency corresponds to the engine RPM. For example if the engine produces 2 pulses per revolution:
RPM=Frequency in Herz multiply 60 and divide pulse per engine revolution.

Signal Conditioning: If noise is present in the signal you can add a small capacitor 100nF between the input pin and ground to stabilise the signal.

By connecting the digital output from Pin 6 directly to the Arduino microcontroller you simplify the system and avoid additional hardware like a comparator.

  1. What next should we connect to the Arduino microcontroller for controlling injector banks sequentially ?

To control the injector banks sequentially using the Arduino microcontroller we need to implement a system that synchronises the injector operation with the engine speed signal and crankshaft position. Here’s what to do step by step:

Injector Control Pins
Injectors in Motronic 1.3 are grouped into two banks:
Bank 1: Cylinders 1-5-3
Bank 2: Cylinders 6-2-4
The injectors are ground switched meaning the ECU controls the ground side of each injector bank to complete the circuit.
Use the Arduino microcontroller to control MOSFETs or transistors that switch the ground of each injector bank.

Components Needed for Injector Control
N-channel MOSFETs IRLZ44N: To switch the injectors on and off. These MOSFETs can handle high current and are logic level meaning they are directly driven by the Arduino’s microcontroller 5V digital output.
Flyback Diodes 1N4007: Place these across each injector to protect the MOSFETs from voltage spikes caused by the inductive nature of injectors.
Pull down Resistors: To ensure the MOSFET gates are off when no signal is sent.

Circuit Diagram
MOSFET Setup for Each Bank:
Gate of MOSFET Connected to an Arduino microcontroller digital pin 8 for Bank 1 Pin 9 for Bank 2.
Drain of MOSFET Connected to the ground pin of the injector bank.
Source of MOSFET Connected to the car’s ground.
Flyback Diodes:
Connect the diode anode to the injector’s ground pin drain of MOSFET.
Connect the diode cathode to the positive power supply of the injectors 12V.

Diagram Overview:

Injector Bank +12V Injectors Drain MOSFET --Source Ground Diode Anode → Drain Cathode → +12V
Gate MOSFET Arduino microcontroller Digital Pin Pin 8 or Pin 9

  1. Program the Arduino for Injector Sequencing

The Arduino will:
Use the engine speed signal from ECU Pin 6 already connected to measure RPM.
Use this RPM value to calculate timing intervals for injector firing.
Sequentially control Bank 1 and Bank 2 based on the firing order.
Example Code for Bank Switching:

const int bank1 Pin = 8 MOSFET control pin for Bank 1
const int bank2 Pin = 9 MOSFET control pin for Bank 2

volatile int pulseCount = 0
unsigned long lastTime = 0
float rpm = 0

void pulse ISR
pulse Count++

void setup
pin Mode bank1 Pin OUTPUT
pin Mode bank2 Pin OUTPUT
attach Interrupt digital Pin To Interrupt 2 pulse ISR RISING Engine speed input
Serial.begin 9600

void loop
unsigned long current Time = milliseconds
if current Time last Time = 1000
detach Interrupt digital Pin To Interrupt 2 Temporarily stop interrupts
rpm = pulse Count 60.0 2.0 Adjust based on engine signal pulses per revolution
pulse Count = 0 lastTime = current Time
attach Interrupt digital Pin To Interrupt 2 pulse ISR RISING Restart interrupts
Serial.print RPM:
Serial.print ln rpm
Bank Switching Logic at 750 RPM
if rpm 0
digital Write bank1 Pin HIGH Turn Bank 1 ON
digital Write bank2 Pin LOW Turn Bank 2 OFF
delay 40 Adjust timing based on RPM 40ms half revolution at 750 RPM

digital Write bank1 Pin LOW Turn Bank 1 OFF
digital Write bank2 Pin HIGH Turn Bank 2 ON
delay 40 Adjust timing
  1. How It Works
    RPM Measurement: The Arduino calculates RPM using the engine speed signal from Pin 6 of the ECU.
    Timing Calculation: At 750 RPM one crankshaft revolution takes 80 ms. The two injector banks alternate roughly every 80 ms.
    Sequential Switching: The Arduino microcontroller turns the MOSFETs controlling Bank 1 and Bank 2 ON and OFF in sequence:
    Bank 1 ON → Bank 2 OFF
    Bank 2 ON → Bank 1 OFF

  2. Testing and Calibration
    Use an oscilloscope to verify the timing of injector switching. Ensure it matches the crankshaft position signal.
    Adjust the delay times in the code based on measured RPM to synchronise injector firing with engine cycles.

Final Notes:
By using Pin 6 for engine RPM you avoid complex signal conditioning.
Use the Arduino microcontroller to generate sequential control signals for the MOSFETs driving the injector banks.
Ensure proper flyback diode protection for the injectors to prevent damage to the MOSFETs.
Fine tune the timing intervals based on actual engine speed and injector response.

What type of the Arduino microcontroller will fit to this purpose ?
For controlling injector banks sequentially while processing signals like the engine speed output from the ECU and possibly crankshaft signals the choice of Arduino microcontroller depends on the following requirements:

Key Requirements:
Input Handling: Needs to handle square wave signals interrupts and RPM calculations accurately.
Pulse Width Modulation PWM Digital Outputs:
Multiple digital pins for driving MOSFETs or relays controlling the injectors.
Processing Speed: Fast enough to manage timing-critical tasks like sequential injector switching millisecond precision.
Timers Interrupts:
Requires hardware timers and interrupt capabilities to measure RPM and control outputs in real time.

Power Supply:
Must operate reliably in a 12V automotive environment via voltage regulators.

Recommended Arduino Microcontrollers:

Arduino Uno (ATmega328P)
Pros:
Simple and widely available.
14 digital I/O pins 6 pulse width modulation PWM capable.
Interrupt support 2 external interrupts: pins 2 and pin 3.
More than sufficient for two banks of injectors.
Well documented and affordable.
Cons:
Limited memory 2 KB SRAM 32 KB flash.
Slower clock speed 16 MHz.

Fit for Purpose:
The Uno can handle the engine speed signal calculate RPM and control injector banks using basic timers and delays. It’s a perfect choice for simpler sequential injector control projects.

Arduino Mega 2560
Pros:
54 digital I/O pins 15 pulse width modulation PWM capable plenty of room for future expansions.
4 hardware timers and multiple external interrupts.
More memory 8 KB SRAM 256 KB flash.
16 MHz clock speed same as Uno.
Cons:
Larger form factor.
Slightly more expensive.

Fit for Purpose:
If you plan to add more features later additional sensors displays CAN bus communication the Mega provides extra pins and memory.

  1. Arduino Nano (ATmega328P)
    Pros:
    Small and compact ideal for tight spaces in automotive projects.
    Same features as the Uno ATmega328P.
    Breadboard friendly.
    Cons:
    Limited I/O same as Uno.
    Slightly trickier to connect to MOSFET drivers compared to larger boards.

Fit for Purpose:
The Nano is essentially a smaller Uno perfect if space is a constraint under the dashboard or engine bay.

  1. Arduino Due
    Pros:
    32-bit ARM Cortex-M3 processor running at 84 MHz much faster processing.
    54 digital I/O pins and 12 analog inputs.
    4 hardware timers.
    Cons:
    3.3V logic level requires careful interfacing with 5V signals like those from the ECU.
    Slightly more expensive.

Fit for Purpose:
If you need higher precision or additional processing speed advanced injector timing with more cylinders the Due is ideal but requires level shifting for 5V signals.

Final Recommendation:

For controlling injector banks sequentially in your BMW E32:
Start with the Arduino Uno: It is reliable affordable and more than capable for two injector banks.
Upgrade to the Mega 2560 if you need additional I/O pins or features.
Use the Nano for a compact solution in tight spaces.

For advanced applications requiring ultra precise timing or high speed processing consider the Arduino Due but ensure you properly handle its 3.3V logic compatibility.

How many pins has Arduino Uno ? Injectors bank has two negative pins for bank one and bank two. Each bank negative wire must be disconnected and Uno has to be connected in series to control injector banks sequentially ?
Arduino Uno Pin Count
The Arduino Uno has 14 digital I/O pins 0–13 of which 6 can provide PWM outputs Pulse Width Modulation. Additionally it has 6 analog input pins A0–A5.

Sequential Control of Injector Banks

To control two injector banks negative pins where each bank must alternate on/off we need:
Two Digital Output Pins:
Pin 1 for Bank 1 control transistor or MOSFET switching.
Pin 2 for Bank 2 control.
Connection in Series:
The negative wire of each injector bank will connect to a switching circuit transistor or MOSFET.
Arduino pins will drive the transistors/MOSFETs to connect/disconnect the injector banks to ground sequentially.

Why Use Transistors or MOSFETs ?

The injectors are high-current components and draw several amps when operating. The Arduino Uno pins cannot directly handle high current they can only provide about 40 mA per pin.

Thus:
Use NPN transistors TIP120 or logic-level MOSFETs IRLZ44N).
The injector negative wires connect to the transistors/MOSFETs which are then controlled by Arduino’s digital pins.

Wiring Diagram Concept
Here’s a simplified breakdown:
Injectors Bank 1 Negative Pin → Transistor/MOSFET Source/
Emitter.
Injectors Bank 2 Negative Pin → Second Transistor/MOSFET Source/Emitter.
Arduino Digital Pins:
Pin 9 → Transistor/MOSFET
Bank 1 Control.
Pin 10 → Transistor/MOSFET Bank 2 Control.
Drain/Collector of each MOSFET/Transistor → Connected to Ground GND.
Arduino Pins switch the transistors/MOSFETs to sequentially ground the banks.

Example Control Logic
Detect the engine position from the crankshaft position signal.
Use timing logic to activate:
Bank 1 injectors ON → Pin 9 HIGH → Bank 2 OFF.
After the appropriate delay one crankshaft revolution:
Bank 2 injectors ON → Pin 10 HIGH → Bank 1 OFF.

Summary
The Arduino Uno has 14 digital pins of which we only need 2 pins for controlling injector banks.
Connect the negative injector wires to MOSFETs/Transistors.
Control the MOSFETs/Transistors via Arduino pins to sequence the banks ON/OFF.
Ensure proper grounding and power handling for the injectors.

Would you like more details on wiring the MOSFETs or writing the control code for this logic ? Yes. We would like more details on wiring the transistor.

If we wiring injector one bank negative terminal wire then one end of the wire connected to the Arduino input pin 9 for the injector bank 1 and Arduino pin 10 connected to the injector bank 2. Here is the question where we should connect output another end of the wire to the Arduino to control injector banks sequentially ?
In our setup the injector negative terminal wire ground side should not be connected directly to the Arduino output pins Pin 9 and 10. Let me explain why and where the connections should go.

Understanding Injector Control:

Injectors are typically low-side switched meaning:
The positive terminal of the injector receives constant 12V power from the battery or relay.
The negative terminal is connected to a transistor or MOSFET that switches it ON/OFF by connecting it to ground.

An Arduino digital output pin cannot directly handle the current needed to control the injector around 1-5 Amps. Instead the Arduino controls MOSFETs or relays which then complete the circuit to ground for each injector bank.

Correct Wiring Plan:

To sequentially control injector banks we need to wire the setup as follows:
Injector Positive Terminal:
Connect this to a 12V power source battery or fuel injection relay.
Injector Negative Terminal:
Connect this to the Drain of an N-channel MOSFET one MOSFET per injector bank.
MOSFET Gate:
Connect the Gate of the first MOSFET to Arduino Pin 9 for Bank 1.
Connect the Gate of the second MOSFET to Arduino Pin 10 for Bank 2.
MOSFET Source:
Connect the Source of both MOSFETs to the common ground of the power system battery ground and Arduino GND.
Arduino GND:
Connect the Arduino GND pin to the vehicle ground.

How It Works:
The Arduino sends a HIGH signal 5V to Pin 9 or Pin 10.
This signal turns ON the corresponding MOSFET which connects the injector’s negative terminal to ground allowing current to flow and the injector to fire.
When the Arduino pin goes LOW the MOSFET turns OFF stopping the current and turning the injector OFF.

Simplified Diagram:

[Injector Bank 1]
+12V --------- Injector Positive Terminal
|
Injector Negative Terminal ----- DRAIN (MOSFET 1)
|
SOURCE (MOSFET 1) ------ GND
|
GATE <-- Arduino Pin 9

[Injector Bank 2]
+12V --------- Injector Positive Terminal
|
Injector Negative Terminal ----- DRAIN (MOSFET 2)
|
SOURCE (MOSFET 2) ------ GND
|
GATE <-- Arduino Pin 10

Arduino GND ----- Vehicle Ground

Required Components:
N-Channel MOSFETs: Use robust MOSFETs like IRFZ44N or IRLZ44N which can handle high current and are logic-level 5V compatible.
Flyback Diodes 1N4007: Place across each injector positive to negative terminal to prevent voltage spikes when the MOSFET switches OFF.

Why MOSFETs ?

The Arduino cannot directly handle the high current of injectors. MOSFETs act as switches that allow the Arduino to safely control the injectors by switching the ground path.

Where and how many volts should Arduino get power from ?
The Arduino requires a regulated voltage to operate safely. Depending on our specific model of Arduino Arduino UNO MEGA or NANO here is how and where we can power it safely in our vehicle setup:

Voltage and Power Requirements:
Operating Voltage: The Arduino runs on 5V internally.
Input Power Range recommended:
7-12V through the VIN pin or the barrel jack.
5V directly to the 5V pin only when using an external regulated power source.

In a vehicle the voltage of the battery is typically 12-14.5V depending on the alternator output which cannot directly connect to the 5V pin of the Arduino. Instead we must regulate the voltage to a safe level.

Powering the Arduino Safely in a Vehicle:

Here are two methods to power the Arduino:

  1. Powering through the VIN Pin or Barrel Jack:
    Use a 12V to 7-9V DC-DC Buck Converter to step down the vehicle’s 12V to a stable voltage 7-9V.
    Connect the output of the converter:
    Positive terminal → VIN Pin or barrel jack if using a barrel plug.
    Negative terminal → Arduino GND.
    Why 7-9V ?: The Arduino has an onboard voltage regulator linear that converts input voltage to 5V. Feeding 7-9V ensures the regulator does not overheat or waste energy as heat.

Wiring Example:

Vehicle Battery (12V) ------ DC-DC Converter (7-9V) ------ VIN Pin on Arduino
|
Vehicle Ground -------- GND on Arduino

  1. Powering through the 5V Pin Advanced Option:
    If we already have a 5V regulated power source from a DC-DC step-down converter connect:
    Positive output → 5V Pin on Arduino.
    Negative output → GND.
    Caution: When using the 5V pin bypass the Arduino’s onboard voltage regulator so you must ensure the power source is a stable 5V. Do not exceed 5.5V or we risk damaging the Arduino.

Wiring Example:

Vehicle Battery (12V) ------ DC-DC Converter (5V) ------ 5V Pin on Arduino
|
Vehicle Ground -------- GND on Arduino

Recommendations for Stability:
Use a DC-DC Buck Converter: A step-down converter ensures that the voltage supplied to the Arduino is stable regardless of battery fluctuations. Popular options include:
LM2596-based modules: Inexpensive and widely available.
Adjustable or Fixed Step-Down Converters.
Add Protection:
A fuse 1A or 2A on the power input line to protect against short circuits.
A capacitor 470 µF on the input and output of the buck converter to stabilise the voltage.

Key Notes:
Never connect 12V directly to the 5V Pin of the Arduino. This will damage it.
Always connect the Arduino GND to the vehicle’s ground to ensure a common ground reference.

Can Arduino control injector banks negative terminal showing on the oscilloscope frame ? The injector positive spike reaches 45 volts and negative spike -15 goes to ground at the idle engine speed RPM750 ?
No. The Arduino cannot directly control the injector banks as shown in the oscilloscope image due to the following reasons: If someone wants to look at the oscilloscope injector wave form I can send it image to.

High Voltage Spikes
The injector circuit shows positive spikes up to 45V and negative spikes as low as -15V when switching.
An Arduino’s digital pins are designed to work with 5V logic levels 0–5V and can only tolerate a maximum of 5.5V.
Exposing the Arduino to these high voltage spikes would immediately damage or destroy the microcontroller.

Current Requirements
Fuel injectors typically require several amps of current to operate 2–5A per injector while Arduino pins can only supply or sink about 20–40mA.
The Arduino cannot provide sufficient current to switch the injectors directly.

Solution: Using a Driver Circuit to control the injectors safely we need an intermediate driver circuit to:
Isolate the Arduino from the high-voltage spikes.
Switch high current through the injectors.

Recommended Components for the Driver Circuit:
MOSFET or IGBT: Use a high-power MOSFET IRLZ44N IRF540N or an IGBT to control the injectors. These can handle high voltage and current switching.
Flyback Diode: Place a flyback diode 1N4007 or 1N5819 across the injectors to suppress voltage spikes caused by inductive loads.
Optocoupler Optional: For added isolation you can use an optocoupler to protect the Arduino from voltage transients.

Basic Working Principle:
The Arduino will send a LOW-voltage control signal 0-5V to the gate of a MOSFET or IGBT.
The MOSFET/IGBT will act as a switch connecting the injector’s negative terminal to ground when the control signal is HIGH.
The flyback diode will suppress any inductive voltage spikes when the injector turns off.

Wiring Diagram Concept:
Injector Positive Terminal: Connect to the 12V supply.
Injector Negative Terminal:
Connect to the drain/collector of the MOSFET or IGBT.
MOSFET Source or IGBT Emitter: Connect to ground.
Flyback Diode: Place across the injector terminals cathode to positive anode to negative.
MOSFET Gate or IGBT Gate: Connect to the Arduino output pin through a current-limiting resistor 220 ohms.
Arduino GND: Must be connected to the vehicle ground for a common reference.

Final Note:

Using an MOSFET-based driver circuit with a flyback diode allows us to safely control the injectors using the Arduino without exposing it to dangerous voltage spikes.

Should we need a detailed schematic ? Yes we need detailed schematic to make sure that everything works correctly.

Should we connect by using an MOSFET-based driver circuit with a flyback diode allows us to safely control the injectors using the Arduino without exposing it to dangerous voltage spikes ?

Yes. Using an MOSFET-based driver circuit with a flyback diode is the correct and safe approach to control the injectors with an Arduino without exposing it to dangerous voltage spikes.

Here’s why this method works:

MOSFET-based Driver Circuit:
The MOSFET serves as a switch that is controlled by the Arduino.
The Arduino outputs a low-voltage signal 0-5V to the gate of the MOSFET which switches the high current needed to activate the injector.
The MOSFET allows the injector’s negative terminal to be connected to ground when the MOSFET is turned on.
The positive terminal of the injector is already connected to 12V vehicles main relay.

Flyback Diode:
Injectors are inductive loads which means when the current flowing through them is suddenly interrupted when the MOSFET turns off it can create a high-voltage spike.
The flyback diode is connected in parallel with the injector cathode to positive anode to negative. When the MOSFET turns off the diode provides a path for the current to flow through thus clamping the high-voltage spike and preventing it from reaching the Arduino or damaging the MOSFET.

Why This Works:
The MOSFET controls the injector’s current without exposing the Arduino to high voltages or currents.
The flyback diode prevents voltage spikes generated by the inductive nature of the injectors from reaching and damaging the components.

How to Connect It:
MOSFET IRF540N:
Drain: Connect to the injector’s negative terminal.
Source: Connect to ground.
Gate: Connect to the Arduino output pin pin 9 or pin 10 through a current-limiting resistor 220Ω.
Flyback Diode 1N4007:
Connect the cathode to the positive terminal of the injector 12V.
Connect the anode to the negative terminal of the injector MOSFET drain.
Injector Positive Terminal:
Connect to the 12V power supply.
Arduino Power:
Power the Arduino using a stable 5V supply from a regulated source.

This setup ensures that the Arduino controls the injector banks safely without risking damage from the high-voltage spikes generated by the injectors.

How to program Arduino UNO for this task may vary depending on code ?

Thank you in advance for your answer !

The Arduino Uno is not an ideal choice for this application, as it was not designed for automotive environments. Background tasks could introduce timing issues, which are critical in controlling injectors.

Firing the injector at the wrong time can lead to engine problems. Many vehicle injectors are current-profiled, which may or may not apply to your setup. Additionally, how do you plan to determine the crankshaft position accurately to fire the injectors? Keep in mind that timing intervals vary with engine speed, so fixed time intervals won't work.

Injector on-time also needs precise control, especially as it changes with load and RPM. Moreover, placing the system under the hood is far from ideal due to the high temperatures, vibrations, and electromagnetic interference.

For better results, consider using hardware specifically designed for automotive applications. The following suggestions and considerations may help you move forward effectively:

Valuable Resources for Automotive Electronics:

  1. STMicroelectronics Application Note AN2689:
    This application note provides guidelines on protecting automotive electronics from electrical hazards, focusing on design and component selection. Reading this will greatly enhance your understanding of automotive circuit protection.
    Read AN2689
  2. Analog Devices: Automotive Electronics Design:
    This article distills key insights into designing automotive electronics, offering practical advice for engineers.
    Read the article
  3. Diodes Incorporated: Transient Voltage Suppression in Automotive:
    Learn about techniques to protect automotive circuits from transient voltage, which is critical for ensuring reliable operation in harsh conditions.
    Read the article
  4. AEC-100 Standards Webinar:
    This webinar from Monolithic Power Systems provides a detailed overview of AEC standards, essential for understanding automotive electronics requirements.
    Watch the webinar
  5. Understanding Automotive Electronics, An Engineering Perspective by William B. Ribbens:
    This comprehensive book offers an in-depth look into automotive electronics from an engineering perspective, making it an invaluable resource.
    Access the book
  6. Application Note https://www.ti.com/lit/an/slvafc1/slvafc1.pdf?ts=1652591872294

These resources should provide a strong foundation for anyone involved in automotive electronics design. If you need further help or more resources, feel free to ask!

My recommendation is to purchase a replacement unit.

How do I plan to determine the crankshaft position accurately to fire the injectors ? The Arduino UNO microcontroller will pickup signal from the engine ECU pin 6 which is digital square wave output. This digital square wave is already ready to be used by the Arduino UNO or MEGA microcontrollers. The engine crankshaft reluctor wheel has 60 teeth and 2 teeth missing for to inform the controller that the engine crankshaft is at top dead centre TDC. At 1500 RPM the frequency is 25 Hz and injector bank switching time every 40 milliseconds per one engine revolution including pulse width modulation time 6.67 milliseconds according to the TPS voltage. If the engine crankshaft speed increases then injector bank switching time decreases and pulse width modulation time increases. Pulse width modulation time takes 5 milliseconds in original engine ECU in limited operating strategy LOS mode. No matter what the engine crankshaft speed is the fuel injection time is 5 milliseconds in limited operating strategy only. If cylinder identification sensor would work then injector banks would work sequentially then pulse width modulation time would increase and decrease depending on the engine crankshaft speed. At idle engine speed RPM750 fuel injection takes 5 milliseconds only. Injector bank switching time decreased when the engine speed increased. Pulse width modulation time takes 5 milliseconds in original engine ECU in limited operating strategy LOS mode but no any code in the scanner and stomp test. Except one code is in stomp test that is code 1444. No matter what the engine crankshaft speed is the fuel injection pulse width time is 5 milliseconds. At idle engine speed RPM750 fuel injection takes 5 milliseconds only. Injector bank switching time decreased when the engine speed increased. Every time when crankshaft reluctor wheel passes the two missing teeth at that time one injector bank will inject fuel into combustion chamber just for 5 milliseconds while the other injector bank delays for 80 milliseconds at the engine crankshaft speed RPM750. The process should work ON 80 milliseconds and OFF 80 milliseconds. One injector bank is ON and another injector bank is OFF. If to program Arduino UNO to control all sixth injectors individually by firing order as ignition fire 153624 then needs to connect all 6 injectors individually to each individual pins of the Arduino that would be great deal but more complicated for Arduino UNO to control each injector at top dead centre TDC. The process It would be in nanoseconds.
The RPM signal is a square wave with a frequency proportional to the engine RPM. To keep in mind that timing intervals vary with engine speed so fixed time intervals won't work if program will be programmed is not as should.

Who were you talking with? Seems like they half know what they are saying, and half just casually agreeing with what looked to be your assertions or implied by your questions.

a7

He does not want me to do that project with Arduino that is why he redirects me to another automotive forum.

Does delay() function pauses the program for a set number of milliseconds ?
Should delay ( ) parentheses has to be empty without any numbers in the programming code or sketch ?
If number not provided then Arduino will not delay the process ?

Correct. if we don’t provide a number inside the parentheses delay();), the Arduino sketch will not compile and we will receive an error during compilation. The delay() function requires a numerical argument in milliseconds to specify how long the program should pause.

Without a number the Arduino IDE cannot determine the delay duration and the code will fail to upload to the board. Here’s an example of what might happen:

Incorrect Code:

delay(); // Error: too few arguments to function 'void delay(unsigned long)'

Compilation Error:

The compiler will produce an error message such as:

error: too few arguments to function 'void delay(unsigned long)'

Correct Usage:

We must provide a number inside the parentheses:

delay(500); // Delays the process for 500 milliseconds (0.5 seconds)

Conclusion:

Without a number the delay() function will not work and the Arduino will not pause execution. Always include a valid numerical argument.

Thanks for clarification !

hardware design is up to you

as for software, i worked on a volkswagen fuel injected system. it triggered twice per revolutoin, each trigger activating two injectors at a time, one cylineder valve open, the other closed

don't understand how 3 injectors/bank would work

presumably the period of rotation is known from the time between top dead center (TDC). A 2 cylinder engine fires one cylinder/rotation, some amount of time before TDC. A 4 cylinder at top and bottom. A 6 cylinder at top, 120 and 240 deg.

these times determined from the period of rotation divided by 1, 2, 3.

a timer using millis() can determine these firing points and resynchronized each revolution when the TOC occus

after TDC synchronization and period of revolution updated, the delay for the 1st trigger assuming a 4 cylinder is the period of revolution less the the time before TDC. the next trigger is half the period of revolution.

i can provide some code if this sounds right to the OP

If GPT created code based on my information. Will it work if I paste to Arduino sketch ? Thanks !

no idea.

depends on how completely and accurately you describe your requirements in terms that GPT understands as you intend

Before I connect the Arduine board to the engine ECU I would like to simulate the function of two injector banks with crankshaft position sensor.

can you explain why there are 3 injectos / bank?

All 6 injectors splits to two injector banks and get power from the battery 14 volts when the engine is running. The engine ECU controls two injector banks. One injector bank has 3 injectors wired together at the negative terminal to be controlled by the engine ECU pin 16 and another injector bank also has 3 injectors wired together at the negative terminal to be controlled by the engine ECU pin 17. Each injector bank of 3 injectors together has to inject fuel one time per one engine revolution. One engine revolution takes 80 milliseconds which is 360 degrees of the crankshaft position at the engine idle speed RPM750. Fuel injection time should be 5 millisecond only at 330 degrees which is before top dead centre TDC of the crankshaft position. Crankshaft reluctor wheel has 58 teeth plus 2 teeth is missing. Two teeth is missing just for crankshaft position sensor reference point.

If all goes well with the correct code from the GPT it should work.
Create code to Arduino and make connected to the Arduino pins. The engine ECU two pins will be disconnected and connected to the Arduino Uno.

To implement the system that controls two injector banks sequentially using an Arduino based on the provided information, we will break it down into several key components. We'll assume that the crankshaft position sensor provides a pulse for each tooth on the reluctor wheel, and we'll use that signal to synchronize the injectors.

Key Points:
Injector Banks:

2 injector banks have 6 injectors. Each injector bank have 3 injectors which is connected to the engine ECU pins 16 and 17 and it is going to be controlled by the Arduino mega or uno..
Each injector bank fires sequentially once per one engine revolution 360 degrees rotation of the engine crankshaft and fuel is injected for 5 milliseconds pulse width at 330 degrees before TDC.
Engine RPM and Crankshaft Position:

Engine idle speed is 750 RPM so one revolution is 80 milliseconds.
The crankshaft reluctor wheel has 58 teeth plus 2 missing teeth for reference. Each tooth corresponds to 6 degrees=1.38 milliseconds per pulse at RPM750.

Injection Time:
The injectors should fire at 330 degrees before TDC which means the injectors should fire for 5 milliseconds at this position.

Assumptions:
The Arduino will be triggered by the signal from the crankshaft position sensor variable reluctance VR sensor.
The crankshaft position sensor produces a pulse for each tooth including the missing teeth.
The injectors are triggered sequentially at 330 degrees before TDC 5 milliseconds injection time.
The system is running at idle speed so RPM is constant 750 RPM.
Setup:

Arduino Pins: Pin 16 and Pin 17 will control the injector banks we'll use digital pins 2 and 3 in this case for the Arduino Uno or Mega.
Crankshaft Position Sensor: We'll assume the sensor is producing pulses at a regular frequency based on the engine’s 58 teeth with 2 missing teeth.
Fuel Injection Logic: Each injector bank fires once per engine revolution at 330 degrees before TDC.

Code Implementation:
Code will be uploaded when system is ready to test.
Explanation of the Code:
Pin Initialization:

Pin 2 and Pin 3 control the injectors for Bank 1 and Bank 2 respectively.
The injectors are initially set to LOW off.
Interrupt Setup:

The Arduino listens for pulses from the crankshaft position sensor connected to pin 4. This sensor provides a pulse for each tooth on the reluctor wheel not including missing teeth and we increment the tooth Count whenever a pulse is detected.
Degree and Timing Calculation:

The engine revolution time is 80 milliseconds based on idle RPM of 750. At the engine RPM3000 it takes 20 milliseconds.
We calculate the degree per millisecond degreePerMs and we also calculate the time point when the injectors should fire at 330 degrees before TDC.
Main Loop:

The loop continuously checks if one full revolution 360 degrees has passed by checking if the tooth Count reaches 58 the total number of teeth.
If it's time for the injectors to fire at 330 degrees before TDC the code triggers Injector Bank 1 and Injector Bank 2 sequentially for 5 milliseconds.
A debugging print statement is included to show the engine position when the injectors are fired optional for debugging.
Wiring:
Crankshaft Position Sensor:

Connect the variable reluctance VR sensor signal to pin 4 of the Arduino for interrupt driven counting of the teeth.
Make sure the sensor is producing pulses correctly for each of the 58 teeth not including the 2 missing teeth as reference. It should skip two missing teeth.

Injector Control:
Connect Pin 2 to the control circuit for Injector Bank 1 which controls 3 injectors.
Connect Pin 3 to the control circuit for Injector Bank 2 which controls the other 3 injectors.

Considerations:
Voltage and Current: Ensure that the Arduino pins driving the injectors are connected to suitable transistor or relay circuits that can handle the power requirements of the injectors. Transistors must be installed with zener diode to each injector bank. Step down voltage D-D regulator must be installed to power the Arduino vin pin.

Sensor Signal: The variable reluctance VR sensor's signal may need conditioning via a comparator circuit depending on the type of signal it generates. Ensure it provides clean square pulses.
Timing: This code assumes the engine RPM is steady at 750 RPM. If RPM changes we might need to adjust the timing dynamically. RPM750=80ms/rev and RPM3000=20ms per revolution 360 degrees of the crankshaft rotation.

  1. Timing: This code assumes the engine RPM is steady at 750 RPM. If RPM changes we might need to adjust the timing dynamically. Will Arduino adjust switching interval time between two injector banks if the engine crankshaft speed increase ?

Yes. The Arduino can dynamically adjust the timing between the two injector banks if the engine RPM changes. To do this we need to measure the engine RPM in real time and adjust the timing of the fuel injection accordingly.

Key Concept:
Engine RPM Variability: As the engine RPM increases the time for one full revolution of the crankshaft decreases. This means the timing of the fuel injection must be adjusted to maintain precise injector firing timing relative to the crankshaft position. Injection pulse width will be increased if RPM increases.

Crankshaft Rotation Timing: The timing between revolutions the period for 360 degrees of rotation changes as the RPM changes. At higher RPM the time for a single revolution will be shorter and at lower RPM it will be longer. At RPM750 pulse width will be 5 milliseconds and at RPM3000 pulse width will be 10 milliseconds.

Adjusting the Timing Dynamically:
To dynamically adjust the timing the Arduino must calculate the time per revolution based on the current engine RPM. We can measure the RPM using a sensor the crankshaft position sensor and adjust the timing accordingly.

How to Adjust the Timing:
Measure RPM: Calculate the engine RPM based on the frequency of the pulses from the crankshaft position sensor. Each pulse corresponds to a tooth on the reluctor wheel or every second tooth if using the missing teeth for reference.

Adjust Revolution Time: The time for one revolution in milliseconds is inversely proportional to the RPM:

Adjust Injection Timing: Based on the calculated revolution time the injection time at 330 degrees before TDC should be adjusted to maintain the 5 milliseconds pulse width at RPM750 of fuel injection at the correct position.

Updated Arduino Code with Dynamic RPM Adjustment:
Code will be updated after testing.

Changes and Enhancements:
RPM Calculation:

The tooth Count is used to count the number of teeth pulses which corresponds to the number of teeth on the reluctor wheel 58 total teeth.
Every time the full set of 58 teeth is counted the time for one revolution elapsed Time is measured and RPM is calculated from the time it takes to complete one revolution.
Revolution Time:

The revolution Time is dynamically calculated based on the measured RPM:
Revolution time (ms)
=60,000RPM
Revolution time (ms)= RPM60,000

This allows the system to adapt to changes in RPM and adjust the injection timing accordingly.

Degree Timing:

The time for one degree of crankshaft rotation is recalculated each time the RPM changes. The injection time point 330 degrees before TDC is then calculated dynamically based on the current revolution time.
Dynamic Injection Timing:

Injection time is dynamically adjusted based on the current RPM. If the RPM increases the time between injector firings becomes shorter and the fuel injection timing is adjusted accordingly.

Debugging:
The RPM and engine position at the time of injection are printed to the serial monitor for debugging purposes.

How It Works:
RPM Measurement: The system calculates RPM in real-time based on the pulses from the crankshaft position sensor.

Timing Adjustment: As the RPM changes the Arduino recalculates the time per revolution revolution Time and adjusts the fuel injection timing to maintain proper synchronisation with the engine's crankshaft.
Injection Control: At 330 degrees before TDC the injectors are fired for 5 milliseconds pulse width and this occurs once per revolution.

Conclusion:
With this setup the Arduino will dynamically adjust the timing of the fuel injection based on the real-time RPM of the engine. As the RPM increases or decreases the timing between revolutions and the injection timing will change accordingly to maintain accurate and synchronised fuel delivery.
To change it from RPM to TPS set up to pulse width is better than expected RPM changes.
RPM changes quickly and baud rate will not catch messages to print. The TPS will provide DC voltage and can be used with higher baud rate.

This Topic has been locked as it is the identical or too similar your other topic.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.