Maker Pro
Maker Pro

Digital odometer with flash/RAM memory for car

P

princo coasters

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!
 
P

princo coasters

Oh........

P.S.

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

Thanks!
 
B

Bob Parker

Anyone?????????????

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
 
S

swanny

Bob said:
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

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.
 
P

princo coasters

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!
 
G

Gingre

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?
 
M

Mr.T

Gingre said:
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?

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.
 
A

Andy Wood

ER said:
I am under impression that current flash memory is rated for at least
hundred thousand write cycles, maybe more. So, assuming a case of say,
100000 write cycles and you backing up once a day you would get 273
years out of your stick. I think you're OK.

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


Andy Wood
[email protected]
 
P

princo coasters

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.....
 
G

Gingre

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.
 
G

Gingre

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.
 
G

Gingre

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...)
 
A

Andy Wood

Gingre said:
Why's that?

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
[email protected]
 
A

Alex Gibson

princo coasters said:
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!

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
 
Top