Activity Forums General Discussion Pressure sensor reading w/Controllino MAXI Automation

  • Pressure sensor reading w/Controllino MAXI Automation

  • dlee-upt

    Member
    January 26, 2022 at 8:25 pm

    Hello Controllino world,

    I have been experimenting around with sensors and the Controllino Maxi Automation and I came across using a pressure sensor. Now I was able to hook everything up and write a simple Arduino code to get the reading of the pressure sensor but now I need help on converting the analog input I am reading into a pressure value (psi, torr, kPa). Could anyone help me or point me to the right direction?

    My code is below:

    #include <Controllino.h>

    const int pressureInput = CONTROLLINO_AI11;

    const double pressureZero = 82.0;

    const double pressureMax = 921.6;

    const int pressureTransducerMaxPSI = 100000;

    const int baudRate = 9600;

    const int sensorReadDelay = 250;

    float pressureValue = 0;

    void setup() {

    Serial.begin(baudRate);

    pinMode(pressureInput, INPUT);

    }

    void loop() {

    pressureValue = analogRead(pressureInput);

    //pressureValue = ((pressureValue-pressureZero)*pressureTransducerMaxPSI)/(pressureMax-pressureZero);

    Serial.print(“pressure value: “);

    Serial.println(pressureValue, 1);

    delay(sensorReadDelay);

    }

    • This discussion was modified 2 years, 9 months ago by  dlee-upt.
  • This content has been hidden as the member is suspended.
  • This content has been hidden as the member is suspended.
Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now