Shop OBEX P1 Docs P2 Docs Learn Events
Saving data for later use - Auto odometer - Page 3 — Parallax Forums

Saving data for later use - Auto odometer

13»

Comments

  • franklin9090franklin9090 Posts: 59
    edited 2007-04-05 20:21
    Mike,
    On the tantalums, I am making the assumption that the positive end should be toward the regulator. Is this correct?

    I looked at the datasheet on the regulator and am pretty sure I have it correct, but I will double check. On one data sheet, I saw that the heat sink was labeled "Gnd". Does the heat sink need to be grounded also? I was grounding the middle "prong".

    I was wondering about the regulator, especially with the fluctuating voltage. Is there a way to test just the regulator? If the regulator is bad, would I still have voltage going through it?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-05 20:37
    In your particular case (with a positive output regulator), you should connect the negative end of the capacitor (aluminum or tantalum) to ground and the positive end to the output terminal of the regulator.

    The heatsink is labelled "Gnd" because it is connected to the ground terminal of the regulator. That makes heatsinking to a chassis or case easier because usually the case or chassis is also connected to ground.

    There's no easy way to test the regulator other than to connect it as you have and see if it works as designed. If it's broken, it could short circuit so the output is the same as the input. It could break so the regulator shorts out your power supply. It could also break as an open circuit so the output isn't connected to anything.
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-06 14:44
    Mike,
    I tried to go back to basics last night... this is what I did - started from scratch.
    I did this to see if I could isolate the problem (thinking it may be the regulator)

    1) I attached my battery pack (19+ volts) to the 1N4002 and the 1000uF Cap (like in Phil's original schematic, but kept it simple).
    2) measured the voltage from the BasicStamp input to ground --- results were, a steady 17+ volts -- sounds okay to me
    3) attached a voltage regulator. I measured the voltage from the output leg to ground --- results were, a steady voltage
    4) I attached a 22uF tantalum (for the first test only one, second -two) and measured the output leg of the cap to ground and the voltage fluctuated.

    This perplexed me.......

    Now, this morning as I was looking at the datasheet I may have found one of my problems. I measured the tantalum in series (output to ground). But, based on the datasheet, the output of the cap should be tied to ground AND I should be measuring the voltage from the outside leg of the voltage regulator to ground.......

    Hmm... this may be a start to the resolution.
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-08 17:09
    Mike,
    At this point, I only have the components my previous posting on my soldless breadboard (i.e. nothing more).

    I now have the 22uF tantalum grounded and am measuring the voltage off the outside leg of the voltage regulator.
    When I measure the voltage on one of my LM2940CT-8.0 I get 13.18 volts and 13.2V on my second regulator.
    For testing purposes I also purchased a LM2940CT-5.0, for which I get 8.3 volts.

    Are these the correct readings for these voltage regulators? I thought I should be getting 8V and 5V respectively.
    It seems that the CT series of regulators were a Chinese version (based on web search); I am wondering if my regulators are defective.

    Please advise, thanks.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-04-08 18:25
    Do you have·this thing hooked up like in the attached drawing?· Y / N
    334 x 383 - 13K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-04-08 18:38
    Franklin, if the battery leads are longer than about 6", you will also need a 0.1uF ceramic cap between In and Gnd, right at the regulator. Also, please double check that your voltmeter is working properly, using a battery of known voltage.

    BTW, PJ, thanks for taking the time to do that drawing. I can't imagine a clearer illustration!

    -Phil
  • Desy2820Desy2820 Posts: 138
    edited 2007-04-09 08:48
    Franklin9090, please check your meter.· You said: ·"I am using a small battery pack that takes 8 1.5V AA batteries. The voltage coming off the pack is around 18V."

    Eight batteries at 1.5 volts each should be 12 volts, not 18 (1.5*8 = 12).· Even·using brand new, fresh batteries, I don't think you should measure higher than 14 volts.· Ni-Cads and NiMh batteries will measure lower than this, about 9.6 volts.·(1.2*8 = 9.6 volts)

    Also, try lightly loading each regulator using an LED and the appropiate vaue series resistor.· Try·to draw about 10mA or so, or just use a plain resistor.· Some regulators behave strangely when not loaded.· Continue trying the other suggestions with the capacittors.

    I hope this helped!

    ·
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-09 14:26
    PJ, thanks for the illustration... it helped me make sure I had things right...
    Phil and Desy2820 - you folks were "dead-on" about my meter, it's readings were high.
    Desy2820 - you threw a lob "over my head" on the 'lightly loading...etc.', but that's okay, see my comment below.

    I was looking to see if my meter had some way of calibrating it, so I opened up the cover for the battery. While I was trying to see the inside of the unit, I noticed that the battery was bulging a bit so I thought maybe I should change it (I don't remember ever changing the battery).

    Long story short -- I re-measured my voltages and voila!!! My 8V reg was giving me 7.99 volts and my 5.0V reg was giving me 4.96 volts so I think I have this leg of the circuit working, now to start on the other leg. And then, to get the circuit off the solderless breadboard and on to the production model...!!! Yahooooooooooo......!!!

    Having a low battery in a meter was the last thing I would have thought, that would give me high voltage readings....

    Post Edited (franklin9090) : 4/9/2007 2:36:35 PM GMT
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-21 13:09
    Sorry about the delay in continuing this thread, got caught up in taxes, etc.



    Any way, I'm was going to start laying out my components and was wondering, does anyone know where I can source the FRAM (eeprom) chip and adapter, and how much they cost? I wanted to·make sure to leave enough room on my production board, I assuming I can purchase the·chip & adapter, economically.



    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-21 14:09
    Ramtron does provide samples (one or two) if you ask for them. Have a look at their website. The adapter I mentioned can be ordered directly from SparkFun (www.sparkfun.com/commerce/product_info.php?products_id=494) although their website says they're out of stock at the moment.
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-22 18:58
    Hey Mike,
    I had look at the RAMTRON website in the past and could only find the "order sample" pages. Ordering samples are great but, of course, in future projects, the availability of components is always a concern, i.e. the sample may work for now but the ability to purchase the product in small quantities is always a concern.

    In looking at the FM22L16 FRAM at RAMTRON, its pretty impressive. 1 trillion read/writes!!! Its a drop-in replacement for SRAM, has data rentention for over 10 years and, of course, does not require a battery for data retention.

    A few concerns that came to mind...
    1) I noticed that the Low Power Operations is 2.7 V to 3.6V, I am stepping the voltage from the auto down from 12V to 8V to 5V with two regulators. Do I need to make another power adjustment?
    2) Do you have any recommendations on how to get around the SparkFun adapter "out-of-stock" problem?
    3) Before I order any samples, I was hoping that you folks might be able to confirm that I am requesting the appropriate product.

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-22 19:08
    The Ramtron FM22L16 is rated at 5V. It's an SPI part, not an I2C EEPROM which is ok if that's what you're expecting (uses the SHIFTOUT/SHIFTIN statements rather than I2COUT/I2CIN statements in the BS2p series Stamps).

    Jameco carries a different line of SOIC to DIP adapters: www.jameco.com/Jameco/catalogs/c272/P161.pdf

    Mouser carries Ramtron parts including a slightly larger SPI EEPROM that is specified for 5V (FM25640): www.mouser.com/search/Refine.aspx?Ne=1447464+254016&Ntt=*fm25640*&Ntx=mode%2bmatchall&Mkw=fm25640&N=1323038&Ntk=Mouser_Wildcards

    Post Edited (Mike Green) : 4/22/2007 7:13:13 PM GMT
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-22 20:16
    Hey Mike,

    Thanks for the prompt response...

    I think you are saying that I would need to use the SHIFTOUT/SHIFTIN statements for my BS2 instead of the IC2OUt and IC2IN. Is that correct?

    I was under the impressions that IC2 was an industry standard way to communicate with a microcontroller, but there doesn't seem to be many IC2·FRAM chips to choose from.·Of course if the SPI method works, I'm okay wiht that....

    Thanks for the Jameco info. In doing a seach on Google using "FRAM adapter SOIC" I came up with some other sources. www.epboard.com seems to have a number of adapters as well. The only thing I could think of·here was to try to match the number of·pins in the adapter to the·FRAM selected. Obviously, with this application, the smaller the adapter the better, as long as the FRAM meets the requirements (which are minimal).

    I also did a search on Mouser using "FRAM", and discovered that they had numerous RAMTRON products. In·looking at the datasheets, I didn't see many references to the ability to retain data without a battery. I saw this on the datasheet for the FM22L16, but not for most of the others. Obviously, the ability to retain the data without a battery is a key requirement of mine.

    The datasheet for the FM25640 seems to reference a standby current, does that have anything to do with·when the automobile is turned off and the current the FRAM would draw?... a little confused here..... Also, I am trying to determine the differences between the 4 FM25640 FRAMs and having some difficulty. Any thoughts?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-22 20:30
    The protocol you use depends on the part you get. Ramtron has some 5V parts that use I2C and they have some parts that use SPI. You pick what you want. I2C uses only 2 I/O pins and it's easy to add on additional parts to the same pins since the devices are addressable. SPI requires 3 to 4 pins and the chip select pin must be unique to the device. The clock and data pins can be shared among multiple devices.

    SHIFTOUT and SHIFTIN exist on all BS2 Stamps. I2COUT and I2CIN are only in the BS2p Stamps. You can still use I2C devices on the other Stamps, but you have to do it using subroutines which are slower and take more program memory.

    Mouser indeed carries a lot of Ramtron devices. I'd use the Ramtron website to sort out what you want to use. They separate their memories as parallel, serial 2-wire (I2C) and serial 3-wire (SPI). I believe all of the memories they make are FRAM and retain their contents without power. They have the patents on the technology and it's how they make their market.

    The standby current is the amount of current the device uses when it's powered, but inactive (not reading or writing). If you turn it off, it's off and would not use any current (because it's disconnected from the power source).

    Check the Ramtron datasheets for the differences among the various parts with similar numbers. Often it's the rated temperature range or package type. There may be part numbers associated with lead and lead-free packaging.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-04-22 21:17
    Franklin -

    Whenever you want to find a source for a particular chip, the FindChips web site is always helpful:
    http://www.findchips.com/

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Larry~Larry~ Posts: 242
    edited 2007-04-22 22:28
    I have been watching this thread for some time and I have some Ideas for you.
    I have built several spedo's with each having more bells and whistles this is what I did

    I used two power inputs to the stamp 1st to power the stamp, allways on, second off ign this tells when car is off when power is turned off. the stamp then saves the odometer value into eprom and goes to sleep. You start up the car it reads the last value and starts to count again, so if you do it this way you have 20years X 365days per year = 7300 days drive it 10 times a day 7300 X 10 = 73,000 times two read and write 73,000 X 2 = 146,000 read / writes to the same spot in eprom and your worried about 1,000,000 or 10,000,000 I would use the last two spots in the program memory one to update every 100 cycles the other every time you stop if this spot goes bad move to another location in about a 100 years
  • franklin9090franklin9090 Posts: 59
    edited 2007-05-17 22:22
    L_Gaminde·& Bruce Bates,
    Thanks for your input; for some reason I didn't get an email message notifying me of your postings.

    L_Gaminde - how would you determine that a memory location in the eeprom has gone "bad"?
    Is there a way to determine the number of writes that have already been performed?

    On a related note, I have been absent from this forum because I am having a little bit of difficulty on determining the speed (input to the BS2). My initial approach was to take the existing speedo cable and attach a Hall-Effect sensor of some kind to count the revolutions. I believe this is a viable approach but there are complications associated with it:

    1) crafting/making/buying/creating a housing for the magnet and sensor (I don't have a lot of space)
    2) the fit between the magnet and the cable must be pretty snuggle to get an accurate reading
    3) calibrating the speedo.

    Any thoughts?

    ·
  • Larry~Larry~ Posts: 242
    edited 2007-05-17 23:26
    EEprom gone bad! the value will not update or will not be read. I would not worry about this you will know!

    now a little info would be nice what kind of car? what trans, transfer case or is it a VW where it comes off the

    front tire give me a clue here.

    1 One of the cars I worked on, I installed magnets on the drive shaft. I used a geartooth sensor on others ·which has the magnets and hall sensor built into one unit and no turning parts. These can be purchased for cars as the newer ones use this type of sensor. they have speed sensors on all four wheels now for anti lock brakes, you might be able to pull out the cable and cable drive and install a geartooth sensor.

    making a speedo is not to bad. get a serial LCD and use the count command and start displaying some info if you have to have someone drive along side and yell out the speed. you don't need odom or trip odom to start get it working and build from there.

    Below is some calibration info I used once my speedo had a calibration setup on it that could be changed to fit different tire size gear ratios and if the government changed the size of a mile.

    READINGS OF 000 TO 999 M.P.H. AND ODOMETER OF 000000.0 TO 999999.0 MILES

    ' SENSOR'S CAN BE 1. HALEFFECT SWITCH, 2. PCM SIGNAL, 3. TRANSMISSION PULSE

    ' (SHOULD BE USED WITH SCHMITT TRIGGER) 4. FORD PROXIMITY SENSOR

    ' CALIBRATIONS SEQUENCE FOR L. C. D. SPEEDOMETER \ ODOMETER

    ' THERE A SEVERAL ITEMS NEEDED FOR CALIBRATION IF USING PULSES FROM DRIVE SHAFT.

    ' LISTED BELOW ARE THE ITEMS NEEDED BEFORE ANY CALIBRATION CAN BEGIN.

    ' 1) TIRE SIZE E.G . 31X10.50

    ' 2) GEAR RATIO E.G. 4.10

    ' 3) INCHES PER MILE ( I.P.M. ) E.G. 63,360

    ' 4) VALUE OF PIE E.G. 3.1415

    ' 5) NUMBER OF PULSES E.G. 1 OR 2 PER REV.

    '1) TAKE YOUR TIRE SIZE 31 TIMES PIE 3.1415 THIS EQUALS TIRE RADIUS OF 97.3865

    ' INCHES

    '2) TAKE I.P.M. 63,360 AND DIVIDE BY TIRE RADIUS OF 97.3865 THIS EQUALS THE NUMBER

    ' OF TIRE TURNS PER MILE 650.603

    '3) TAKE TIRE TURNS PER MILE 650.603 MULTIPLY BY GEAR RATIO OF 4.10 THIS GIVES

    ' THE NUMBER OF DRIVE SHAFT TURNS PER MILE 2667.472.

    '4) TAKE THE NUMBER OF DRIVE SHAFT TURNS PER MILE 2667.472 AND MULTIPLY BY

    ' NUMBER OF PULSES OR MAGNETS ON DRIVE SHAFT (1 OR 2) 2 EQUALS 5334.944 PULSES

    ' PER MILE.

    '5) TAKE TOTAL PULSES PER MILE 5334.944 AND DIVIDE BY 60 THIS EQUALS 88.915 PULSES

    ' PER SECOND.

    '6) TAKE 60 MILES PER HOUR AND DIVIDE BY PULSES PER SECOND 88.915 AND THIS

    ' EQUALS .674 COUNT TIME IN M-SECONDS.

    '7) PUT CALIBRATION \ RUN SWITCH IN CALIBRATION MODE TURN KEY ON. UNIT WILL START

    ' COUNTING AT 25 AND GOES TO 700 WHEN 88 +- 1 IS DISPLAYED PUT CALIBRATION SWITCH IN

    ' RUN MODE AND SPEEDOMETER IS SET FOR YOUR APPLICATION



    ·
  • franklin9090franklin9090 Posts: 59
    edited 2007-05-21 18:23
    L_Gaminde,
    Thank you for your detailed response but I was wondering about a few things.

    For example, you say....
    "EEprom gone bad! the value will not update or will not be read. I would not worry about this you will know"

    I would prefer to have a failsafe method of approach. I may know the EEPROM has reached its limit, but I may not be the person driving the car when that happens (might be my girlfriend). Or, what if is stops working in the middle of a cross country trip?

    The car I am working on is a '89 Mitsubishi Mirage, that has 14" tires (your 31" x 10.5" measurement is unclear to me).

    Where did you purchase your magnets and geartooth sensors? This car has front wheel drive, so I am assuming you are recommending that I install the magnets on the drive shafts in the front (in the engine compartment). Hmmmm.... I don't know about this. I would have to take a look to see where I can install the sensors so it would be close enough to the shaft to read the rotations.

    Also, did you run the wire from the sensor to the passenger compartment (where the BS2 would be) and then to the LCD? Did you have any problems with wire length? Gauge of wire? Or, did you do this wirelessly?

    My original approach was fairly simple and should apply to any automobile:

    A) install magnets and hall effect sensor on speedo cable behind dash (may not work for newer cars)
    B) find a stretch of highway that has mile markers
    C) drive the vehicle X miles and count the number of revolutions of the speedo cable (this is a '89 Mitsu Mirage).
    this gives me miles (or yards or inches) per Y revolutions
    D) program the BS2 to count the revolutions per second, and multiply by 60 seconds X 60 minutes => mph

    Granted the formula is more detailed than I have illustrated, but that was my basic approach. I can't vouch for the accuracy of the BS2's ability to count, calculation and display the data or for the accuracy of the measurement.

    Of course, your approach has merit and I would like to explore your methodology. Where did you purchase your magnets and geartooth sensors?

    Also, in your calculations, did you use the circumfirence of the tire to determine revolutions per mile (not the radius)?
    Or, did I mis-understand your calculations?

    Thanks.
  • Larry~Larry~ Posts: 242
    edited 2007-05-21 19:26
    I would prefer to have a failsafe method of approach. I may know the EEPROM has reached its limit, but I may not be the person driving the car when that happens (might be my girlfriend). Or, what if is stops working in the middle of a cross country trip?
    The car I am working on is a '89 Mitsubishi Mirage, that has 14" tires (your 31" x 10.5" measurement is unclear to me).

    I really doubt you tires are 14" maybe your wheels are 14" and the inside hole of the tire is 14" but not the tire size???
    You need to do it your way! your focased on one thing and cannot get past it, the eeprom and if it stops working.
    What if ?? a wire comes loose, or the maginet comes off, the sensor catches on something and rips off, your regulator goes out, the alternator dies and ·lcd is too hard to see in bright sunlight while driving cross country ( not sure I would drive a 89 anything across country) you find out its not a backlit LCD at night, another wire comes loose ( most common problem in cars) your stamp fries, your program gets a static snap and the program goes bad. Why do you need this, is the speedo in the car bad was it a bad eeprom? anything and everything can go bad !!!
    I was not sugesting anything, just giving Ideas! you pick what works for you. the outside of the speedo cable is a great conduit!! this is why I asked what car it was for, things change. look up speedos·on the internet there are aftermarket units that hook to speedo cables with pulses out. Now back to the EEprom.
  • Larry~Larry~ Posts: 242
    edited 2007-05-22 01:11
    here you go see if this may fit your needs

    http://minimopar.knizefamily.net/speedsensor.html
  • franklin9090franklin9090 Posts: 59
    edited 2007-05-23 22:35
    Thanks for the links, but they all look like they are for American made cars, i.e. not for imports.

    Did I miss something?
  • Larry~Larry~ Posts: 242
    edited 2007-05-24 18:36
    I don't know

    you would be supprised what works with what these days.

    again this was for info only it shows how to make a pickup using the cable and a housing, see if you can adapt something to your needs. I did a quick search. I would bet if you did a search for speedos you would turn up something that could work.

    Isn't this the route you wanted to take! doesn't this give you any ideas on how to go about it ??

    have you checked the threads on your unit does it match any american product, lots of american cars have mixed threads metric\standard or are totally metric who knows whats what!
  • Larry~Larry~ Posts: 242
    edited 2007-05-24 18:55
    more info only!! he adapted a ford cable to mazda speedometer

    Another concern was the gauges in the Mazda. In order to give the proper signal to the coolant temperature gauge, I used an adapter bushing to put the Mazda sensor in the Volvo head. A stock Mustang speedometer cable was adapted to the Mazda speedometer, and the correct combination of plastic gears in the transmission tailhousing gave the right speed. The gas gauge remains the same, but works poorly as it did before. The tachometer is fed a signal from the coil, as it was in the stock setup. The only gauge that was added is a boost gauge, which fit nicely just to the left of the Mazda steering wheel. For the oil pressure idiot light, we installed the Mazda sending unit on the Volvo block.

    http://www.aaronreedbaker.com/truck.html
  • Larry~Larry~ Posts: 242
    edited 2007-05-24 19:06
    another Idea from the internet.

    My vehicle currently has a cable drive speedometer. How do I set it up to work with a programmable speedo?
    If you take your speedometer cable to a local speedometer shop, they should be able to install an upper end that will match the 340-011 pulse generator. This is the easiest and best way to hook up an electronic speedometer in a vehicle that was equipped for a mechanical speedometer. For VW applications, the SN16-VWCAB kit will give you everything you need.

    http://egauges.com/vdo_mult3.asp?Type=Speedometer&Series=Cobalt&Units=E#Which Hall Effect Speed Sender should I use?
Sign In or Register to comment.