Stiffness Tester

This repo contains a K64F MCU program for Venkat’s Stiffness Tester.

Use uScope to view the live data:


On the HX711 development kit, the RATE pin of the HX711 chip itself was loosened from ground and connected to VDD, to increase the output rate from 10 Hz to 80 Hz.


By hanging a known weight at a measured distance from the sensor we calibrated the sensor together with the HX711 amplifier.
This turns out to be 251733.6 bit/Nm. The sensor has a 24 bit ADC and a default gain of 128. It is run at 5V. Therefor the sensitivity of the torque load cell is 853 Nm/V. (Such that torque = input / 2^23 * 5V / 128 * 853 Nm/V).


The motor shield should be stacked on top of the K64F. The BioRobotics shield should be stacked on top op the motor shield.

The jumpers on the motor shield should be set to PWRIN, such that the external power supply is used.

The female 2.1 mm DC jack should be connect to the PWRIN +/- terminals on the motor shield.

The M1 +/- and M2 +/- of the motor shield should be connected to the M1 and M2 terminal on the BioRobotics shield. (The order of + and – for the motors will flip the direction but otherwise matters not.)

The 6-wire motor connectors need to be connect to the ‘M2’ connector (white to white and red to red).
The other end should be connected to the motor (also white to white and red to red). The motor cable extension can also be used here.

On small HX711 breakout board, connect:

  • GND to MCU ground
  • VCC to MCU +5V
  • DT to D2 on the MCU
  • SCK to D3 on the MCU
  • E+ to the sensor Vcc (red wire)
  • E- to the sensor ground (black wire)
  • A+ to the sensor output 1 (white wire)
  • A- to the sensor output 2 (green wire)

On the K64F, connect:

  • D2 and D3 to the amplifier (see above)
  • D12 to encoder 2, channel B
  • D13 to encoder 2, channel A
  • A0 to POT2 (if using the potmeter)

Baked into the motor shield are the connections:

  • D4 direction motor 2
  • D5 PWM motor 2
  • D6 PWM motor 1
  • D7 direction motor 1


The program can be compiled locally with MBED Studio, or using the online compiler at

MBED includes submodules through the .lib files. They are not literal Git submodules.


View Github