Skip to main content
Explorer
May 24, 2025
Question

How to use USART single wire(half-duplex) for SDI-12 communication protocol using Stm32cubeIDE???

  • May 24, 2025
  • 1 reply
  • 543 views

Hello,

I am trying to communicate with an SDI-12 sensor using STM32L072CZY6TR. I'm using UART half-duplex with the following configuration:

  • Baud rate: 1200
  • Word length: 7 bits
  • Parity: Even
  • Stop bits: 1

My questions:

  1. Do I need a UART to SDI-12 converter module, or can I connect the sensor directly to the STM32?
  2. Do I need signal inversion, and if so, should it be done in hardware or software?
  3. What pull-up resistor value is recommended for the SDI-12 data line?

My current understanding:

  • SDI-12 uses inverted logic compared to standard UART
  • SDI-12 requires a pull-up resistor on the data line
  • Level shifting may be needed between 3.3V and 5V

Has anyone successfully implemented SDI-12 communication with STM32L0 series? Any schematic examples or code snippets would be greatly appreciated.

Thank you!

    This topic has been closed for replies.

    1 reply

    Super User
    May 24, 2025

    Hi,

    SDI-12 requires a pull-up resistor on the data line

    no.

    see : https://www.sdi-12.org/current_specification/SDI-12%20Specification%201.4%20February%2020%202023.pdf

    The data line is a bidirectional, three-state, data transfer line.

     

    Level shifting may be needed between 3.3V and 5V

    right. Its 5V level rx + tx , so i would use something like   74LVC1T45GW   (single line driver).

    1x at 5V supply, to drive the signal line, 1x 3v3 at cpu side.

    from search, typical interface :

    AScha3_0-1748249401985.png

    Using UART for SDI-12 interface

    AScha3_1-1748249606968.png