Speedometer & Odometer
Speedometer/ Odometer Using AT89S52 & AT24C04 with complete ‘C’ code
This is very useful project. This article tell you how to design your own digital speedometer for your motor bike.
Project is bulit using AT89S52 microcontrroller which is basically an 8052 derivative by ATMEL, The concept behind the project is that we can count the number of revolution of wheel by just putting a megnetic sensor like reed switch or hall sensor. First i generate a delay one second using sim[ple for loop technique with a crystal value of 11.0592 MHz. I turn on the timer1 of AT89S52 for one second as counter and turned it off by pulling TR1=0. in this way i got the number of pulses coming in a second , which directly refelects tyhe speed in Km/sec or Mt/sec. This let you know the speed of your vehicle.
speedometer cum odometer by deveshsamaiya
Errata- Plz connect EA pin no. 31 to Vcc,and use Pull ups of 10K on I2C lines… it is not shown in Schematic
To make a digital Odometer i used a Non Volatile Memory EEPROM AT24C04 which has a storage of 4KB. EEPROM is used to store the total distance covered by the vehicle since the speedometer is installed. The content of EEPROM is updated after every 100meter distance.
Total two timers of 8052 is used in the design.You can download the complete source code below. If yoiu have any queries or your speedometer/Odometer isn’t working contact me at devesh@electroons.com
DownLoad complete source code and schematic files here
DownLoad Datasheet of Serial EEPROM by Atmel
DownLoad I2C Specifications by Philips
Comments
34 Comments on Speedometer & Odometer
-
AM Tahir on
Fri, 2nd Oct 2009 2:21 am
-
admin on
Fri, 2nd Oct 2009 2:35 am
-
Abdul Majeed Tahir on
Sun, 11th Oct 2009 10:59 pm
-
Torq on
Mon, 19th Oct 2009 4:02 pm
-
avinash on
Mon, 9th Nov 2009 2:48 pm
-
avinash on
Mon, 9th Nov 2009 2:49 pm
-
admin on
Mon, 9th Nov 2009 3:23 pm
-
yogesh on
Sat, 14th Nov 2009 1:42 am
-
yogesh on
Sat, 14th Nov 2009 1:58 am
-
admin on
Sat, 14th Nov 2009 2:55 am
-
ciprianno on
Mon, 16th Nov 2009 7:47 pm
-
admin on
Tue, 17th Nov 2009 12:36 am
-
ermes on
Tue, 17th Nov 2009 6:55 pm
-
ciprianno on
Wed, 18th Nov 2009 4:51 am
-
admin on
Wed, 18th Nov 2009 7:47 am
-
ermes on
Wed, 18th Nov 2009 8:58 am
-
ciprianno on
Wed, 18th Nov 2009 9:10 am
-
admin on
Wed, 18th Nov 2009 9:15 am
-
ciprianno on
Mon, 23rd Nov 2009 1:56 pm
-
admin on
Mon, 23rd Nov 2009 4:29 pm
-
ciprianno on
Sun, 29th Nov 2009 7:42 am
-
abhinav on
Mon, 7th Dec 2009 9:37 am
-
abhinav on
Mon, 7th Dec 2009 9:40 am
-
yamuna on
Mon, 11th Jan 2010 10:12 am
-
yamuna on
Mon, 11th Jan 2010 10:14 am
-
arun on
Fri, 12th Feb 2010 11:36 pm
-
admin on
Tue, 16th Feb 2010 6:08 am
-
Fransiskus Eko on
Tue, 11th May 2010 11:43 pm
-
admin on
Wed, 12th May 2010 2:29 am
-
prabhat on
Sat, 22nd May 2010 4:49 am
-
Uttam Dutta on
Fri, 18th Jun 2010 7:23 am
-
tibbu on
Mon, 12th Jul 2010 8:51 am
-
admin on
Tue, 13th Jul 2010 7:21 am
-
Amit on
Thu, 22nd Jul 2010 8:40 pm
A use full schematic for education but there is not source code it will be batter if source code and assambler or compliler information will be attache with this schemaic
Thank you
ok tahir…
I think You have downloaded the rar file that file does not content the source code but you can download the tar.gz archive it has all codes
Hello,
I need use 93C56 or 93C46 for this project,
is this schematic and code is will also work for 93Cxxx
|Thank you
AM Tahir
Man, this is awesome job. I just look speedometer like this. I will look cool on my CBR. 10q
It is very good project to work on. it will enhance our working with electronics components.
but their is no pcb layout of this project is attached with this file.
i want to see its PCB layout.
i tested this project successfully on general purpose PCB and it worked fine…for robustness..you can design your own…
i wnt 2 reset my digital speedometer can u help me.
how 2 change odometer reading .
you can reset the reading to zero by pressing the push button at P1_4 pin if you are using my code. Just short the P1_4 for a moment and your distance reading will start from zero again.
This is a very interesting project.I will try to build this speedometer-odometer for my car.
I’m a beginner in AVR programing, and i don’t now very well to modify the source code .
What i need to modify in the program for my car – the whell radius is around 31.8 cm at 100 cm circumference?
And another question, how to count and display a total trip km in five digit – like this 99999 km?
Thanks alot!
ok ill try to mail you the modified code, with 5 digit display.
This board could working only at odometer, on two lines display?
In the attach files is the .hex of the microcontroller but i can’t find program for EEPROM, only a .C file, how to convert this file in .hex?
I tried with AVR STUDIO but appears many errors .
Thank you very much.
Errata : My circumference of wheel is aound 100 cm, and the radius is 15,5 cm .
One rotation of wheel is one meter trip.
@ermes.
AVR studio wont work this project is on AT89S52 which is 8051 derivative, use Keil or SDCC for this program. And you just connect EEPROM as per connection diagram given , No need any separate File for eeprom. Controller will itself address the memory.
Ok. Thank’s. I will try with one of this programs.
It is possible that this circuit to work only like a odometer or a speedo?
The AT89S52 is compatible with AT89S8252?
I ask because my ISP programmer work only with PonyProg, and PonyProg has only AT89S8252.
No Ponyprog will not program AT89S52. use this
http://www.kmitl.ac.th/~kswichit/cheapcable/
I have problems with microcontroller. After switching off and turn on again, the display wont work, appear o single line. If i re-write the micro, the problem dissapear but reapper after turn off power suplly and put on agin.
have you made the power on RC reset circuitry properly?? If so check whether EA/Vpp is connected to Vcc or not.
Yes , I made properly all circuits.
After turn off the power supply the micro won’t work, i need to rewrite-it every time.
I don’t now what’s happening.
thanks sir………….that was fantastic project……..
what should i need to do in program if my car’s wheel have 151.6 cm circumference
and radius is 48.26 cm……?
pls sir reply as soon as possible.
my email id is abheenav911@gmail.com
and i am using at89s52.
This is a great project for beginners. we’ve taken this as our major project. So could you please tell us what changes have to be made for at82c2051 and eeprom 24c02
My email id is binny.bubblygirl@gmail.com
can you please tell which software is used to program this ic.also can you give the schematic for implementing in PIC
i used ASIM’s ISP loader to program IC. No i dont work on PIC till now
” Thanks for your knowledge-share, and I hope You can give me more info about code or website sources, to make me feel fully about microcontroller especially 8051 in c programming “. Bless You all
i need the programming of speedo meter cum odo meter
It is very interesting and useful project.
I have two specific question
(1) if we omit 12C Eprom (hardware wise) will LCD show running speed or it will produce error (in that case I don’t wish to see the total distance covered by the vehicle
(2) Is this circuit will produce reliable and stable stable speed or rpm in lower as well as higher speed or rpm ?
(3) I am not able to understand the speed calculation part, it needs the diameter of the wheel
One pulse will be equal to “∏ X d” cm (if dia. expressed in cm.) Then where rhe rpm counting and Km/hr counting in the program.
Please reply
Regards,
Uttam Dutta
what is the purpose of showing “240″ at the end of first row of LCD ??
its showing the timer counter status..this project is not ready to use as speedometer you must be aware of 8051 programming to customize it according to your needs…
How to auto increment the write locations(without page write) in eprom. How to check whether memory is full or not ? And how to read from eprom in your project. Can you post the code or example for the three cases.
Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!




