Arduino 60-2 tooth CAS simluator

Bosch Motronic etc ECUs and PCMs
Post Reply
User avatar
festy
Posts: 1039
Joined: Sat Apr 30, 2011 6:27 pm
cars: Alfa Romeos
Location: Narellan, NSW

Arduino 60-2 tooth CAS simluator

Post by festy »

This is a little Arduino sketch to generate a 60-2 (missing teeth) crank sensor signal for Motronic ECUs.
The CAS is a reluctor pulse but the Arduino generates a TTL signal, so either use the relay coil trick (via a FET), or just bypass the reluctor-to-TTL conversion circuit inside the ECU.
On the ML4.1 ECUs, inject the TTL CAS signal to pin 3 of IC S600, eg:
CAS.png
CAS.png (23.86 KiB) Viewed 6617 times

Code: Select all

/* 
  60-2 tooth CAS signal generator for bench testing Bosch Motronic ECUs.
  Connect a linear 10k potentiometer's pin 1 to VCC, pin 2 to A0, pin 3 to GND.
  TTL CAS signal output is on pin 12.
*/

int PotPin = A0;                       // the input pin for the potentiometer
int PotValue = 0;                      // variable to store the value coming from the sensor
int CASpin = 12;                       // CAS out pin
int LEDpin = 13;                       // on-board LED

void setup() {
    pinMode(CASpin, OUTPUT);
    pinMode(LEDpin, OUTPUT);
}

void loop() {
   PotValue = analogRead(PotPin);       // read the value from the potentiometer    
   digitalWrite(LEDpin,LOW);
   int PulseDelay = 50000 / PotValue;   // 50000 gives >7000 rpm which is enough
   if (PotValue > 5)                           // Stop signal output at minimum pot value 
   { 
     digitalWrite(LEDpin,HIGH);            // LED indicates CAS signal status
     for (int j = 0; j < 5; j++)              // Update the RPM only every few revolutions
     {
        for (int i = 0; i < 58; i++)          // 58 of the 60 teeth high/pause/low/pause cycle
         {
          digitalWrite(CASpin, HIGH);
          delayMicroseconds(PulseDelay);
          digitalWrite(CASpin, LOW);
          delayMicroseconds(PulseDelay);
         }
       for (int i = 0; i < 4; i++)            // 2 missing teeth are low for both halves of cycle
        {                             
         delayMicroseconds(PulseDelay);
        }
     }
   }    
}      
bilielectricidad
Posts: 1
Joined: Wed Oct 24, 2018 2:27 am

Re: Arduino 60-2 tooth CAS simluator

Post by bilielectricidad »

muy bueno !! muchas gracias
Post Reply