Skip to content

Introduction

OpenScale IoT Hookup Guide Banner Image

The SparkFun OpenScale - IoT offers an easy-to-use wireless solution to measure weight and temperature. This version of the OpenScale works with multiple load cell types and lets users access the device wirelessly over Bluetooth®, BLE and WiFi (using TCP/IP) to configure calibration value, sample rate, time stamp and units of precision through the OpenScale - IoT's serial menu.

The OpenScale IoT is built around the ESP32 Pico Mini module that handles both firmware and communication (both wireless and wired) and transferring scale and temperature data to a serial terminal . It also handles communication with the HX711, a 24-bit ADC for weigh scales; and the TMP102, for recording the ambient temperature of your system.

The board also includes a 3-pin screw terminal connector for attaching an external temperature sensor where needed as well as a Qwiic connector for users who'd like to add other I2C devices to their OpenScale project.

In order to follow along with this guide you'll need the OpenScale - IoT, a USB-C cable and a load cell. For our example, we've selected a 5kg Straight Bar load cell. You can find this and all other load cells SparkFun offers in our Force/Flex category.

Topics Covered

This guide contains three main sections: Quickstart Guide, Hardware and Software.

The Quickstart Guide goes over how to connect a load cell to the OpenScale - IoT and configure it using a serial terminal and the Configuration Menu.

The Hardware section provides a detailed overview of the OpenScale - IoT as well as instructions on connecting a load cell and temperature sensor to the OpenScale.

The Software section covers how to connect the OpenScale - IoT to a computer or Bluetooth device to perform initial configuration and calibration. It also has information on performing extended calibration steps as well as how to update the firmware.

Resources and Support Documentation

You'll find the board design files (KiCad files & schematic), relevant documentation (datasheets, white papers, etc.) and other helpful links in the Resources. Lastly, the Support section includes a Troubleshooting page that includes any helpful tips specific to this board as well as information on how to receive technical support from SparkFun.

Quickstart Guide

Hardware Overview

Let's take a closer look at the OpenScale - IoT and the hardware on the board.

Annotated photo of the OpenScale - IoT

ESP32 Pico Mini

The ESP32 Pico Mini is a dual-core 32-bit microprocessor that supports 2.4 GHz WiFi, Bluetooth and BLE. The OpenScale - IoT uses the version of the ESP32 Pico Mini with a built-in PCB antenna. The ESP32 Pico Mini hosts the OpenScale - IoT firmware that controls the board's other components and handles all serial and wireless communication. The board runs the module at 3.3V and firmware defaults to enable Bluetooth, WiFi as well as both the USB and serial UART ports. Users can enable or disable any of these ports through the OpenScale - IoT's serial configuration menu. Read on to the Software sections for detailed information on all configuration options and how to use each communication method.

The OpenScale - IoT allows for configuration of the board over a Bluetooth connection with a host device running a terminal interface. Connecting to the OpenScale - IoT over WiFi requires entering network information over a serial terminal. Note, WiFi data from the OpenScale - IoT is read only.

HX711

The HX711 is a 24-bit analog-to-digital converter (ADC) for weigh scale applications. It operates at either 10SPS (samples/second) or 80SPS. The OpenScale - IoT sets it to operate at 10SPS by default and adjusting to 80SPS is done through the RATE solder jumper. Note that when operating at 80SPS the noise floor doubles to 90nV.

TMP102

The board includes a TMP102 temperature sensor for onboard temperature monitoring. It has an average accuracy of ±0.5°C over it's operating temperature range of -25°C to +85°C. The TMP102 communicates over I2C and its unshifted 7-bit address is 0x49.

Load Cell and Sensor Connections

The OpenScale - IoT has two options to connect weight sensors depending on what type used; screw terminals for load cells and 0.1"-spaced plated through-hole (PTH) pins for load sensors/strain gauges.

Load Cell Screw Terminals

The screw terminals labeled LOAD CELL let you connect a load cell to the OpenScale - IoT with just a screw driver. Pay attention to the markings on the board to match with the wire colors of the load cell. The labels here should match most load cell wiring colors but make sure to refer to your specific sensor's wiring diagram for proper wiring with the OpenScale - IoT. The list below outlines the "typical" wire color and the wire functions coming from a load cell:

  • Excitation+(E+) or VCC -> RED
  • Excitation-(E-) or GND -> BLACK/YELLOW
  • Output- (O-), Signal- (S-), or Amplifier- (A-) -> WHITE
  • O+,S+ or A+ -> GREEN/BLUE

Load Sensor Combinator

The Load Sensor PTHs let users connect four load sensors/strain gauges into a wheatstone bridge configuration to the HX711 to create a weigh scale. Each of the four PTHs (UL/UR and LL/LR) have labels for C, + and -. These labels match to common wire colors on single strain gauges (load sensors) according to the list below:

  • C -> RED
  • + -> WHITE
  • - -> BLACK

Not all strain gauges follow this color code so make sure to refer to your strain gauges' documentation to wire it correctly.

External Temperature Sensor

The three-pin screw terminal labeled TEMP lets you add an external 3-wire temperature sensor like the DS-18B20. The on-board TMP102 runs a bit hot, especially with the ESP32's radios enabled, so users may need an external temperature sensor to get more accurate temperature data.

Gain

The two-pin screw terminal labeled FIXED allows users to adjust the HX711's gain amplifier. The HX711 features an active low noise programmable gain amplifier with gains of 32, 64 and 128. Use channel B inputs for A+ and A- and you will get an automatic gain of 32. Please refer to the datasheet for specifications and diagrams.

Serial Interfaces

The ESP32 supports multiple UART interfaces simultaneously. The OpenScale - IoT has a USB-C connector tied to the ESP32's USB data pins along with a 0.1"-spaced 6-pin UART PTH tied to the ESP32's UART (TX/RX) pins.

USB-C

The USB-C connector on the board allows for a quick and easy connection between the OpenScale and a computer to configure and monitor weight data. We recommend performing initial configuration over USB-C with a computer and a terminal interface.

Serial PTHs

The serial PTH header on the OpenScale - IoT connect directly to the ESP32's serial UART pins (RX/TX) and also breaks out pins for serial UART communication. These are available for users who wish to connect directly to another serial UART device or possible an external serial-to-USB converter.

Qwiic

The Qwiic connector on the OpenScale - IoT lets you connect other Qwiic/I2C peripherals to the board. The default firmware does not include support for external devices so users need to upload customized firmware to use the OpenLog - IoT with any Qwiic/I2C peripherals.

Buttons

The two buttons on the board are labeled RESET and BOOT. The RESET button resets the board. The BOOT button resets the firmware to stock settings. These buttons can also be used to force the ESP32 into bootloader mode if needed during manual firmware updates. The firmware section of this guide has more information on updating firmware manually.

LEDs

The OpenScale - IoT has four LEDs labeled TX, RX, PWR and STAT. The TX/RX LEDs illuminate when serial data is sent/received. The PWR LED indicates when the board has power. The STAT LED is a user-progammable LED tied to D4 on the ESP32.

Solder Jumpers

There are eight solder jumpers on the OpenScale - IoT. The list below outlines each jumpers label, functionality and default states along with any other notes on their use.

  • DVDD - This three-way jumper selects the digital supply voltage for the HX711. It defaults to set DVDD to 3.3V. Open the Left/3V3 side of the jumper and close the Right/5V to switch DVDD to 5V.
  • RATE - This jumper sets the HX711's data rate to 10SPS (samples per second) by pulling the HX711's RATE pin to Ground. Open the jumper to switch the data rate to 80SPS though this doubles the noise floor to 90nV.
  • TX - This jumper completes the TX LED circuit. Open this jumper to disable the TX LED.
  • RX - This jumper completes the RX LED circuit. Open this jumper to disable the RX LED.
  • PWR - This jumper completes the Power LED circuit. Open this jumper to disable the Power LED.
  • STAT - This jumper completes the Status LED circuit. Open this jumper to disable the Status LED.
  • I2C - This three-way jumper pulls the I2C bus to 3.3V. Completely open this jumper to remove pullup resistors from the I2C bus.
  • SHLD - This jumper ties the USB-C's shield pin to the board's ground. Open this jumper to isolate the shield pin from ground.

Board Dimensions

The OpenScale - IoT measures 2.20" x 1.85" (55.88mm x 46.99mm) with four mounting holes that fit a 4-40 screw.

Dimensional drawing

Hardware Assembly

Now that we're familiar with the hardware on the OpenScale - IoT, let's connect a load cell and temperature sensor to start getting data from the board.

Connecting the Load Cell and External Temperature Sensor

The OpenScale - IoT has 3.5mm screw terminals to connect load cells and an external temperature sensor. It also has 0.1"-spaced PTH pins for each of these connections as well for users who prefer a soldered connection.

Most load cells will have a Red/Black/White/Green wire color code. Insert these wires into their matching screw terminal and tighten the terminal to finger tight. Some load cells use a blue wire in place of the green wire or a yellow wire in place of the white wire but don't worry, it will still work! Load cells with a large capacity or a long connecting cable may have an additional yellow shield wire for the four signal wires. If your load cell has this wire, connect it to the yellow/shield screw terminal.

With both the load cell and temperature sensor connected, your assembly should look similar to the photo below:

Photo of a load cell and external temperature sensor connected to the OpenScale - IoT

Load Sensor Assembly

If you've decided to create your own wheatstone bridge configuration with four discrete load sensors/strain gauges (like our 50kg load sensor) you'll need to use the built-in Load Cell Combinator to combine four strain gauges into a wheatstone bridge configuration. See the Load Cell Combinator Hookup Guide for more information. The markings UL, UR, LL and LR stand for Upper Left, Upper Right, Lower Left and Lower Right respectively. Just like you would see if you opened up a bathroom scale. The C mark is for the "center tap" which is explained in the Load Cell Combinator tutorial.

Scale Calibration

The OpenScale IoT must be calibrated after assembling it to get accurate weight data out of it in your preferred units. Calibration requires putting a known weight on the sensor connected to the OpenScale - IoT and calibrating through the configuration menu. The following pages give detailed instructions on calibrating the scale along with other configuration options.

OpenScale Configuration

Communication Options

The OpenScale - IoT can be configured over Bluetooth, USB-C and serial UART. Connecting to the device over WiFi is read only and requires a TCP/IP terminal connection. All communication interfaces are enabled by default.

Bluetooth

The OpenScale - IoT broadcasts as an available Bluetooth device named "OpenScale-IoT-#### where "###" is a unique 4-digit ID# for the ESP32 module. Check "Broadcasting as "OpenScale-IoT-ID#" in the Configuration Menu for the specific device ID if you're not sure of the correct ID#. After pairing and connecting to the OpenScale - IoT, open a serial terminal program and connect to the device port. If you're using a phone to connect to the OpenScale - IoT you'll need an application installed. We found the Android app called "Serial Bluetooth Terminal" worked great in our testing.

Wired Serial Interfaces - USB-C and Serial UART

The USB-C interface lets users connect the OpenScale - IoT to a computer to configure and view data over a serial terminal application. The Serial UART interface lets users connect to an other serial UART device or to a computer through a serial-to-USB converter. The default baud rate for these interfaces is 115200.

WiFi

The OpenScale - IoT can connect to a WiFi network to broadcast data from it using TCP/IP. To connect to WiFi first open a terminal either over a wired connection or Bluetooth. Next, open the configuration menu and enter "W". Follow the prompts to enter the WiFi network's ID and password and the terminal will print out if it successfully connects to the network. Once connected, the menu now includes lines saying "WiFi connected. IP address: " along with the TCP port. The IP address is unique to each OpenScale - IoT but the TCP port will always be "10001".

Once connected, open a TCP connection in a terminal program that supports connecting to a TCP Client. Enter the device's IP and TCP port and you'll see data printing out. You can also have another terminal connection to the OpenScale - IoT over serial or Bluetooth simultaneously to change settings.

Configuration Menu

When you initially open a terminal connected to the OpenScale - IoT (with the baud set to 115200 and line endings enabled) it will automatically start printing out data that includes a timestamp, weight (in grams) and TMP102 temperature (in Fahrenheit) every second. With the terminal open, simply enter "X" to open the configuration menu and you'll be greeted with this menu:

Configuration menu printout

From here just enter the matching number/letter for the setting you'd like to adjust. The menu automatically times out after 60 seconds and resumes reporting data if no characters are sent. Let's take a quick look at each option and the available settings (where applicable):

  • 1) Tare scale to zero - Tare the scale
  • 2) Calibrate scale / Current scale factor - This lets you input a manual value for what the OpenScale measures. Use this for calibrating the OpenScale to a known weight value.
  • 3) Suppress Negative Output - Prevents negative weight values from printing out.
  • 4) Enable timestamp - Enable or disable the timestamp.
  • 5) Set delay between reports - Change the delay between reports in milliseconds (Default is 1000ms)
  • 6) Set baud rate - Set the baud rate. Default is 115,200bps
  • 7) Set external baud rate - Set the external (Serial UART) baud rate. Allows users to have different baud rates for Serial UART and Bluetooth/USB-C if necessary.
  • 8)Set units of measure - Set the units of measure. When selected this prints out available units along with the currently selected unit. Enter the number corresponding to the preferred units. Available units of measure are grams, kilograms, ounces, pounds, raw output and pieces.
  • 9) Set number of decimal places - Set the number of decimal places for all values printed.
  • 10) Enable on-board temperature sensor output - Toggle the on-board TMP102 output on or off.
  • 11) Enable external temperature sensor output - Toggle output for an external temperature sensor connected to the TEMP connections.
  • 12) Set temperature units of measure - This toggles between temperature values between Fahrenheit and Celsius.
  • 13) Set delay between external temperature reports - Set the number of miliseconds between temperature updates. Minimum of 500ms max of 1000ms.
  • 14) Enable status LED - Toggle the STATUS LED on and off. By default the status LED alternates between on/off with each report.
  • 15) Enable serial trigger - Toggle the serial trigger character on or off. When enabled, the OpenScale will only send reports when it receives the serial trigger character.
  • 16) Set serial trigger chararacter - Set the serial trigger character. Default is "!"
  • 17) Enable external UART - Toggle the external UART (RX/TX) on or off. Default is On.
  • b) Select Bluetooth Channel - This opens the Bluetooth channel selection menu. Options are Bluetooth SPP/Classic, Bluetooth Low Energy, Dual (SPP/Classic and BLE) or OFF. Dual is enabled by default.
  • t) Enable TCP Server - Toggles the OpenScale - IoT WiFi TCP server on or off.
  • w) Set WiFi name and password - Enter WiFi network credentials. First enter the network name, then the password.
  • u) Update Firmware - Automatically update the firmware over a WiFi connection.
  • f) Factory reset - Restore all settings to factory presets.

Scale Calibration

Before calibration make sure to set the OpenScale to report in the unit you want to calibrate with by entering "8" and selecting the corresponding number (grams, ounces, etc.). Next, enter "2" to calibrate the scale. First remove all items from the scale and enter a key to tare it. The OpenScale will tare and print out when it completes along with the current tare value. Once this process finishes, place an object with a known weight and then enter that value as a float. The new calibration factor is stored and prints out.

After the scale is calibrated, converting between units is seamless; the firmware automatically converts between units and there is no loss of precision. The scale updates roughly every 500ms.

Calibration Tips

Creep is the change in load cell signal occurring with time while under constant load and with all environmental conditions and other variables also remaining constant. Load cells tend to creep meaning they will change their output slightly over time when a weight is left on the scale for long (30+ minutes) periods of time. To calibrate for something such as a bee hive that will be permanently left on a scale:

  • Place everything on the scale that will be the zero state
  • Leave the scale for 30+ minutes
  • Tare the scale with these weights
  • Place two calibration weights onto the scale
  • Leave the scale for 30+ minutes
  • Calibrate the scale to this combined weight
  • Remove one of the calibration weights and verify scale output

More information about load cells and creep can be found here. Creep is also load cell specific. You will find a section on creep in the data sheet for your specific load cell. This calibration method may need to be repeated every season with changing temperatures and humidity.

Firmware Updates

--8<-- "./docs/firmware.md

Troubleshooting

WiFi Communication Tips

General Troubleshooting

Note

Not working as expected and need help?

If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.

If you don't find what you need there, the SparkFun Forums are a great place to find and ask for help. If this is your first visit, you'll need to create a forum account to search product forums and post questions.

Resources

Check out the following resources for more information about the OpenScale - IoT: