Pressure sensor read

Trying to use (cheap) pressure sensor sold via Amazon by ALMOCN. No useful instructions I can find, it's pins are labeled "VCC OUT SCK GND". Guessing OUT should go to an analog pin to be read....but that seems to only and always yield 1023. Any suggestions of useful info about these boards?

Chuck in Dallas

Hth:

With what? If Arduino, say which one.

Using a non-arduino Nano built by Gikfun. They call it "USB Nano V3.0". My code is almost identical to the analog pin version sent by ruilviana. My code:

String pgmName = "FSRtestV1";
int a, b, c, x, y, z;
float pressure;
int rawAna;

void setup() {
Serial.begin(115200);
delay(200);
Serial.println(pgmName);
}

void loop() {
rawAna = analogRead(A5);
Serial.println(rawAna);
delay(1000);
}

What does your Serial monitor say?
What pressure are you putting on the sensor?

If your sensor is the one linked to in Post #2 the link tells all including a code sample. You do not use an analog channel. You clock the module and get a digital signal out corresponding to the pressure. This is where a link to exactly what you bought would go a long way?

Ron

Welcome Back!

Why not contact the vendor and ask for help? They state: "We provide high-quality products and the highest standard of customer service.Any more question,please contact us freely."

With the information you have given I cannot even come up with a reasonable guess. Post links to technical information on the sensor. I have sensors that look like what is on the board but I do not think they are the same.

Have you tried the digital version of the code?

// Define pins for HX710B
const int dataPin = 2; // DOUT
const int clockPin = 3; // SCK

void setup() {
  pinMode(dataPin, INPUT);
  pinMode(clockPin, OUTPUT);
  Serial.begin(9600);
}

long readHX710B() {
  long result = 0;

  // Wait for the module to be ready
  while (digitalRead(dataPin) == HIGH);

  // Read 24-bit data
  for (int i = 0; i < 24; i++) {
    digitalWrite(clockPin, HIGH);
    result = (result << 1) | digitalRead(dataPin);
    digitalWrite(clockPin, LOW);
  }

  // Apply clock pulse to complete the conversion
  digitalWrite(clockPin, HIGH);
  delayMicroseconds(1);
  digitalWrite(clockPin, LOW);

  // Return the 24-bit result
  return result;
}

void loop() {
  long pressureValue = readHX710B();

  Serial.print("Pressure (raw value): ");
  Serial.println(pressureValue);

  // Add a delay
  delay(500);
}

Can you please post a link to where you purchased the sensor?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

The "SCK" (Serial CLock) tells you it's a digital sensor, not analog. The sensor value is sent as a series of bits, and the clock signal, which is output by the Arduino, controls when each bit is sent.