Connect with us

Digital odometer with flash/RAM memory for car

Discussion in 'Hobby Electronics' started by princo coasters, Jun 12, 2007.

Scroll to continue with content
  1. G'day!!

    After having built sucessfully a digital speedo and various other guages
    (fuel/tacho/EGO) for a vehicle, I was wondering if anyone has come accross a
    circuit/kit for a digital odometer with battery backed or preferrably flash
    storage of the reading?

    I've seen ones that go onto a bike etc, but I want to interface to a display
    of choice and stores the data when powered off - just like a real car!
    Something that gives the reading as a serial output so I can interface it to
    a nice VFD would be fantastic too if possible?

    For the speedo, I am using a VDO trans-axle hall effect sensor which gives
    1000 pulses per km (or close enough) and can feed those pulses into the
    odometer circuit as long as it is PIC/uP based and it allows for some
    tinkering :)

    I'm not all that experienced with PIC's etc, but can get around OK - except
    when it comes to storing data in flash or storing large values (cant work
    out how its done)

    Any help would be appreciated!!

    Thanks!
     
  2. Oh........

    P.S.

    It needs to store at least 7 digits.......... ie. 123456 and 7th digit
    is 10/ths km

    Thanks!
     
  3. Anyone?????????????
     
  4. Bob Parker

    Bob Parker Guest

    You need a PIC expert, which I'm not one of. :)
    There must be someone here who could advise you about how to do this....


    Bob
     
  5. swanny

    swanny Guest

    Use the 1000 pulses per km to drive either an interrupt or counter input on the
    PIC. Increment your main counter every 100 pulses (for 1/10th km). Then maintain
    the count across 3 bytes (24 bits) which will give you counts up to 1677721.5.

    The tricky part will be keeping the value during power down. Flash won't support
    enough rewrite cycles to be reliable. It's endurance is only typically 10,000
    cycles. EEPROM might be better, and most PICs come with a small eeprom memory in
    them (128bytes in the case of PIC16F628). It's endurance is typically 10 million
    cycles. Even so, you probably want to keep the circuit powered all the time from
    the car battery (should draw only a few mA) and have the PIC write the eeprom
    once a minute or so, provided there has been some change that requires writing.
     
  6. Thanks for the replies.....

    Yeah, I know i need to store the data across a few bytes, but therein lies
    my problem - i have no idea how to do that.....

    Any PIC'sperts who have some example code for storing large numbers in
    EEPROM ?


    Thankyou!
     
  7. Gingre

    Gingre Guest

    Can I query a piece of this, Swanny? Does that mean that my USB memory key
    has a limited life? ie 27 years once a day backups?
     
  8. Mr.T

    Mr.T Guest

    If you're very lucky. But does anyone really think they won't have thrown it
    in the tip about 20 years before that?
    In 27 years we will probably have Exa byte memory keys, or Yotta Byte, we
    certainly won't be using Gigabyte ones.
    But of course the USB interface will be well and truly obsolete by then as
    well.

    MrT.
     
  9. Andy Wood

    Andy Wood Guest

    But, that backing up probably involves writing to some locations many
    times.


    Andy Wood
     
  10. Hi!

    Thanks for the ongoing discussions.......

    It looks like I can write to an EEPROM in "page" mode to acheive a longer
    than one byte storage solution (allows 16-256k data to be written with one
    command).....well, at least thats what I am interpreting from my recent
    google discoveries.

    Keep the ideas coming!

    Thanks to all.....
     
  11. Gingre

    Gingre Guest

    Don't think you're quite right, though I get your drift. They still (just
    about) use floppy disks... though perhaps they've shrunk in size. My first
    was 8 inches.
     
  12. Gingre

    Gingre Guest

    That's better. Will just about do. I thought it was 10,000.
     
  13. Gingre

    Gingre Guest

    Why's that?

     
  14. Gingre

    Gingre Guest

    Ahah Don! You are revealing your time in hospital! Up this early and on a
    Sunday too. It's my habit anyway but if it hadn't been hospital would have
    sorted it out. How I loved that first coffee and biscuits.
     
  15. Gingre

    Gingre Guest

    Best time of the day. My record is 1am, normal is 3.30 am. Go to bed about
    7.30pm though (and miss all that intelligent stuff on the TV...)
     
  16. Andy Wood

    Andy Wood Guest

    Well, it would depend on all sorts of things. If you just copy a whole
    lot of files to a typically FAT-formatted disk, some sectors in the
    FAT and directory would get updated over and over again as each file
    is created.

    Some makers of the flash disks claim that they avoid this problem by
    not simply mapping logical sectors to physical locations in the flash
    (ask Mr Google about "wear leveling").


    Andy Wood
     
  17. Peter

    Peter Guest

  18. Alex Gibson

    Alex Gibson Guest

    But at least the abc and others but some of the good stuff onto their
    websites
    like
    http://www.abc.net.au/science/crude/

    Alex
     
  19. Alex Gibson

    Alex Gibson Guest

    google piclist

    You are not storing a single large number but a series of digits.

    Pics and other similar chips are 8 bit so values per register
    are 0 - 255 or 0 - FF in hex.

    So use a register to store each digit (0 - 9).

    For a long term solution I'd recommend storing the values into a serial
    eeprom or other chip
    on power off. A decent sized cap would give power for long enough to
    write the latest value.

    1. first step try the pic eprom

    2. serial eeprom/flash chip attached to the pic

    3. sd card - let you store a lot of other info as well

    few circuits
    http://www.gedanken.demon.co.uk/gps-sd-logger/
    http://www.gedanken.demon.co.uk/thermometer-recorder/ for serial eeprom
    circuit
    http://www.techdesign.be/projects/020/020.htm

    Doesn't have to be a pic , could use atmel avr or other micro.

    Do you know any programming language ?

    Dontronics.com sell some cheap pic boards(and avr and others) from olimex.

    http://www.winpicprog.co.uk/pic_tutorial.htm is quite a nice tutorial using
    asm.

    http://www.microchipc.com/ examples for the hitech and microchip c
    compilers for pics.

    If you use an 18f or 24f or 30f pic , microchip have c compilers for them.

    See 3rd and 2nd last projects on this page
    http://www.microchipc.com/sourcecode/


    Alex
     
  20. Gingre

    Gingre Guest

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-