Source: https://mokxi.com/load-cell-simulator

Simulator

# A load cell simulator: an HX711 and a 5 kg bar on an Arduino

Mokxi is a free online load cell simulator that runs in your browser, with nothing to install and no account needed. A 5 kg bar load cell on an HX711 amplifier, read by an Arduino Uno with the HX711 library. Drag the weight on the bar and the serial monitor prints grams, so you can write and calibrate scale code before the cell arrives.

Start building free or follow the calibration tutorial

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

Drag the slider on the load cell to put a weight on it; the serial monitor prints grams twice a second. Click anything else to open the editor.

## What you can do here

In the circuit above, or in the editor it opens.

- Put any weight up to 5 kg on the cell and read it in grams
- Tare the scale and find a calibration factor with a known weight
- Read the raw 24-bit counts and see the cell’s own offset
- Average readings and watch the last digit settle
- Show the weight on an LCD or an OLED
- Change the cell’s capacity, sensitivity and zero to match yours

## What the running circuit shows

A millivolt at full load, and 24 bits to read it.

A load cell is a bar with four strain gauges in a Wheatstone bridge. This one is rated 1 mV/V at 5 kg, so on the Uno’s 5 V its whole output at full load is 5 mV: one microvolt a gram. The HX711 amplifies that 128 times and converts it to 24 bits, which works out to 2 × 128 × 2²³ × 1 mV/V / 5000 g, about 429.5 counts a gram. That is the number the sketch gives set_scale().

No real cell reads zero with nothing on it, and neither does this one: the serial monitor opens on a raw reading of about 43 000 counts, the cell’s own imbalance times the gain. tare() reads ten times and calls the average zero, and from then on the scale prints “0.0 g”. Drag 250 g onto the bar and it settles on “250.0 g”; drag it to 1000 and it reads “1000.0 g”. The first line after a change is part old and part new, because get_units(5) averages five readings over half a second.

The last digit wanders a little, a “-0.1 g” or a “0.1 g” between the zeros, because the HX711’s input noise is about 50 nanovolts: some twenty counts, a twentieth of a gram. Change get_units(5) to get_units(1) in the sketch and it wanders more.

## How the cell is modeled

The datasheet’s protocol, and the bridge’s ratio.

The HX711 speaks its own two-wire protocol, neither I2C nor SPI, and the model follows the datasheet bit by bit: DT goes low when a reading is ready, each rising edge on SCK clocks out the next of 24 bits, and one to three more pulses pick the next channel and gain. After power-up the first good reading takes four conversions, 400 ms at ten a second. The bridge and the converter share a supply, so the supply cancels, as it does on a real board.

What it leaves out: creep, the slow extra reading a real cell gives while a load sits on it; temperature drift; and overload, since the slider stops at the rated capacity where a real bar bends for good. If you came for a hardware load cell simulator, the box that feeds a known millivolt signal to a weighing indicator, that is a precision resistor bridge, and the Wheatstone bridge simulator shows how a bridge is balanced and unbalanced.

The Arduino HX711 load cell tutorial The Wheatstone bridge simulator Load cell pedals for a sim rig Show the weight on an I2C LCD

## Questions

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

How do I find the calibration factor for an HX711?

Tare with nothing on, put a known weight on, and read the raw average with and without it. The difference divided by the weight in grams is the factor for set_scale(). For this 1 mV/V, 5 kg cell on 5 V it is about 429.5.

Why is my HX711 not reading zero with nothing on the cell?

Because no real bridge is perfectly balanced; this one reads about 43 000 raw counts empty. That is what tare() is for: it measures the offset and takes it off every reading after.

Can I test load cell code without a load cell?

Yes. The circuit above runs the HX711 library on a simulated Uno, so tare, set_scale and get_units behave as written. When the real cell arrives, the number you should need to change is the calibration factor.

## More simulators

Each one opens on a circuit that is already running.

Online circuit simulator Breadboard simulator ESP32 simulator Op-amp simulator Logic gate simulator LED circuit simulator Servo simulator LCD simulator OLED simulator NeoPixel simulator 7 segment display simulator LED matrix simulator Stepper motor simulator Motor driver simulator Ultrasonic sensor simulator Rectifier simulator Digital circuit simulator Potentiometer simulator PWM simulator Relay simulator Shift register simulator DHT11 simulator RFID simulator Accelerometer simulator RGB LED simulator Buzzer simulator MOSFET simulator Circuit simulator for kids Flip-flop simulator Multiplexer simulator Full adder simulator I2C simulator UART simulator Thermistor simulator PIR sensor simulator Oscilloscope simulator Multimeter simulator DC motor simulator Traffic light simulator Diode simulator Capacitor simulator Series and parallel circuit simulator Wheatstone bridge simulator Voltage regulator simulator Soil moisture sensor simulator Zener diode simulator Solar panel simulator AC circuit simulator Thevenin simulator Decoder simulator Encoder simulator PID simulator Robot arm simulator IR sensor simulator LM35 simulator HC-05 Bluetooth simulator nRF24L01 simulator

## Weigh something

Open the circuit, drag a weight onto the cell and watch the grams. Nothing to install, and no account needed.

Start building free Open the editor
