Shop OBEX P1 Docs P2 Docs Learn Events
AtD conversion formulas — Parallax Forums

AtD conversion formulas

The Lazy DestroyerThe Lazy Destroyer Posts: 21
edited 2005-01-27 03:10 in General Discussion
Hi, need some help!

I've been playing with doing ATD stuff but cannot figure out how to easily convert the digital data from the converter to the proper "reading" I need for my 2p40 project.

For example, if 0.60V is to equal 5.9 inches of vacuum on a sender, how does one go about converting the "492" (read from the 12 bit converter) output to "5.9", when the other values read do not seem linear? I graphed some of the values from a conversion chart I obtained for the sender and it has a wierd slope to it. It looks exponential but starts to slump over

On the sender I'm using, I get:

.3V (246) for "2.9 inches"
.6V (492) for "5.9 inches"
1.1V (901) for "8.9 inches"
1.7V (1393) for "11.8 inches"
2.2V (1803) for "14.8 inches"
2.7V (2213) for "17.7 inches".

I would figure there would be a multiplier and an offset for a conversion like this (example 5.9=492x+y) but this formula does not seem to work with all at once, so I'm assuming a non-linear equasion? It's been forever since I've done this kind of algebra, and I'm sure there is an easy "trick" to getting it, but how do the pro's convert that data? I've googled for a while and still have not found any worthwhile data on this.. there must be an easy way tho to find the conversion....

Any help is appreciated.

-Blake

Comments

  • BorisBoris Posts: 81
    edited 2005-01-26 16:21
    To find the formula, try throwing the data in excel, and making a graph with a trendline. Then just show the formula for the trend line, which can any order exponential formula, logariphmic. If one trend line still does not do a good enough job (on the graph it goes far of some points). You can break the data up into 2,3 portions and make different formulas that way. Then in basic stamp software, just test what range the data falls under, and use appropriate formula.
  • achilles03achilles03 Posts: 247
    edited 2005-01-26 17:47
    What "sender" are you using? Sounds like some sort of pressure sensor. What's the part number? Look up the data sheet and see if the output is supposed to be linear or along some curve.

    Dave
  • The Lazy DestroyerThe Lazy Destroyer Posts: 21
    edited 2005-01-27 03:10
    Well looks like the conversion chart I obtained for the sender was wrong. I looked through some AllData material and it looks pretty linear now, but slightly curved. I should be able to use a straight line and it will be close enough for me.

    Dave, the sender is a GM MAP sensor for vacuum readings. Hopefully the other senders I'm using (pressure and temp sensors) will be more linear.
Sign In or Register to comment.