car mileage (odometer)

Hello,
I am working for project

I am working on project (mobile app) about car.. and I should got the mileage of the car (odometer).. to do some work on it. e.g: after 5000 kilometer, you should take you car to maintenance.. So I should get the mileage of the car :frowning:

I bought OBD2 device (elm327), but when I search I found that I cant get mileage using it! I AM SURPRISED !

So, I am deciding to use Arduino to sent notification to the driver about how many km remaining until the next oil change or any kind of car maintenance.

May any one help me please how can I do it ?

now, I have Arduino UNO, solderless breadboard with 400 tie point..
I will buy any thing else required..

please help me, it is my graduation project :frowning:

I really don't know how "modern cars" work and if you don't get an answer here you may have to try an automotive forum. ...Older cars had a flexible rotating shaft (a "speedometer cable") into the dash assembly where the rotation was converted mechanically or electrically to drive the speedometer and odometer.

I assume there is a speed sensor (probably coming off the transmission). You should get one or more pulses for every rotation of the drive shaft. You can get distance by counting pulses (and speed is calculated from that). You might have to experiment to get the pulses-per-kilometer, but once you can "catch" the pulses, programming the Arduino to count them is easy.

You might need your car's maintenance manual or search online to "find" the speed sensor and the connection in your wiring harness.

now, I have Arduino UNO, solderless breadboard with 400 tie point..
I will buy any thing else required..

The automotive pulses/signals will be (nominally) 12V and that can fry the Arduino, so you'll need a couple of resistors to make a voltage divider, and I'd also recommend a "over-voltage protection" diode.

please help me, it is my graduation project

Graduation from what? What's your major?

DVDdoug:
I really don't know how "modern cars" work and if you don't get an answer here you may have to try an automotive forum. ...Older cars had a flexible rotating shaft (a "speedometer cable") into the dash assembly where the rotation was converted mechanically or electrically to drive the speedometer and odometer.

I assume there is a speed sensor (probably coming off the transmission). You should get one or more pulses for every rotation of the drive shaft. You can get distance by counting pulses (and speed is calculated from that). You might have to experiment to get the pulses-per-kilometer, but once you can "catch" the pulses, programming the Arduino to count them is easy.

You might need your car's maintenance manual or search online to "find" the speed sensor and the connection in your wiring harness.
The automotive pulses/signals will be (nominally) 12V and that can fry the Arduino, so you'll need a couple of resistors to make a voltage divider, and I'd also recommend a "over-voltage protection" diode.
Graduation from what? What's your major?

thank you for your repaying ! Thank you so much!!
I think about way but I am new and I dont know much:(
let me tell you, If I design the Arduino to just calculate the distance? so I put the device I designed in the car, then send notification to the driver's iPhone when it is 5000 kilo?

it is right? if it is right can you help me how to do that?

Graduation from computer science bachelors..

thank you again!!

Hello,
I am working for project

I am working on project (mobile app) about car.. and I should got the mileage of the car (odometer).. to do some work on it. e.g: after 5000 kilometer, you should take you car to maintenance.. So I should get the mileage of the car :frowning:

So, I am deciding to use Arduino to sent notification to the driver about how many km remaining until the next oil change or any kind of car maintenance.

May any one help me please how can I do it ?

please help me, it is my graduation project :frowning:

@alamirah93, please do not cross-post. Threads merged.

please help me

Hi,
You could use a GPS unit to get your distance information, that way your project would be generic, you could attach it to any car.
Also log run time as well as distance.
You will need to store your information so place it in EPROM to save the data when project is turned OFF.

Tom.... :slight_smile:

@alamirah93

I am working on a trip computer at the moment, I mean, I have been working on it for almost a year now.

Even the most modern cars usually have some kind of speed sensor or transducer installed at the transmission somewhere, which generates a symmetric square wave, which the car's electronics then use to calculate the car's speed. In the end, this is also how a digital odometer works which is found in most cars from about the late 1990s onwards. It just counts the pulses and knows what distance you have traveled after a given number of pulses.

This is how I worked out the precise speed of my car in relation to the speed sensor pulses:

Get an oscilloscope or logic analyzer and connect it to the car's speed sensor at the transmission (remember to step down the voltage if your scope/analyzer doesn't tolerate 12V). Then either put the car on a car lift, or take it out on the road, and make an Excel table of the speed shown on the speedometer in one column and the pulse length of the speed signal in the second column at a particular speed. For added accuracy, maybe use a GPS app instead for the vehicle speed readings.

Do this at a few different speeds. Just to be sure. Maybe 10, 20, 50, 80, 120 kph. Collect your data. Then try to calculate a linear equation from your data (there are online tools for this). This linear equation will later become part of your Arduino code and tell you how fast you are going at different pulse intervals. Or if you are really only interested in the distance you have traveled, do a rudimentary Arduino sketch on an Arduino Uno-type board (the best choice for beginners) that just counts up the number of pulses. Then compare that to your distance reading from your GPS app. And form a linear equation from that.

You could still keep your system variable and flexible; in the end, from one type of car to the next, you would only have to work out new equations for your odometer calculations. The rest should always be the same.