cancel
Showing results for 
Search instead for 
Did you mean: 

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

Ikram_safia11
Associate

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!

1 REPLY 1
AScha.3
Super User

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.

If you feel a post has answered your question, please click "Accept as Solution".