Connecting SDI-12 to esp32

Thread Starter

TryingHere

Joined Jan 4, 2023
19
Greeting everybody,

im working on building my own sdi-12 sensors reader. Got some coming in over the weekend. And I’ve been doin more studying and found out that sensor communication on one data line. And it’s can accept input of 3.0-5. Would like 3.6 and it come back I believe 3.6v. But the esp32 can only accept 3.3v. So I’ve been trying to find a bidirectional step up and done on one line.

Love to engage in a good conversation and hopefully find out what my missing part is. Thanks

lmk if we need any more info.

MOD: Corrected Title from SPI to SDI
 
Last edited by a moderator:

Thread Starter

TryingHere

Joined Jan 4, 2023
19
Not going to lie got to look more into this. But you saying that this with take 3.3v step to 3.6 one way on the data line and then 3.6 to 3.3v the other way

I can’t just connect 3.6 to a 3.3 data pin

thanks
 

Papabravo

Joined Feb 24, 2006
21,313
Not going to lie got to look more into this. But you saying that this with take 3.3v step to 3.6 one way on the data line and then 3.6 to 3.3v the other way

I can’t just connect 3.6 to a 3.3 data pin

thanks
Yes, I understand that you should not directly connect data lines from systems with different VCC voltages but trust me when Isay I have used these parts before to connect subsystems with different VCC voltages. Read carefully what I wrote:
  1. You have a device that is powered from a VCC of 3.3 Volts that will accept an input voltage that is higher than VCC, whose output will go into the esp32. This device has standard TTL thresholds of Vil=0.8 V defining a logic '0' and Vih=2.0 V defining a logic '1'. this device will convert 0-3.6V signals into 0-3.3V signals.
  2. You have a device going in the other direction that is powered from a VCC of 3.6 Volts that has TTL thresholds of 0.8V and 2.0V. This will level shift the 0-3.3V signals into 0-3.6V signals.
Each SPI signal line goes in one direction only, but you can use devices with a tristate enable to connect multiple SPI devices to the esp32. I've given you the part number for a buffer device, but there are also inverters and tristate buffers that you can find.

These devices have three properties that are essential to this application:
  1. Wide VCC range
  2. Inputs tolerant of voltages in excess of VCC
  3. Standard TTL thresholds instead of the typical CMOS thresholds.
As with any device you intend to use you should read the datasheet(s) very carefully
 

Papabravo

Joined Feb 24, 2006
21,313
I’m just looking for a bi directional 3.3 to 3.6 and 3.6 to 3.3 on same data line
Listen to me! SPI does not require a bidirectional interface.
  1. SCLK is unidirectional
  2. MOSI is unidirectional but may involve a tristate buffer
  3. MISO is unidiretional
  4. SS* (Slave Select) is unidirectional
Where did you get the quaint notion that SPI was bidirectional?

Here is the datasheet for the tristate buffer
https://www.onsemi.com/download/data-sheet/pdf/mc74vhc1g125-d.pdf
 
Last edited:

Thread Starter

TryingHere

Joined Jan 4, 2023
19
I just want to let you know all know that I really am taking you all serious and trying to learn I’m not trying to come across like I know anything the reason why I think it was by directional is because I had to send a command and then receive a command maybe I’m misunderstanding Thst

I really do appreciate all the time and energy you guys do give it is very much a blessing I’m gonna read those comments and do some more digging and I’ll try to ask some not overly stupid questions thanks again guys
 

Thread Starter

TryingHere

Joined Jan 4, 2023
19
Really do appreciate the information and fast feed back. I’m sorry I’m still a noob but doing my best :). Thanks

Yes, I understand that you should not directly connect data lines from systems with different VCC voltages but trust me when Isay I have used these parts before to connect subsystems with different VCC voltages. Read carefully what I wrote:
  1. You have a device that is powered from a VCC of 3.3 Volts that will accept an input voltage that is higher than VCC, whose output will go into the esp32. This device has standard TTL thresholds of Vil=0.8 V defining a logic '0' and Vih=2.0 V defining a logic '1'. this device will convert 0-3.6V signals into 0-3.3V signals.
  2. You have a device going in the other direction that is powered from a VCC of 3.6 Volts that has TTL thresholds of 0.8V and 2.0V. This will level shift the 0-3.3V signals into 0-3.6V signals.
Each SPI signal line goes in one direction only, but you can use devices with a tristate enable to connect multiple SPI devices to the esp32. I've given you the part number for a buffer device, but there are also inverters and tristate buffers that you can find.

These devices have three properties that are essential to this application:
  1. Wide VCC range
  2. Inputs tolerant of voltages in excess of VCC
  3. Standard TTL thresholds instead of the typical CMOS thresholds.
As with any device you intend to use you should read the datasheet(s) very carefully
 

Thread Starter

TryingHere

Joined Jan 4, 2023
19
I am a little confused because you’re referring spi with the I’m talking about SDi-12 protocol
they are two different type right? Just like uart and ic2 are not the same?

Listen to me! SPI does not require a bidirectional interface.
  1. SCLK is unidirectional
  2. MOSI is unidirectional but may involve a tristate buffer
  3. MISO is unidiretional
  4. SS* (Slave Select) is unidirectional
Where did you get the quaint notion that SPI was bidirectional?

Here is the datasheet for the tristate buffer
https://www.onsemi.com/download/data-sheet/pdf/mc74vhc1g125-d.pdf
 

Papabravo

Joined Feb 24, 2006
21,313
So what is wrong with using the tristate buffer depicted on page A-1 of the specification mentioned in post #7? The 74VHC1G125 should be perfect for this application.

You can always do a discrete design and control the thresholds rather precisely. Sorry but no existing IC that I am aware of precisely matches the requirements of this particular interface. I guess I might want to reverse engineer one of the sensors to see what they are doing. You may be surprised at what you find.

There is a big difference between what spec writers put in the specifications and what design engineers actually try to get away with. Of course, they NEVER write specs that suggest the use of existing parts.
 
Last edited:

Thread Starter

TryingHere

Joined Jan 4, 2023
19
So what is wrong with using the tristate buffer depicted on page A-1 of the specification mentioned in post #7? The 74VHC1G125 should be perfect for this application.

You can always do a discrete design and control the thresholds rather precisely. Sorry but no existing IC that I am aware of precisely matches the requirements of this particular interface. I guess I might want to reverse engineer one of the sensors to see what they are doing. You may be surprised at what you find.

There is a big difference between what spec writers put in the specifications and what design engineers actually try to get away with. Of course, they NEVER write specs that suggest the use of existing parts.
hey all this helps. I honestly thought I was going to be able to to straight connected I have limited knowledge. Why I came here, definitely learning on the fly and there a lot.
Again really appreciate you trying to help, we all learn.
this the page A-1 your talking about
D6A296B9-9C19-4472-A086-8BBF35AB74E8.png
I’m not opposed to trying anything, honestly this make more sense to me but I’m still learning to read schematics. I was hoping there was a chip that was plug and play. But I’m down to attempt to build my own Circuit if need be.

im going to look more into 74VHC1G125 as that might be my plug and play. But not sure

I’m also not sure of the sensor data output is always 3.6 regardless of the 2.8v to 5v.

but the issue is there only one line one data pin. So I’m guessing it would be best to aim for 3.6v

maybe that what the schematic is saying

this will all make more sense after diving into it more and the lovey help of the community
 

Papabravo

Joined Feb 24, 2006
21,313
hey all this helps. I honestly thought I was going to be able to to straight connected I have limited knowledge. Why I came here, definitely learning on the fly and there a lot.
Again really appreciate you trying to help, we all learn.
this the page A-1 your talking about
View attachment 284542
I’m not opposed to trying anything, honestly this make more sense to me but I’m still learning to read schematics. I was hoping there was a chip that was plug and play. But I’m down to attempt to build my own Circuit if need be.

im going to look more into 74VHC1G125 as that might be my plug and play. But not sure

I’m also not sure of the sensor data output is always 3.6 regardless of the 2.8v to 5v.

but the issue is there only one line one data pin. So I’m guessing it would be best to aim for 3.6v

maybe that what the schematic is saying

this will all make more sense after diving into it more and the lovey help of the community
Yes, I think you can use that chip as both a transmitter and a receiver. For the transmitter you control the tristate enable to be active if and only if it is your turn to transmit. Remember only one transmitter can be active on the bus at any point in time. Use the same part for the receiver but have the tristate enable on all the time unless you don't want to continuously monitor the bus.

Because of the 510 Ω resistor you can power the transceiver made up of the two individual 125's powered from 3.3 Volts through that resistor to the data bus.
 

Thread Starter

TryingHere

Joined Jan 4, 2023
19
Yes, I think you can use that chip as both a transmitter and a receiver. For the transmitter you control the tristate enable to be active if and only if it is your turn to transmit. Remember only one transmitter can be active on the bus at any point in time. Use the same part for the receiver but have the tristate enable on all the time unless you don't want to continuously monitor the bus.

Because of the 510 Ω resistor you can power the transceiver made up of the two individual 125's powered from 3.3 Volts through that resistor to the data bus.
Bro honestly you rock. Been YouTube chat.openai and googling and looking around and learning a lot. Get what your saying. So the(125s) are the 74VHC1G125 and your saying I need to build a Circuit using two 125 and toggle them (starting to follow)

I also found this forum hereLink to other forum
It’s been down inactive for about a year

they talk about using two 74hc244's not sure if they are the same family of chips lol

the talk about the same schematic from the white pages(SDi-12)


7D8395E6-0ED9-401B-A361-E3DF61DB625F.png7645203D-9968-4A1D-A893-040EA0DE85EE.png

magazine you rock thanks for having Paients with me :).
 

Thread Starter

TryingHere

Joined Jan 4, 2023
19
So your saying that the schematic from the white paper is right. So that guy in the other post made a circuit in black thst I posted above all that should work? . I just see 5v the sdi12 can take it. But it says 3.6 back.
I feel like I’m getting it but still
Little lost. Really appreciate it.
 

Thread Starter

TryingHere

Joined Jan 4, 2023
19
Yes, I think you can use that chip as both a transmitter and a receiver. For the transmitter you control the tristate enable to be active if and only if it is your turn to transmit. Remember only one transmitter can be active on the bus at any point in time. Use the same part for the receiver but have the tristate enable on all the time unless you don't want to continuously monitor the bus.

Because of the 510 Ω resistor you can power the transceiver made up of the two individual 125's powered from 3.3 Volts through that resistor to the data bus.
I believe this makes a lot of sense. Just got to get a diagram. I believe I have it. Just need to get the puzzle together right.

do appreciate. and alway if you think I’m missing something or completely wrong please lmk thanks
 
Top