Crimpdeq

Meet Crimpdeq, an open source alternative to Tindeq Progressor, that works with Tindeq and ClimbHarder apps!

The project relies on an ESP32-C3 and uses a HX711 to get the measurements from the crane scale. For more details, see the Firmware chapter.

PCB is finished but has not been manufactured yet, hence, it's not tested.

Specs

  • Sampling Frequency: 80 Hz
  • Design Load: 1500 N (150 kg) (Full Scale)
  • Precision:
    • 0.05 kg between 0 and 99 kg
    • 0.1 kg between 100 kg and above
  • Working temperature: 0ºC - 40ºC
  • Dimension: 80 mm x 90 mm x 35 mm
  • USB-C rechargeable battery

⚠️ Note: Some of these specs come from the crane scale, if you use a different one, those values might change.

Making Your Own Crimpdeq

  1. Required Materials

  2. Disassemble the Crane Scale Disassembly

    1. Desolder the battery connections.
    2. Desolder the four wires of the load cell (E-, S-, S+ and E+) from the PCB. Crane connections
    3. Unscrew and remove the PCB along with the display.
  3. Soldering Instructions

    1. Modify the HX711 Module: Most HX711 modules come with the RATE pin connected to GND, meaning that they sample at 10 Hz, if you want to sample at 80 Hz: HX711 Pinout
      1. Break the track of RATE pin.
        1. I did this by scratching the module with a knife.
      2. Verify with a multimeter that GND and the RATE pin are not connected anymore.
        • Make sure that you don't break the next connection.
      3. Solder the RATE to VDD pin.
      4. Verify with a multimeter.
    2. Connect the Crane Scale to the HX711:
    • Solder the 4 wires of the crane scale to the HX711. Usually the colors are:

      HX711 PinLoad Cell PinDescription
      E+E+ (Red)Excitation positive (to load cell)
      E-E- (Black)Excitation negative (to load cell)
      S+S+ (Green)Signal positive (from load cell)
      S-S- (White)Signal negative (from load cell)
      • Note that sometimes the S pins are referred as A.
    1. Connect the HX711 to the ESP32-C3-DevKit-RUST-1 devkit:
    HX711 PinESP32-C3 PinDescription
    VCC3.3VPower supply (3.3V)
    GNDGNDGround
    DT (Data)GPIO4Data output from HX711
    SCK (Clock)GPIO5Clock signal for communication

    ESP32-C3 Connections

    1. Verify all the connections with a multimeter.
  4. Adapt the Scale Case:

    1. Create space for the USB connector.
      • I did this by placing the devkit, marking the space that I needed with a pen and then, heating a knife and melting the case.
    2. Install the battery holder:
      1. Glue, with some silicone, the battery holder, make sure to leave the lid for the original batteries of the scale open, as there is a hole for which you need to introduce the two wires of the battery holder.
      2. Solder the positive wire (red) of the battery holder to a switch/button, to turn on/off the device, then, solder the other pin of the button/switch to the B+ pin of ESP32-C3-DevKit-RUST-1.
      3. Solder the negative wire (black) of the battery holder to the B- pin of the ESP32-C3-DevKit-RUST-1.
    3. Close the case:
      1. Ensure all components are securely installed before closing the case. Assembly
  5. Upload the firmware:

    1. Connect your device with a USB-C cable.

    2. Pull the crimpdeq repository:

      git clone https://github.com/SergioGasquez/crimpdeq.git
      

      If you don't have git installed on your system, you can go to the green Code button and use the "Download ZIP" option.

    3. Upload the firmware to your device:

      1. Download the binary from the desired GitHub release.
      2. Open esp.huhn.me.
      3. Click Connect and select the serial port of your ESP board.
      4. Upload your .bin file(s).
      5. Click Program.

      See this blogpost for more details.

    4. Check if the calibration values work for your scale:

      1. Connect your device with ClimbHarder or Tindeq apps.
      2. Use the "Live View" option.
      3. Measure a known weight and verify that Crimpdeq measures the right value.
        1. If Crimpdeq calibration is off, see the Calibration chapter.

Calibration

This guide will help you calibrate your Crimpdeq device to ensure accurate weight measurements. The calibration process involves using a known weight to establish a reference point for the device's measurements.

  1. Download and install the nRF Connect app for your platform:
  2. Connect nRF Connect with Crimpdeq:
    1. Launch the nRF Connect app.
    2. Navigate to the Scanner tab.
    3. Look for a device named "Progressor_7125".
    4. Tap "Connect".
    5. Once connected, the app will display the device's services and characteristics. nRF Discovered
  3. Locate the Calibration Characteristic:
    1. Expand the "Unknown Service" section.
    2. Look for the characteristic with UUID: 7e4e1703-1ea6-40c9-9dcc-13d34ffead57. Services
  4. Calculate the Hex Value of your known weight:
    1. Open the Floating Point to Hex Converter.
    2. Use "Single-precision" floating point converter.
    3. Enter your known weight in the "Float value" field.
    4. Click "Convert to hex".
    5. Save the resulting "Hex value". Example: For a known weight of 75.3 kg, the hex value would be 0x4296999a.
  5. Perform Calibration:
    1. Hang your Crimpdeq with no weight attached.
    2. Send the command 7300000000 to the characteristic:
      • Tap the Up Arrow icon on the characteristic (7e4e1703-1ea6-40c9-9dcc-13d34ffead57).

      • Enter the command as shown in the screenshot.

        Send weight

    3. Now, attach your known weight to the Crimpdeq.
    4. Prepare the calibration command:
      • Take your hex value from the previous step.
      • Add 73 at the beginning. Example: For 75.3 kg (0x4296999a), the command would be: 734296999a.
    5. Send this new command to the same characteristic (7e4e1703-1ea6-40c9-9dcc-13d34ffead57).

Important Notes

  • The known weight should be greater than the maximum weight you plan to measure.
  • Make sure the device is stable and not moving when sending calibration commands.
  • The calibration process should be performed in a controlled environment.

Charging the Battery

To charge your device simply:

  1. Connect a USB-C Cable:
    • Plug the device into a power source using a USB-C cable.
    • A red LED will turn on, indicating that the device is charging.
  2. Wait for the Charge to Complete:
    • Once the red LED turns off, the battery is fully charged.
    • You can now unplug the device and use it!

Device Charging

Firmware

The firmware application is written in asynchronous Rust (no_std) using esp-hal along with some ancillary crates.

Prerequisites

To build and upload the firmware to your device, ensure you have the following installed:

  • Rust: See installation for details
  • The stable toolchain with the ESP32-C3 target architecture installed:
    rustup toolchain install stable --component rust-src --target riscv32imc-unknown-none-elf
    
  • probe-rs installed, see instructions

How to Build

To build the firmware, run:

cargo build --release

To build and upload the firmware to your device, refer to the Build and Flash your Device section.

How to Flash your Device

Build and Flash your Device

Since we've set a custom runner in the .cargo/config.toml, you can build and upload the resulting binary to your target using:

cargo run --release

This will also open a serial monitor, allowing you to view log messages in real time.

To modify the log level, update the DEFMT_LOG value in .cargo/config.toml or set it when running the command:

DEFMT_LOG=debug cargo run --release

Flashing From Your Browser

This method does not require any of the Prerequisites, but also it does not allow modifying the code. Instead, it only allows flashing a released firmware version.

To flash the released binary using your browser:

  1. Download the binary from the desired GitHub release
  2. Open Adafruit ESPTool
  3. Click Connect and select the serial port of your ESP board (should be named USB/JTAG serial debug unit...)
  4. Upload your .bin file(s) at offset 0x10000
  5. Click Program Flashing with ESPTool

Code Structure

hx711

This module implements the load cell functionality, it's an async version of the loadcell crate with additional modifications.

ble

This module implements the Bluetooth Low Energy (BLE) functionality:

  • Defines the GATT server and services
  • Handles advertising and connections
  • Defines the Progressor service with data point and control point characteristics

progressor

The progressor module implements the Tindeq API, enabling BLE (Bluetooth Low Energy) communication between the ESP32-C3 and a smartphone.

Main Tasks

The main.rs file defines several asynchronous tasks that run concurrently:

  • measurement_task:
    • Initializes the load cell
    • Handles taring and reading measurements from the sensor.
  • ble_task:
    • This is a background task that is required to run forever alongside any other BLE tasks.
  • gatt_events_task:
    • Processes GATT events like control point writes
  • data_processing_task:
    • Handles sending notifications with data points

Communication between tasks occurs via a Channel.

PCB

The PCB design is located in the hardware folder and was created using KiCad. It is a two-layer layout based on the Rust ESP Board. This design removes unused sensors from the original board and adds the necessary components for this project.

Status

Currently, the PCB has not yet been manufactured, so it remains untested.