Sensor Math Help - VDC to Kpa
skynugget
Posts: 172
Hey all, I'm having a completer brain lapse on this, and cant seem to get my math to work out attempting to scale a pressure sensor reading.
Linear Scale:
MIN : at 15 Kpa the sensor outputs 0.2Vdc
MAX: at 115 Kpa the sensor outputs 4.7Vdc
Can anyone help me out with the proper SX/B math to make it happen?
Thanks in advance!
Post Edited (skynugget) : 5/1/2009 7:28:13 PM GMT
Linear Scale:
MIN : at 15 Kpa the sensor outputs 0.2Vdc
MAX: at 115 Kpa the sensor outputs 4.7Vdc
Can anyone help me out with the proper SX/B math to make it happen?
Thanks in advance!
Post Edited (skynugget) : 5/1/2009 7:28:13 PM GMT
Comments
I don't know SX/B syntax so you'll have to translate the equation into understandable code.
Post Edited (pmrobert) : 5/1/2009 7:46:12 PM GMT
right?
So a range of 4.5 = range of 100 (subtracting offsets)
Scale would be 100/4.5 * 256 if using */ (or 5,688.88888888889)
So.... lets presume in my sample below that 2 = .2 and 47 = 4.7 from your sensor reading... not sure how you are reading input values here so I can't do more than that. With that in mind the above would be 100/45 * 256 or 568.888888888889
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
thanks zoot! just what i needed.
Post Edited (skynugget) : 5/1/2009 8:25:01 PM GMT