Pages: [1] 2   Go Down
Author Topic: Vehicle remote ignition - Some questions.  (Read 2875 times)
0 Members and 1 Guest are viewing this topic.
Seaford, Victoria, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there everyone, i'm new here as you can probably see smiley
Firstly a little bit about me, i'm 21 and i'm an Apprentice in Electronics.

I purchased my Arduino UNO R3 last week and have been having some fun with it, and then came up with a project idea.
My idea is to be able to remotely start my car via text message, so i can warm it up before getting in it.

Whilst reading this, remember this car is old and has no immobilisation/alarm (which makes this easy)
I've already gotton as far as being able to start the car via the web with the Arduino hooked up to my laptop via USB whilst the laptop is connected to my home WiFi, and running a PHP script which i can access via my phone on the same network.
The way the relays are connected is basically just before the key barrel, i've spliced the Accessories, On, Ignition and Earth wires and put my relays between. <kind of primitive i guess.
I'm fairly sure i can work around the cell part of the project once i get my cell shield, but i only have one small issue.

Once you've warmed the car up and have gotton in it, naturally you need to put the key in and turn to the ON position to release the steering lock, which is fine.
But once i do this, i need the arduino to then turn off/release the relays so when i turn my car off via the key, the car shuts down.
It's probably a simple fix, but i just cannot work out how to do it.
The only other way was to give the arduino say, a 10 minute delay, then release the relays (hopeing by then you have the key in) but i'd rather not do that.

If anyone could shed some light on this, it would be greatly appreciated!
I also wish to make a fully comprehensive tutorial on how to do this once i'm finished smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My project is similar, but you could tap into your ignition line(its only hot if the key is in the on position) and then step it down to logic levels, and feed that into one of the pins; Testing for HIGH or LOW in the arduino.

AKA

If your key is to the ON positiion, it energizes the ignition wire; You have your arduino setup to sense this (probably by stepping it down from 12 volt to 5) and connecting it to a general I/O pin; When the arduino senses the ignition wire is energized, it releases the relay.
Logged

Seaford, Victoria, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I thought about that, and thought that if i did that, once the key is in the on position, the key on circuit becomes closed, thus shorting out the arduino, but, if i connected the earth to the battery/body, when the key is in the on position, its hot, not shorted.
i'm an idiot :\ i don't know how i didn't see this earlier.

The other thing is, the delay for the ignition relay is around 1200, normally enough time for the car to fire up without burning the starter motor, but what about those cold mornings where it takes that little extra? how would i add a sense to send confirmation to arduino that the car is on and thus shut off the ignition relay? i would think the same sort of way as you posted, but when the car is in the on position, everything that would be on when the car is actually running is on, thus, nothing to jump off..
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Uhmmm.......That is a tough one; I would probably tap into the tachometer wire and get a reading from where it is at when its started VS stopped; that way you can "sense" the RPM's, letting you know if its started or not; That or maybe something in your OBDII plug.
Logged

Western Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What sort of car is it?
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12631
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could wire the ignition switch through a twin throw relay so that when you turn on the ignition switch it turns the Arduino off (and the ignition circuit on), and when you turn the ignition off it turns the Arduino on again (and the ignition circuit off). I recommend putting a switch on the throttle pedal so that the Arduino gets reset if anyone opens the throttle. This means that if anyone sees the running car and tries to drive off, even if they overcome the steering lock it'll die as soon as they try to pull away.

By the way, you might want to check the legal situation. In the UK I believe it's illegal to leave a vehicle unattended on a public road with the engine running.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Chicago
Offline Offline
Full Member
***
Karma: 0
Posts: 113
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

most remote starter systems cheat and monitor voltage from the battery. When its 14.0 the car started alternator charging well at least here in the states.
Logged

Seaford, Victoria, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What sort of car is it?

A shitty old hilux, just the work pig.

You could wire the ignition switch through a twin throw relay so that when you turn on the ignition switch it turns the Arduino off (and the ignition circuit on), and when you turn the ignition off it turns the Arduino on again (and the ignition circuit off). I recommend putting a switch on the throttle pedal so that the Arduino gets reset if anyone opens the throttle. This means that if anyone sees the running car and tries to drive off, even if they overcome the steering lock it'll die as soon as they try to pull away.

By the way, you might want to check the legal situation. In the UK I believe it's illegal to leave a vehicle unattended on a public road with the engine running.


That's actually a really good idea!
And i'm not fussed about legalities - i'm australian, enough said.

Logged

Western Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

good chance on it not starting then... I dont know much about hilux's. you might be able to get some feed back off the dash warning lights to tell if its running or not...  charge light or something?
Logged

Seaford, Victoria, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, i've already got the remote ignition up and running over wifi, it works fine?
But the way it's set up is in the arduino program it simply has a delay for the ignition relay to be on for, which is 1200ms
but like i said, for cold mornings, sometimes 1200ms isn't long enough.
i need some way of the arduino sensing that the car is running, and thus switching off the ignition relay

It's an old hilux with no immobilisation or anything so it's a piece of piss to get the starting side of it done.
Logged

Western Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i need some way of the arduino sensing that the car is running, and thus switching off the ignition relay
you mean start relay?

If its petrol you could hook into the coil and read rpm. when it starts the rpm would go from cranking speed up to idle speed. diesel must have a sensor for the tacho, so you could tap into that. Also you would want it to check if the engines running after the 1200ms anyway, and kick it in the guts again if its not.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12631
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check whether your engine will cold start reliably on a closed throttle - some engines won't. Also, some engines need a little throttle after they've started to pick the revs up high enough for the alternator to kick in. Depending on the engine and what type of idle speed control it has this may all work fine, but it's the sort of thing that could be a real problem on an older engine.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
When the arduino senses the ignition wire is energized, it releases the relay.

This is what I would do.  That, or use the ignition as a sense pin and have the Arduino always control the relay.  I.e., start the car by closing the relay.  Open the relay after 10 minutes.  Cancel the kill timer if the key is inserted, and immediately open the relay if the key is removed.

For the engine start, you could try 1200ms, check engine pulses or battery level (both good ideas!), then delay for a few seconds, try again, check, delay, try again...  After maybe four attempts, give up.
Logged

Seaford, Victoria, Australia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

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 smiley
« Last Edit: May 15, 2012, 06:52:17 am by Aussie_V8 » Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1330
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


  On thing I don't see, is a way wait to only allow one start in a given period of time. If somehow, you were to accidentally spam the Arduino with start commands, it is going to try over and over again to start.

Quote
Now, can the Arduino sense that "okay, 5v has been applied, I'll wait 200ms just to be safe,

 Are you talking about monitoring voltage of the battery to see if the engine has started? If so, I would use a voltage divider and make the output of the divider around 4 volts when the battery is 14volts. It will give you some room for higher battery voltages. You might need to go further with a protection circuit to avoid over voltage to the Arduino.
Logged


Pages: [1] 2   Go Up
Jump to: