Yes that is the way i've decided to do it, as it's the simplest.
Thanks for all the ideas guys!
I bought a large prototype board, some proper relays & more transistors.
This is what i've come up with so far.
And here's the really basic code, i used a basic serial input code i found at ladyada then tweeked it to what i needed, basiclly, if it gets any input at all from serial, it will fire the code.
int onPin = 12;
int accPin = 11;
int ignitionPin = 10;
int usbnumber = 0;
void setup() {
pinMode(onPin, OUTPUT);
pinMode(accPin, OUTPUT);
pinMode(ignitionPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
usbnumber = Serial.read();
}
if (usbnumber > 0) {
digitalWrite(accPin, HIGH);
delay(500);
digitalWrite(onPin, HIGH);
delay(5000); //5 second delay because of glow plugs (diesel)
digitalWrite(ignitionPin, HIGH);
delay(800);
digitalWrite(ignitionPin, LOW);
delay(800);
usbnumber = 0;
}
}
Obviously i havn't yet added any components or code for the sensing of the key, nor the ignition (car has started, switch off ignition)
As far as the sense for when the key has been switched on, i was going to use the idea given above, have the arduino's power source on a normally closed relay attached to the on position of the car, so when the key is switched on, the relay becomes open and the power to the arduino is cut off - this way requires no code.
As far as the car goes, it doesn't require any throttle to start, ever.
And as for the ignition sense, in the fuse box of the car is a 'charge' fuse (from the alternator regulator), that's only outputting 12v once the car has fired. today at jaycar (Australian electronics store) i mentioned the project to a staff member, and he suggested using a voltage regulator, he sold me a 7806CT. he said, it'l step the 12v from the alternator regulator down to 6v which according to him is safe for the arduino input..
Now, can the arduino sense that "okay, 5v has been applied, i'll wait 200ms just to be safe, then switch off ignitionPin" i'm 99% sure that can be done, but what code would i add for this? and also, would i be using the analog pins? or digital pins and have one for the +5 set to input?
Cheers guys ![]()
