Supion - I²C Quick User Manual

The Supion sensor interface can be implemented using an STM32 Nucleo-L476RG microcontroller, available on our website: here. This interfacing can also be realized using the microcontroller of your choice. Although this manual focuses on the use of the STM32 Nucleo-L476RG microcontroller, a separate manual will explain how to use another microcontrollers.

The microcontroller must be interfaced with the sensor in order to retrieve its data, and for this purpose an I²C (Inter-Integrated Circuit) communication bus is used.

Part 1 will focus on hardware configuration of the STM32L4 microcontroller and its connection to the Supion sensor.
Part 2 will focus on installing the necessary software.
Part 3 will focus on flashing code to the microcontroller.
Part 4 will focus on visualizing the data sent by Supion to the microcontroller through I²C.

Part 1 - Hardware Configuration and Connection to Supion

  • When you receive the sensor, you must first create the connector for the different wires, so that you can plug the sensor to the microcontroller.Picture of the SUPION sensor after unpacking
  • Strip cable by at least 5 cm.Picture of the stripped wire
  • The cable shielding need to be linked to ground, so you also need to strip it and create a common plug with the black wire (ground of the sensor).Example of the steps done for the creation of the common plug
  • If it is too complicated, you can cut it to the limit of the cable stripping and solder a cable at the base. (insulate the part being solder !!!).Example of the soldering of the cable shielding with another wire
  • To plug to the microcontroller, you can use a male or a female pin connector for each wire.
  • Before crimping, we recommend to soldering the wire, because it is very thin compared to the size of the connector.Example of the steps to do to make the connector pin
  • When this is done, you can plug the pins to the NUCLEO-L476RG as illustrated below.Diagram of wires connections to the Nucleo board

Part 2 - Software Setup

  • You need to download STM32CubeProgrammer. The software is available here: download link.
  • Once downloaded, STM32CubeProgrammer must be installed with all its extensions.
  • Install a terminal emulator for serial connection. We recommend using Tera Term, available here: download link.

Part 3 - Flashing

  • The .elf file containing the compiled code that will be inserted into the STM32L4 microcontroller can be downloaded here: download link.
  • Connect the STM32L4 microcontroller to the computer via USB.
  • Launch STM32CubeProgrammer.
  • In the top right-hand corner, click on the refresh button shaped as a circle on the right of "Serial number".
  • Select the STM32L4 microcontroller in "Serial number".
  • Click on "Connect" just above.
  • Click on the three horizontal bars in the top left-hand corner to expand the menu.
  • Click on "Erasing & programming".
  • In "File path", click on "Browse" and select the .elf file you downloaded earlier.
  • Click on "Start Programming".
  • Once a confirmation message appears in the logs at the bottom of the window, click on "Disconnect".

Part 4 - Checking proper operation

  • Launch Tera Term.
  • Select "Serial", choose our STM32L4 microcontroller and click on "OK".
  • Click on "Setup" then on "Serial port...".
  • In "Speed", set a value of "115200", then click on "New setting".
  • By clicking on the microcontroller's reset button, the Supion values should appear in the terminal.

In case of problems with the STM32L4 board

The STM32L4 board may be experiencing problems when trying to be programmed, which may be due to out-of-date firmware.

Updating the firmware on the STM32L4 board is very simple:

  • Connect the STM32L4 microcontroller to the computer via USB.
  • Launch STM32CubeProgrammer.
  • In the top right-hand corner, click on the refresh button shaped as a circle on the right of "Serial number".
  • Select the STM32L4 microcontroller in "Serial number".
  • Click on "Connect" just above.
  • In the bottom right-hand corner, click on "Firmware upgrade".
  • Click on "Refresh device list", then select the STM32L4 board.
  • Click on "Open in update mode".
  • Click on "Upgrade".
  • Wait for the "Upgrade successfull" confirmation message.
Back to blog