I'm currently using an Arduino UNO in a rally car on a sequential gear shifter.
The ECU is pretty basic but it needs a Ground interrupt signal to know when to cut fuel.
The sequential gear lever has a 5V strain sensor on it.
I have used the Arduino on another ECU which only needed digital input to do the fuel cut:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int sensorValue = analogRead(A0); //read voltage from A0
float voltage= sensorValue * (5.0 / 1023.0); //calc voltage
pinMode(13, OUTPUT); // sets the digital pin 13 as output
if (voltage < 1.0){
digitalWrite(13, LOW);
delay(100);
digitalWrite(13,HIGH) ; //check if gearshift is pushed forward activate fuelcut if true
delay(500);
}
if (voltage > 3.4){
digitalWrite(13, LOW); //check if gearshift is pulled activate fuelcut if true
delay(100);
digitalWrite(13,HIGH);
delay(500);
}
//delay(1500);
}
This worked perfectly but now I need to send a ground interrupt where the digitalWrite(13,LOW) is.
People will appreciate it if you post your code properly. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
You will see from the picture how it manually works with a switch that breaks the ground connection to the a specific pin on the ECU.
So all I want to do is provide constant ground to the pin on the ECU and then when I pull the sequential gear lever it then interupts the ground signal so the ECU will know when to cut the fueling to the motor
You refer to a "signal", and that is not shown in the picture. Is the signal and pulse on a wire connected to the ECU and if so, what is the timing of the "signal"?
Maybe I'm not explaining it correctly and using the wrong terms sorry still new to it all.
Best way to describe is to have the ecu pin loop the ground through the arduino and when I pull the lever it then breaks that ground connection? Similar to what a manual switch would do?
In that case, just use a relay module with the ECU connection between the "C", common connection and the "NC" normally closed connection. You can pulse the relay with an adjustable timing in your program code.