Build it step by step
0 of 6 doneMount the load cell
Fix one end to a base and put the handle on the free end, with spacers so the cell can flex.
Wire the amplifier
Connect the four wires to the HX711 and the HX711 to the Nano.
Read raw values
With the sketch at factor 1 you will see raw counts. Check they change when you push.
Calibrate
Hang a known mass, send c and its mass in kg, for example c2.0, in the Serial Monitor.
Test both directions
Push down and pull up. Swap the signal wires if pulling shows positive.
Use peak hold
Press the button to clear the peak and tare.
How do you build a push-pull force gauge?
A load cell on a handle measures pushing and pulling force in newtons, with a peak-hold function. You need Arduino Nano, Load cell 20 kg, HX711 load cell amplifier, SSD1306 OLED Display and Tactile push button 6 mm. It takes 6 steps and about 120 minutes.
- Level
- Intermediate
- Time
- About 120 min
- Parts
- 5
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuyLoad cell 20 kg × 1
- SensorsBuy
- DisplaysBuy
- SwitchesBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Load cell red (E+) | HX711 E+ | Excitation |
| Load cell black (E-) | HX711 E- | Excitation |
| Load cell white (A-) | HX711 A- | Signal (swap with green if the sign is backwards) |
| Load cell green (A+) | HX711 A+ | Signal |
| HX711 DT | Nano D3 | Data |
| HX711 SCK | Nano D2 | Clock |
| HX711 VCC, GND | Nano 5V, GND | Power |
| OLED SDA, SCL | Nano A4, A5 | I2C |
| OLED VCC, GND | Nano 5V, GND | Power |
| Button | Nano D4 and GND | Resets the peak hold |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "HX711" by bogde and "U8g2". Mount the 20 kg bar-type cell with one end fixed and the other end carrying the handle; the arrow on the cell shows the loading direction. Never load it past 20 kg, which is about 196 N, and treat the figures as indicative unless calibrated against a known weight.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <HX711.h>
#include <EEPROM.h>
#include <U8x8lib.h>
HX711 scale;
U8X8_SSD1306_128X64_NONAME_HW_I2C oled(U8X8_PIN_NONE);
const byte BTN = 4;
const float G = 9.81;
float calFactor = 1.0; // HX711 counts per kg; set with the c command
float peak = 0;
void setup() {
Serial.begin(115200);
pinMode(BTN, INPUT_PULLUP);
scale.begin(3, 2);
EEPROM.get(0, calFactor);
if (isnan(calFactor) || calFactor == 0) calFactor = 1.0;
scale.set_scale(calFactor);
scale.tare();
oled.begin();
oled.setFont(u8x8_font_chroma48medium8_r);
}
void loop() {
if (Serial.available()) { // calibrate: hang a known weight, send c and its mass in kg, for example c2.0
if (Serial.read() == 'c') {
float kg = Serial.parseFloat();
scale.set_scale(); // raw counts
calFactor = scale.get_units(10) / kg;
scale.set_scale(calFactor);
EEPROM.put(0, calFactor);
Serial.print("Factor "); Serial.println(calFactor);
}
}
if (digitalRead(BTN) == LOW) { peak = 0; scale.tare(); delay(300); }
float newtons = scale.get_units(3) * G;
if (fabs(newtons) > fabs(peak)) peak = newtons;
char b[17], v[8];
dtostrf(newtons, 6, 1, v); snprintf(b, sizeof b, "Now %s N", v); oled.drawString(0, 2, b);
dtostrf(peak, 6, 1, v); snprintf(b, sizeof b, "Max %s N", v); oled.drawString(0, 4, b);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| No load | About 0.0 N |
| Known 2 kg mass | Reads about 19.6 N |
| Pulling | Reads negative |
| Release | Max keeps the largest push or pull until the button is pressed |
If it does not work
Readings drift
Let the HX711 warm up and avoid touching the cell during tare.
Sign backwards
Swap the white and green wires.
Noisy readings
Use shorter wires and average more samples.
Not accurate
Calibrate again with a mass near what you will measure.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the push-pull force gauge?
Arduino Nano, Load cell 20 kg, HX711 load cell amplifier, SSD1306 OLED Display and Tactile push button 6 mm.
How long does the push-pull force gauge take to build?
About 120 minutes for a intermediate maker, in 6 steps.
How do I know the push-pull force gauge works?
No load: About 0.0 N. Known 2 kg mass: Reads about 19.6 N. Pulling: Reads negative.
Readings drift: what should I check?
Let the HX711 warm up and avoid touching the cell during tare.
Sign backwards: what should I check?
Swap the white and green wires.
Noisy readings: what should I check?
Use shorter wires and average more samples.
Not accurate: what should I check?
Calibrate again with a mass near what you will measure.
