Quantcast
Channel: Sensors - Arduino Forum
Viewing all articles
Browse latest Browse all 1074

My pressure sensor reading results are wrong

$
0
0

MPS20N0040D Barometric Pressure sensor displays a negative number result even though the sensor has not been applied pressure. is there a problem in my code or is my sensor problematic. for the module on this sensor HX710B, and the library that I use is HX710B-base_pressure_sensor.
library from roland pelayo

please help those of you who can solve my problem

#include "HX710B.h"

const int DOUT_Pin = D2;   // Pin data sensor
const int SCLK_Pin = D3;   // Pin clock sensor

HX710B pressure_sensor; 
void setup() {
  Serial.begin(9600);
  pressure_sensor.begin(DOUT_Pin, SCLK_Pin, 128);  // Gunakan faktor penguatan default 128

}

void loop() {
  if (pressure_sensor.is_ready()) {
    Serial.print("Pascal: ");
    Serial.println(pressure_sensor.pascal());
    // Di sini Anda bisa melakukan sesuatu dengan data yang diperoleh dari sensor
  } else {
    Serial.println("Pressure sensor not found.");
  }
  delay(3000);
}


10 posts - 6 participants

Read full topic


Viewing all articles
Browse latest Browse all 1074

Trending Articles