Hi there, I'm using the following pressure transducers (6 of them) to monitor pressures in a system and watch for a pressure drop.
Festo Pressure Transmitter - SPTE-P10R-S6-B-2.5K
They are 24V sensors, and output 1V-5V at a range of 0-10bar (0psi - 147psi), and with zero pressure in the system they read at .98v or so, and register about 200 in the arduino MEGA2560. How can I convert the readings to psi, given these sensors output 1-5V instead of 0-5V?
I hope I'm asking this question correctly! I promise I searched, but didn't find anything relating to the fact that my readings range from 200ish to 1023, not from 0 to 1023.
Thanks in advance from a mechanical engineer attempting to mettle about with electronics.
Take a look in the reference at the map function.
Your value of 200 makes total sense, because if 0 - 1023 represents 0 - 5 volts, 200 is very near 1 volt. (1024/5 is about 205.)
Anything less than one volt is meaningless for the pressure sensor. So anything under 1V is meaningless, as is any number under 200.
An easy solution is just to take your reading and subtract 200. Now you have a number ranging from 0 to 823 (1023 - 200) that represents pressure from 0 to 147 PSI. To figure out the values in the middle, just multiply whatever reading you get by 147 (the highest PSI) and then divide by 823 (the highest count.)
Take a count of 823 as an example. We know it means 147, so this will prove the formula works. 823 * 147 = 120,981. Divide 120,981 by 823 and you get 147 PSI. Bingo! Try it again for a count of 411 (right in the middle) and you get about 73PSI (right in the middle of the PSI range.)
I'm curious to know if the numbers below 200 are intended to measure vacuum. If the sensor reads 1V at one atmosphere, you could measure the drop in pressure as you go up a mountain or pull intake air through an engine manifold. Sounds like a fun project.
wildbill:
Take a look in the reference at the map function.
Thanks wildbill, I'll have a look. Map function is next on my list of things to learn!
davescodemusings:
Your value of 200 makes total sense, because if 0 - 1023 represents 0 - 5 volts, 200 is very near 1 volt. (1024/5 is about 205.)
Anything less than one volt is meaningless for the pressure sensor. So anything under 1V is meaningless, as is any number under 200.
An easy solution is just to take your reading and subtract 200. Now you have a number ranging from 0 to 823 (1023 - 200) that represents pressure from 0 to 147 PSI. To figure out the values in the middle, just multiply whatever reading you get by 147 (the highest PSI) and then divide by 823 (the highest count.)
Take a count of 823 as an example. We know it means 147, so this will prove the formula works. 823 * 147 = 120,981. Divide 120,981 by 823 and you get 147 PSI. Bingo! Try it again for a count of 411 (right in the middle) and you get about 73PSI (right in the middle of the PSI range.)
I'm curious to know if the numbers below 200 are intended to measure vacuum. If the sensor reads 1V at one atmosphere, you could measure the drop in pressure as you go up a mountain or pull intake air through an engine manifold. Sounds like a fun project.
Thanks Dave, this is exactly the answer I was looking for to get me going! I knew it had to be something along those lines, but all my mathematical contortion didn't get me there.
That's a great question about whether these sensors can measure vacuum, I'll have to ask my Festo sales rep about that! I have a vacuum pump here that I could use to test it, but I don't want to damage the sensor.
Also, thanks for the interest in my project! It's a prototype I'm developing for work, so I have to be very vague unfortunately, since it's the first of it's kind in our industry. Essentially, this is a system to measure for leaks in a series of inflated hoses. Up until now, the industry has used very simple valves to fill and drain these bags with no leak detection. However, the industry is making a shift toward IOT and intelligent machines, so we are developing a method of integrating automatic leak detection for this system. I really wish I could share more, but it's pretty hush-hush stuff. As soon as various bits of paperwork are filed, I'll be sharing some details about this setup.
I promise my lips are sealed. I've forgotten all about pressure sensors... and I was never here. 8)