Pages: [1]   Go Down
Author Topic: Arduino odometer's value storage ideas needed..  (Read 755 times)
0 Members and 1 Guest are viewing this topic.
INDIA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 382
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to make an odometer for my motorcycle..The making is not that hard but the challenge is to store the Km traveled when I shut of ignition and pull off the key or disconnect the vehicle's battery..

I do not want to use the inbuilt atmega328 EEPROM as I want to write to the EEPROM every time there is a change in Km reading, so I rather want to use an external EEPROM as it will much cheaper and save the Atmega's life....
Will that be a good idea or I can do something else..??
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 67
Posts: 3679
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not use the on board EEPROM? It's supposed to be good for 100,000 cycles I believe and you're only going to write on it once per kilometer. If you expect the motorcycle to last longer than 100,000 km, you can move the odometer reading down the EEPROM say, every 50,000km and record its current location in the first two bytes of EEPROM. Then you'd be good for over 12 million kilometers.
Logged

Offline Offline
God Member
*****
Karma: 4
Posts: 813
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The "data logger shield" lets you write to a SD card, which can be replaced and/or read from other computers.

However, if you write the Km setting only every 5 minutes, then 100,000 writes (the rated life of the eeprom) is 500,000 minutes, which is over 8,000 hours of runtime. That may be sufficient for your needs. Or not.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 534
Posts: 26970
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

External serial EEPROM accessed via I2C is another possibility if you really don't want to use internal.
Use 2 bytes/address locations to store your mileage that is up to 65,535 kM. Or 4 bytes if need to use a long.
Or use the 4th byte of the long to represent other stuff as well, and 3 bytes to get you to 16,777,xxx kM.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

New Hampshire
Offline Offline
God Member
*****
Karma: 17
Posts: 781
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

so I rather want to use an external EEPROM as it will much cheaper and save the Atmega's life....
Will that be a good idea or I can do something else..??

Any external hardware is going to add cost above and beyond the cost of the Arduino itself, so it will only be more expensive.  Wildbill offered up a perfectly viable solution to get millions of miles worth of use out of the built in EEPROM.  Seems like the cheapest option to me.
Logged


nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8501
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just write to the internal EEPROM, as mentioned say 50000 writes to location 0/1 then move on to 2/3 etc.

______
Rob 
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1]   Go Up
Jump to: