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

Saving data for later use - Auto odometer

2

Comments

  • franklin9090franklin9090 Posts: 59
    edited 2007-03-21 02:39
    Phil,
    I'm sorry, what do you mean by "saturates"?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-03-21 03:00
    I meant "doesn't exceed". You want to ensure that the Stamp won't see a voltage on its input higher than 4.7V - 5.0V.

    -Phil
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-22 14:59
    Phil,
    I would like to make sure to protect my BS2 over the long run. Testing the voltage at the initial set-up assures me the the diode is working correctly but how long will it last without a breakdown. Should I be considering some kind of "protection" for the BS2 from the voltage coming in on the "signal good" pin?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-22 15:32
    The 10K resistor would provide excellent protection. Typically these fail by becoming an open circuit which would disconnect the Stamp from the power source at worst. Zener diodes are unlikely to fail except due to excessive current and/or overheating and the 10K resistor would prevent the excessive current. Other components are likely to fail from excessive heat before the Zener. Most components are good to at least 55C or 70C (130F or 150F).
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-25 00:06
    Mike,
    I have started to acquire the parts I need, but I ran into some questions.
    I bought a 1/4 watt 10K resistor, is that alright? There was no mention of wattage with respect to the resistor.
    I bought a 50V .1uF capacitor, since the store was out of 35V (I believe this is okay).
    I checked with most of the electronics stores in my neighborhood and no one stocked the LM2940-8V; RadioShack carried the 7805 (which I think is a step down to 5V, not 8V as recommended). I can get the part but its special order.
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-25 00:07
    Also, should I be concerned about how much current this is going to pull and if I am going to blow the fuses in my automobile?
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-28 23:08
    should I be concerned about blowing fuses in my car with this circuit?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-28 23:42
    Get used to doing rough estimates of voltage, power, etc. for these small parts. Ohms Law (E = IR) and the definition of power (Watts = EI) are useful. Let's say you've got 20V across this resistor. Ohm's law says you'd have a current of 2ma. That's 40mw which is way way below the 250mw that the resistor you've bought can handle.

    The 50V rating for the 0.1uF capacitor is pretty typical for this capacitance value. If you could find a 35V version, it would be slightly smaller, that's all. You generally want 2-3x the maximum expected voltage in the circuit as the minimum "breakdown voltage" of the capacitor. With electrolytic capacitors (including aluminum and tantalum types) you don't want the rated voltage to be too high because the oxide coating on the foil that makes up the dielectric of the capacitor won't form properly.

    Your whole circuit should not draw much current. You do want some kind of fuse to protect against a wiring error or a part failure. Very small value fuses are pretty expensive, so use something like 1/2A or 1/4A. Since you don't expect this to ever blow, you could buy "pigtail" fuses which have wires attached so they can be soldered into the circuit. You can also buy an inline automotive fuse holder to put in the power leads coming off your circuit board or you can get some kind of fuse holder clip that mounts in your box or on your circuit board.

    Post Edited (Mike Green) : 3/29/2007 12:24:14 AM GMT
  • willy1067willy1067 Posts: 107
    edited 2007-03-29 03:40
    Guys, few questions, I usually like to do more with less.

    If Franklyn is using a BS2 all ready, isn't easier to just keep the BS2 power up from the car battery and keep all the data intact?

    or is there a way to write data directly into the BS2 until next power up?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fernando Gomez

    revinc.us
    gomez-rivera.com

    Never compare yourself with anyone else, there will always be someone bigger·or·smaller·than you.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-29 03:52
    You could keep the BS2 powered up. You would need to be very careful about power consumption since even milliampere hours eventually add up. 4 days is about 100 hours. 40 days is about 1000 hours. A 50ma constant drain will exhaust a car battery in a month or so.

    Read the discussion earlier in this thread about writing data directly to the BS2's program EEPROM.
  • willy1067willy1067 Posts: 107
    edited 2007-03-29 04:21
    franklin,

    Radio Shack used to sell circuit lay out that you had only scrach into a blank, but for some reason they don't sell it any more.

    My method of making my own boards is;

    (As a first timer, I would sugest mike's approach first in order to see what you are doing.)

    Use a drawing program, (I like Corel Draw) to draw exactly what you have in the paper into your artwork

    Have a sign shop plot the layout into a piece of vynil, (Thank God I have my own) remove the background and only leave what you need

    Paste it into a double side copper blank

    buy the etchant solution from Radio Shack and place it on a disposable tray big enough to fit your board
    heat the etchant a little before plasing the board.

    place the board into the tray, and agitate until the unwanted copper is removed, check to make sure the copper is also removed from the other side before cleaning it.

    Drill your holes with 1/32 brill bit, and place all your components.

    If someone has a easier way, please post it, I could use it too. lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fernando Gomez

    revinc.us
    gomez-rivera.com

    Never compare yourself with anyone else, there will always be someone bigger·or·smaller·than you.
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-29 17:54
    Mike,

    Thanks for your advice and input on the circuit calculations and values. I had done some research and had found that most of the books in my local library showed examples of calculating current and power for resistors (but not anything else). Since they only covered resistors, I didn't know what to do about the other components.

    All in all, I realize that this circuit will probably not pull a lot of current; I was only trying to expand my understanding of the circuit.

    I have many questions like "why is there a component X and not Y", but I am not going to ask those in this thread (I have asked a lot already). I think I am going to work on my basic understanding of electronics first.

    I think the fuse idea is a good one, I will incorporate one in my final project.



    Fernando, thanks for your input. If you are looking for other ways to create PCBs you might look here...

    http://www.instructables.com/tag/?limit%3Atype%3Ainstructable=on&q=pcb

    For this project, I will not create a custom PCB. As much as I like microcontrollers, etc., since I don't do this kind of thing very often, I didn't want Ferric Chloride sitting around my home. Also, the Super Carrier Board that was recommended for this project has a breadboard on it.

    Also, I don't think leaving the BS running on the battery is such a good idea (ever·leave your lights on?), plus, writing to the EEPROM·eliminates the need to have the BS running.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-29 18:01
    Franklin9090,
    I have been very impressed with the content of the Wikipedia as far as electronics is concerned. If you want to find out about capacitors, just do a websearch on "wiki capacitor" and you'll get a link to start with. There are formulas, explanations, pictures, etc.
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-30 14:39
    Mike,
    Thanks for the tip on Wikipedia, I'll start using that and my local library resources to enhance my electronics knowledge.
    I have seen many schematics in books and on the Internet, but it seems that someone always has their own twist on things. For example, Phil's recommendation on using an 8V voltage regulator to step down the voltage before it got to the Super Carrier Board.

    I understood what Phil's recommendation was and felt comfortable with it, but some times in books, the recommendation and the reasoning is not clear.

    Eventually, I would like to be able to construct a circuit like the one that Phil recommended, since I realize that one of the keys to successfully implementing BS projects is good design and good interfaces.

    I realize there are an infinite amount of variables, for example, I have a few cigarette light DC-DC converters that convert 12V to 6V at 1 Amp. I was wondering, if I used one of those, how it would affect the circuit? Unfortunately, my questions could be endless. More research and study on my end is paramount, in my opinion.

    Oh, one other question, we have been discussion writing to the EEPROM on the BS. If I run out of "writes"....
    1) will I get an error messge? (hope this never happens)
    2) Is there an EEPROM only solution that I could/should consider? For example, can I have an EEPROM chip hanging off a BS pin, that I could write to?

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-30 15:06
    1) The "erased" value of a location is all one bits. A location has "worn out" when one or more bits will not program to zero. There's no checking.

    2) Ramtron makes a device they call a FRAM (ferroelectric RAM) which works just like an EEPROM (and is a "drop-in" replacement), but doesn't have the write delays of a standard EEPROM and doesn't wear out as readily as standard EEPROMs. They quote 10 billion cycles. You could use one of these for storage and your car would probably wear out before the FRAM.
  • franklin9090franklin9090 Posts: 59
    edited 2007-03-30 15:15
    Mike,
    When you say "drop-in" replacement, does that mean that the FRAM can easily be plugged into a socket on a BS board? I didn't think the Super Carrier Board had any sockets; should I consider purchasing a socket I should solder in. Also, is there an example/article that I can read to properly install and use a FRAM?

    Do you have the part numbers?

    Is the FRAM easy to write to via the BasicStamp software?

    Thanks.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-03-30 15:16
    Franklin,

    If hanging another memory IC off the Stamp is a possibility, you might consider a FRAM chip, like the FM24C64 from Ramtron. It's capable of more than a trillion writes, which should be adequate, even if you recorded every .001 mile.* This would obviate the need for power fail detection, so long as you wrote your data with some sort of checksum and used alternate memory locations for each write — in case a write became aborted partway through. On powerup up, you would then read all candidate memory locations, picking the one showing the highest mileage and which had the proper checksum.

    *The more often you record the mileage, the less cummulative round-off error you'll experience with the total.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-30 15:34
    "Drop-in" means that it's a functional replacement and, although the FRAM may have features that an EEPROM doesn't have, existing programs should work without change. The FRAM memories only come in surface mount packages (and don't use sockets). You can buy little PC board adapters from SparkFun and others that you solder the surface mount part to and the adapter will plug into a DIP socket (or mount to a Super Carrier Board). Look at Ramtron's website (www.ramtron.com) for datasheets and descriptions of their serial memory parts. As a "drop-in" replacement for standard EEPROMs, you can use the same routines for the FRAM as you would for EEPROMs. Have a look at the Nuts and Volts column on I2C memory access (www.parallax.com/dl/docs/cols/nv/vol5/col/nv115.pdf). This column has an example of the use of a small EEPROM, but the same code would work with any size up to 64K x 8 (24LC512).
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-02 14:45
    Phil and Mike,
    Thanks for the info. on a FRAM chip; I think I need to do some more detailed research.

    I guess I need to determine if I am going the "power fail detection" or the FRAM route. I have purchased the parts for the former, but the later has its advantages.

    From what little I know about surface mount technology, I believe I need different solder and a different soldering iron. Is that your understanding too?
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-02 21:12
    Mike,
    I was trying to price out the FRAM alternative but was unable to find the adapters on the SparkFun site. Can you give me some help in finding the adapters?

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-02 21:17
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-04 14:30
    Phil/MIke,
    At this point, since I already have the components for the circuit, I decided that I would build the circuit. And then, as time permits, I will add the FRAM.

    I put the circuit together on a solderless breadboard but I am wondering if one of my components might not be operating correctly. I applied various voltages (between 6 and 14.5) to the circuit and the voltages that I got between the 22uF tantalum cap and ground varied considerably.

    I guess I thought that by using a 8V regulator, I assumed that if I applied a voltage above 8V, I would get 8V. Below 8V, I assumed I would get that value i.e. if I applied 5V, I would get 5V.

    Am I incorrect in my assumption?

    Also, is there a way for me to test my components, individually? At least that way I would be able to determine if I have a bad component.

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-04 15:16
    Make sure you have the circuit hooked up correctly. Also keep in mind that the 22uF capacitor is the minimum. Try a larger capacitor and see what happens.

    Also, the input voltage has to be at least 1/2V (the dropout voltage) above the rated voltage for regulation to work.
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-04 17:09
    Mike,
    I'll work on getting another 22uF cap; don't have one in my possession right now.

    If I interpret you statement correctly, I would need 9V or 10V, for my LM2940-8V to regulate the voltage, right?
    And, if my voltage is 8V or below, I should be getting 8V or below, correct?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-04 17:23
    Yes, you need at least 8.5V input for the LM2940-8 to begin to regulate the output voltage. Below that, you will see as output roughly 1/2V less than the input voltage.

    About the output capacitor ... You could leave the 22uF in place and just add something much larger, even in aluminum. That might not be the issue, but breadboards are notorious in occasionally providing poor connections.
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-05 01:39
    Mike,

    So this is what I have found:

    1) I checked my jumpers and their respective connections to my ground and positive with an ohm meter;everything looked okay. I didn't check the component parts, since I do not know how.

    2) In Phil's original diagram, he did not have a regulator or 22uF tantalum before the BasicStamp. Unfortunately, being a novice I drew those in and in doing so, didn't realize that tantalums are polarized. I think my tantalum was installed in reverse and may have been damaged. Do I need a tantalum or can I just use a higher value aluminum?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-05 02:13
    Some aluminum electrolytics will work. Try what you've got. Worst case ... it won't work.
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-05 16:05
    Mike,

    I tried reversing the 22uF tantalum and wasn't sure if my readings were right.

    I have been measuring the voltage from the tantalum to ground... is that the correct reading to take?

    Also, the readings seem to fluctuate, meaning either goes down or goes up, but it tends to plateau at some point.

    I am using a small battery pack that takes 8 1.5V AA batteries. The voltage coming off the pack is around 18V. Is that alright? I believe the voltage regulator can handle that, based on the spec sheet.

    Anything else I should consider?
  • franklin9090franklin9090 Posts: 59
    edited 2007-04-05 16:08
    Mike,
    Sorry, I didn't address your earlier comment.
    I purchased a few (47uF, 100uF, 250uF) capacitors for testing this morning, I will try them this evening.

    I also have two other 22uF, 35V·tantalums in my possession, what happens if I hook them up serially?
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-05 16:34
    Hooking up capacitors in series is the same as hooking up resistors in parallel. The same formula applies. Theoretically, the voltage rating is additive, but I would treat that conservatively. The formula is:

    Ctotal = 1 / ( (1 / C1) + (1 / C2) + ... + (1 / Cn) )

    The output of the regulator shouldn't fluctuate (that's why it's called a regulator instead of a fluctuator). You may need the extra capacitance for stability. I'd take two 22uF tantalums and put them in parallel at the output of the regulator and see what happens. Again, make sure everything is hooked up properly. Check the polarity of the capacitors and check which pin is which on the regulator (look at the datasheet).
Sign In or Register to comment.