# Fuel Injector Cleaner Pulse Generator BOX

4,187

11

12

This is my machine pulse generator to clean injectors, made in low budget, using Arduino and some parts. It can be used in a test bench or only to operate the injectors correctly, keeping them safe while cleaning. Is easy to build so far.

It is useful for a workshop or personally, it operates 4 injectors at the same time, generating the necessary pulses while maintaining a favorable work cycle so as not to damage them or affect their correct operation.

It has 4 speeds and a constant pulse on request, (button on / off) to open the injectors to the maximum if necessary.

Buttons description:

1 = 800 rpm

2 = 1500 rpm

3 = 3600 rpm

4 = 5000 rpm

CON-P = on / off injectors STOP

You can use this calculator to know how many hz is in 1 RPM, this is for ensure the correct speed needed.

Conversion from Hz to RPM:

800 rpm = 13.33hz

1500 rpm = 25hz

3600 rpm = 60hz

5000 rpm = 83.33hz

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Part List

PART LIST

MISC

• 4 injector EV1 Plugs (from an old VW hardness in this case)
• Plastic Electrical Box (or any other project box)
• Wiring
• Shrink Tubes
• 12v AC Adapter at least 5amp for injector operation (It could be a Computer PSU or car battery)

Tools

• Screw Drivers
• Plyers
• Drill

## Step 3: THE CODE

```//============================================================================================<p>//VARIABLES GLOBALES y CONSTANTES
//============================================================================================
const int b_800rpm = 8;
const int b_1500rpm = 7;
const int b_3600rpm = 10;
const int b_5000rpm = 11;
const int b_salir = 4;
const int b_consflujo = 3; //boton flujo constante al presionar
const int LedRPM = 6;     //Indicador RPM en funcionamiento
const int LED800rpm = 5;  //Indicador 800rpm
const int LED1500rpm = 2; //Indicador 1500rpm
const int LED3600rpm = 12; //Indicador 3600rpm
const int LED5000rpm = A0; //Indicador 5000rpm
const int inject1 = 9;    //pin de injeccion pin9</p><p>//estas variables guardan el flash pattern
unsigned long previousMillis = 0;        // sera guardara la ultima vez que el pin injeccion fue actualizado</p><p>//Estados de pin Entradas (botones)
int eb_800rpm;
int eb_1500rpm;
int eb_3600rpm;
int eb_5000rpm;
//int eb_usonido;
int eb_salir;
int eb_consflujo;</p><p>//============================================================================================
//SETUP
//============================================================================================
void setup() {

pinMode (b_800rpm, INPUT);
pinMode (b_1500rpm, INPUT);
pinMode (b_3600rpm, INPUT);
pinMode (b_5000rpm, INPUT);
pinMode (b_salir, INPUT);
pinMode (b_consflujo, INPUT);
//pinMode (b_usonido, INPUT);</p><p>  //Salidas
pinMode (LedRPM, OUTPUT);
pinMode (inject1, OUTPUT);
pinMode (LED800rpm, OUTPUT);
pinMode (LED1500rpm, OUTPUT);
pinMode (LED3600rpm, OUTPUT);
pinMode (LED5000rpm, OUTPUT);</p><p> // analogReference(INTERNAL);
Serial.begin(9600);
}</p><p>//============================================================================================
//VOID LOOP
//============================================================================================
void loop() {</p><p>  eb_800rpm = digitalRead(b_800rpm);
eb_consflujo = digitalRead(b_consflujo);</p><p>//SELECCION DE SUB RUTINAS - FUNCIONES DE PULSOS</p><p>  //activa a 800rpm
if (eb_800rpm == HIGH)
{
Pulse_800rpm();
}
//activa a 1500rpm
if (eb_1500rpm == HIGH)
{
Pulse_1500rpm ();
}
//activa a 3600rpm
if (eb_3600rpm == HIGH)
{
Pulse_3600rpm ();
}</p><p>  //activa a 5000rpm
if (eb_5000rpm == HIGH)
{
Pulse_5000rpm ();
}</p><p>  //activa inject1 mientras este presionado luego apaga al soltar el boton
if (eb_consflujo == HIGH)
{
digitalWrite(inject1, HIGH);
}
else
{
digitalWrite(inject1, LOW);
}

if (eb_usonido == HIGH)
{
u_sonido ();
}
*/
}   //cierra el void loop()</p><p>//============================================================================================
//SUB RUTINAS
//============================================================================================</p><p>void Pulse_800rpm() {
afuera:
delay(300);
for (; ;) {   //800RPM aproximadamente Modo IDLE
digitalWrite(LedRPM, HIGH);
digitalWrite(LED800rpm, HIGH);
long OnTime = 76;           // tiempo encendido en milisegundos
long OffTime = 61;          // tiempo apagado en milisegundos</p><p>    // verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();</p><p>    if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW;  // lo apaga
previousMillis = currentMillis;  // Recuerda el tiempo
digitalWrite(inject1, inject_State);  // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH;  // lo encuende
previousMillis = currentMillis;   // Rercuerda el tiempo
digitalWrite(inject1, inject_State);   // actualiza el Inject1 actual
}</p><p>    else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED800rpm, LOW);
break;
}</p><p>  }</p><p>}</p><p>void Pulse_1500rpm() {
afuera:
delay(300);
for (; ;) {   //1500RPM
digitalWrite(LedRPM, HIGH);
digitalWrite(LED1500rpm, HIGH);
long OnTime = 40;           // tiempo encendido en milisegundos
long OffTime = 32;          // tiempo apagado en milisegundos</p><p>    // verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();</p><p>    if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW;  // lo apaga
previousMillis = currentMillis;  // Recuerda el tiempo
digitalWrite(inject1, inject_State);  // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH;  // lo encuende
previousMillis = currentMillis;   // Rercuerda el tiempo
digitalWrite(inject1, inject_State);   // actualiza el Inject1 actual
}</p><p>    else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED1500rpm, LOW);
break;
}</p><p>  }</p><p>}</p><p>void Pulse_3600rpm() {
afuera:
delay(300);
for (; ;) {   //3600RPM
digitalWrite(LedRPM, HIGH);
digitalWrite(LED3600rpm, HIGH);
long OnTime = 16.6;           // tiempo encendido en milisegundos
long OffTime = 13.28;          // tiempo apagado en milisegundos</p><p>    // verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();</p><p>    if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW;  // lo apaga
previousMillis = currentMillis;  // Recuerda el tiempo
digitalWrite(inject1, inject_State);  // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH;  // lo encuende
previousMillis = currentMillis;   // Rercuerda el tiempo
digitalWrite(inject1, inject_State);   // actualiza el Inject1 actual
}</p><p>    else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED3600rpm, LOW);
break;
}</p><p>  }</p><p>}</p><p>void Pulse_5000rpm() {
afuera:
delay(300);
for (; ;) {   //5000RPM
digitalWrite(LedRPM, HIGH);
digitalWrite(LED5000rpm, HIGH);
long OnTime = 10.52;           // tiempo encendido en milisegundos
long OffTime = 8.4;          // tiempo apagado en milisegundos</p><p>    // verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();</p><p>    if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW;  // lo apaga
previousMillis = currentMillis;  // Recuerda el tiempo
digitalWrite(inject1, inject_State);  // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH;  // lo encuende
previousMillis = currentMillis;   // Rercuerda el tiempo
digitalWrite(inject1, inject_State);   // actualiza el Inject1 actual
}</p><p>    else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED5000rpm, LOW);
break;
}</p><p>  }</p><p>}</p><p>/*Esta parte sera dejada para programar correctamente el tiempo de encendido ya pagado
void u_sonido() {
afuera:
delay(300);
for (; ;) {   //800RPM aproximadamente Modo IDLE
digitalWrite(ledusonido, HIGH);   //enciende led indicador ultra sonido

unsigned long time = millis();
int toggle = 1;

digitalWrite(d_usonido, LOW);    //enciende la ultrasonido
// delay (10);
// digitalWrite(d_usonido, LOW);     //apaga el estado de d_usonido para dejar listo para otro proceso

if(millis()-time > 1000)     //Has one second passed?
{
toggle = !toggle;          //If so not toggle
digitalWrite(d_usonido, toggle);  //toggle usonido
time = millis();           //and reset time.
}

long OnTime = 76;           // tiempo encendido en milisegundos
long OffTime = 61;          // tiempo apagado en milisegundos</p><p>    // verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();</p><p>    if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW;  // lo apaga
previousMillis = currentMillis;  // Recuerda el tiempo
digitalWrite(inject1, inject_State);  // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH;  // lo encuende
previousMillis = currentMillis;   // Rercuerda el tiempo
digitalWrite(inject1, inject_State);   // actualiza el Inject1 actual
}</p><p>    else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
break;
}</p><p>  }</p><p>}
*/</p>

```

## Step 4: The Assembly

At this point i had the proyect done like a year ago and i decide to publish it now, so i didnt took photo for the process but as you can see not hard to do something like this following the Schematics. On the other Hands works very well, i had a lot of injectors cleaned with a home made test bank.

## Step 5: Testing

Participated in the
Microcontroller Contest

198 11K
82 4.8K
78 5.2K

## 12 Discussions

Hi, in schematic the L298N have 2 input: IN1 & IN2
Into code we have one only output: PIN9
In schematic the L298N have SENSA & SANSB, but L298N don't have this pins.
In photos the L298N have 4 input (IN1 & IN2 & IN3 & IN4) .

I cleaned the code with python and i run with success it on my arduino!
Where i do wrong? Thanks

Code:
<code>
//============================================================================================
//VARIABLES GLOBALES y CONSTANTES
//============================================================================================
const int b_800rpm = 8;
const int b_1500rpm = 7;
const int b_3600rpm = 10;
const int b_5000rpm = 11;
const int b_salir = 4;
const int b_consflujo = 3; //boton flujo constante al presionar
const int LedRPM = 6; //Indicador RPM en funcionamiento
const int LED800rpm = 5; //Indicador 800rpm
const int LED1500rpm = 2; //Indicador 1500rpm
const int LED3600rpm = 12; //Indicador 3600rpm
const int LED5000rpm = A0; //Indicador 5000rpm
const int inject1 = 9; //pin de injeccion pin9
//estas variables guardan el flash pattern
unsigned long previousMillis = 0; // sera guardara la ultima vez que el pin injeccion fue actualizado
int eb_800rpm;
int eb_1500rpm;
int eb_3600rpm;
int eb_5000rpm;
//int eb_usonido;
int eb_salir;
int eb_consflujo;
//============================================================================================
//SETUP
//============================================================================================
void setup() {
pinMode (b_800rpm, INPUT);
pinMode (b_1500rpm, INPUT);
pinMode (b_3600rpm, INPUT);
pinMode (b_5000rpm, INPUT);
pinMode (b_salir, INPUT);
pinMode (b_consflujo, INPUT);
//pinMode (b_usonido, INPUT);
//Salidas
pinMode (LedRPM, OUTPUT);
pinMode (inject1, OUTPUT);
pinMode (LED800rpm, OUTPUT);
pinMode (LED1500rpm, OUTPUT);
pinMode (LED3600rpm, OUTPUT);
pinMode (LED5000rpm, OUTPUT);
// analogReference(INTERNAL);
Serial.begin(9600);
}
//============================================================================================
//VOID LOOP
//============================================================================================
void loop() {
//SELECCION DE SUB RUTINAS - FUNCIONES DE PULSOS
//activa a 800rpm
if (eb_800rpm == HIGH)
{
Pulse_800rpm();
}
//activa a 1500rpm
if (eb_1500rpm == HIGH)
{
Pulse_1500rpm ();
}
//activa a 3600rpm
if (eb_3600rpm == HIGH)
{
Pulse_3600rpm ();
}
//activa a 5000rpm
if (eb_5000rpm == HIGH)
{
Pulse_5000rpm ();
}
//activa inject1 mientras este presionado luego apaga al soltar el boton
if (eb_consflujo == HIGH)
{
digitalWrite(inject1, HIGH);
}
else
{
digitalWrite(inject1, LOW);
}
if (eb_usonido == HIGH)
{
u_sonido ();
}
*/
} //cierra el void loop()
//============================================================================================
//SUB RUTINAS
//============================================================================================
void Pulse_800rpm() {
afuera:
delay(300);
for (; ;) { //800RPM aproximadamente Modo IDLE
digitalWrite(LedRPM, HIGH);
digitalWrite(LED800rpm, HIGH);
long OnTime = 76; // tiempo encendido en milisegundos
long OffTime = 61; // tiempo apagado en milisegundos
// verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();
if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW; // lo apaga
previousMillis = currentMillis; // Recuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH; // lo encuende
previousMillis = currentMillis; // Rercuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED800rpm, LOW);
break;
}
}
}
void Pulse_1500rpm() {
afuera:
delay(300);
for (; ;) { //1500RPM
digitalWrite(LedRPM, HIGH);
digitalWrite(LED1500rpm, HIGH);
long OnTime = 40; // tiempo encendido en milisegundos
long OffTime = 32; // tiempo apagado en milisegundos
// verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();
if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW; // lo apaga
previousMillis = currentMillis; // Recuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH; // lo encuende
previousMillis = currentMillis; // Rercuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED1500rpm, LOW);
break;
}
}
}
void Pulse_3600rpm() {
afuera:
delay(300);
for (; ;) { //3600RPM
digitalWrite(LedRPM, HIGH);
digitalWrite(LED3600rpm, HIGH);
long OnTime = 16.6; // tiempo encendido en milisegundos
long OffTime = 13.28; // tiempo apagado en milisegundos
// verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();
if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW; // lo apaga
previousMillis = currentMillis; // Recuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH; // lo encuende
previousMillis = currentMillis; // Rercuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED3600rpm, LOW);
break;
}
}
}
void Pulse_5000rpm() {
afuera:
delay(300);
for (; ;) { //5000RPM
digitalWrite(LedRPM, HIGH);
digitalWrite(LED5000rpm, HIGH);
long OnTime = 10.52; // tiempo encendido en milisegundos
long OffTime = 8.4; // tiempo apagado en milisegundos
// verifica si cambio el tiempo del estado del pin de injeccion
unsigned long currentMillis = millis();
if ((inject_State == HIGH) && (currentMillis - previousMillis >= OnTime))
{
inject_State = LOW; // lo apaga
previousMillis = currentMillis; // Recuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if ((inject_State == LOW) && (currentMillis - previousMillis >= OffTime))
{
inject_State = HIGH; // lo encuende
previousMillis = currentMillis; // Rercuerda el tiempo
digitalWrite(inject1, inject_State); // actualiza el Inject1 actual
}
else if (eb_salir == HIGH) {
digitalWrite(LedRPM, LOW); //apaga el led RPM
digitalWrite(LED5000rpm, LOW);
break;
}
}
}

</code>

A four stroke motor has one injector fire per 2 revolutions. Your RPM to Hz is wrong, you are actually double the emulated engine speed. You need to double the off time yet keep the on time the same length.
Considering your cleaning, such a fundamental cycle error will be covered up by the fuel cooling the overloading injector coil in most cases.

This is not sequencial system is a pulse generator amulating the rpm speed into pulses.

1 RPM to hertz = 0.01667 hertz

Hello, i did the project but the code is wrong, when i try to verify in arduino IDE, there is a lot of errors, can you give another code?

Thanks

Those errors is because when you copy paste from a website you copy html code with the text.. so try to verify when are those errors the IDE tell where they are..

Hi! I was very amazed by your project, so decided to make my own. I have question about wiring LN928N I was looking ant diagram, but couldn't understand it. Injectors Negative wires to OUT 1, OUT 2 OUT 3 OUT 4 ? And what diodes and relays ar wired also ? Thank you for your answer!

Sorry i don't thing is the time to answer cos is toooo late but..

The ln298 is working as a driver for the jnjectors, the relay in schematic is just representing the injectors coil.

Just ground a pin and the other side to the output.
Ill try to make another schematic more clear than thia one.. if interested.

when I copy paste it into arduino project there was error
injector_tester:24:18: error: expected unqualified-id before '<' token
int eb_consflujo;</p><p>//============================================================================================
^
C:\Users\Parakkrama\AppData\Local\Arduino15\injector_tester\injector_tester.ino: In function 'void setup()':
injector_tester:43:32: error: expected primary-expression before '<' token
pinMode (LED5000rpm, OUTPUT);</p><p> // analogReference(INTERNAL);
^
injector_tester:43:33: error: expected primary-expression before '/' token
pinMode (LED5000rpm, OUTPUT);</p><p> // analogReference(INTERNAL);
^
injector_tester:43:34: error: 'p' was not declared in this scope
pinMode (LED5000rpm, OUTPUT);</p><p> // analogReference(INTERNAL);
^
injector_tester:43:36: error: expected primary-expression before '<' token
pinMode (LED5000rpm, OUTPUT);</p><p> // analogReference(INTERNAL);
^
C:\Users\Parakkrama\AppData\Local\Arduino15\injector_tester\injector_tester.ino: At global scope:
injector_tester:46:2: error: expected unqualified-id before '<' token
}</p><p>//============================================================================================
^
exit status 1
expected unqualified-id before '<' token