After doing some more work with my prototype this week I decided to give it a try in my Ford Focus. I added the following features to the prototype,
- Engine RPM
- Engine Speed Mph
- Battery Voltage
- Fuel Level % (Not supported on my focus it seems)
Started the car and began the test, clicked connect, everything runs ok. Started the timer which polls for OBDII info every 100ms, Engine cut out!!!
Looked at my code and this is whats under the Timer event.
procedure TForm1.Timer1Timer(Sender: TObject);
nrComm1.SendString(’01 0C’ + #13);
Memo1.Lines.Add(‘cmd 010C sent’ + #13);
nrComm1.SendString(’01 0D’ + #13);
Memo1.Lines.Add(‘cmd 01 0D sent’ + #13);
By asking for 2 requests in 100ms AT THE SAME TIME, I was overloading the PCM and causing the engine to cut out. VERY BAD.
I now need to make changes for it to poll requests, at alternating times.
Here’s a screen shot of the new prototype.
Well, I have produced a very early prototype this week, just to make sure that my project is going to viable! Don’t want to get all the way to January and realise that I can’t code the damn thing.
So for anybody that’s interested here’s a screen shot of the prototype.
The prototype was written in Embarcadero RAD Studio AKA Delphi 2010, uses an ELM327 serial to USB interface (38400 Baud Rate) purchased from Ebay for about £15. Theres no data on the screen because it’s not connected to the car (it was raining) but it does work.
I managed to get the timer down to 100 ms with no errors, so I will see if I can push it further next time I’m testing it. If anybody knows what the minimum ms is please post a comment below. I know that it varies with every ECU, but whats the general figure that works 99% of the time with most cars.
Using a blog has always been an easy way for me to keep track of projects. So when I was told that I had to keep track of EVERYTHING I did for my final year project at Huddersfield University I decided this would be the easiest way. It also serves the purpose of giving my examiner and supervisor a central hub for checking my progress over the year.
So what’s my project going to be about?
Well I have always been interested in cars and computers so it seemed logical to combine these two elements into a project. I have decided to create an Advanced Driver Assistance Interface which will increase driver awareness of dangerous conditions while driving, the secondary aim of the interface is to reduce the amount of fuel the car uses by displaying information to the driver using audio and visual prompts about their driving habits.
How are you going do this?
I am planning on using a range of technologies already present in modern cars manufactured after the year 1996. These cars include an Onboard Board diagnostic System (OBDII) which can relay real-time information to a laptop using a serial to USB interface.