Hi, I'm new to this. Please help me, I have a task to measure the change in tension in a ruler when it is bent using 2 strain gauges, 1 variable resistor, 1 fixed resistor. There are several things that confuse me
- For the sequence as follows, please correct if there are errors. Sorry if it's confusing, this is the best I could draw.
-
How do you install this 3296W variable resistor into the Wheatstone bridge circuit? there are 3 pins and I don't know where to put them.
-
For the program library, I use the HX711 library made by Bogdan Necula and the program code made by ChatGPT as follows, but the results are always like in the following picture:
#include "HX711.h"
// Pin configuration
const int LOADCELL_DOUT_PIN = 3; // Data pin connected to D3
const int LOADCELL_SCK_PIN = 2; // Clock pin connected to D2
// HX711 instance
HX711 scale;
void setup() {
Serial.begin(9600); // Start serial communication
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
// Set the scale to a known reference unit for calibration purposes
scale.set_scale(); // Set the scale to 1 for now
scale.tare(); // Reset the scale to 0
}
void loop() {
// Read raw data from the HX711
long reading = scale.read();
// HX711 is a 24-bit ADC, maximum value is 2^24 - 1
const float ADC_MAX = 16777215.0;
// Reference voltage for the HX711
const float V_REF = 4.3; // Typically between 4.1V and 4.3V
// Calculate the voltage in millivolts
float voltage_mv = (reading / ADC_MAX) * V_REF * 1000;
// Print the result
Serial.print("Voltage: ");
Serial.print(voltage_mv, 3); // Print the voltage with 3 decimal places
Serial.println(" mV");
delay(1000); // Wait for 1 second before the next reading
}
I don't understand what part is wrong, please help because the deadline is coming up :') thank you very much!