Logic Level Conventer for UART 5V / 3.3V with high transmission speed (115200)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












2














I need to connect ESP32 (3.3 V) and Arduino UNO (5 V) on the UART bus. I used to connect two devices through a 1k resistor and it worked. I want to make a reliable connection.



On the Internet, I found a matching circuit for UART levels based on a BSS138 transistor.
enter image description here



Will this scheme work reliably at a transfer rate of 115200 BOD? If it were not, would you advise me a more reliable option?










share|improve this question



















  • 1




    115.2 kBaud is not really high speed. Here someone simulated the same circuit and found that it works comfortably even at 2 MHz: electronics.stackexchange.com/a/367055/31091 The link also contains a detailed explanation of the circuit and its frequency-limiting factors.
    – Geier
    Dec 25 '18 at 13:20







  • 2




    One resistor is not really a proper solution except when you have a current rating for the protection diodes. But two resistors forming a voltage divider can be a fine solution - more definitive than your proposal except for things that need to run for a long time on battery. But a 5v Arduino wouldn't be suitable for that to begin with.
    – Chris Stratton
    Dec 25 '18 at 14:11















2














I need to connect ESP32 (3.3 V) and Arduino UNO (5 V) on the UART bus. I used to connect two devices through a 1k resistor and it worked. I want to make a reliable connection.



On the Internet, I found a matching circuit for UART levels based on a BSS138 transistor.
enter image description here



Will this scheme work reliably at a transfer rate of 115200 BOD? If it were not, would you advise me a more reliable option?










share|improve this question



















  • 1




    115.2 kBaud is not really high speed. Here someone simulated the same circuit and found that it works comfortably even at 2 MHz: electronics.stackexchange.com/a/367055/31091 The link also contains a detailed explanation of the circuit and its frequency-limiting factors.
    – Geier
    Dec 25 '18 at 13:20







  • 2




    One resistor is not really a proper solution except when you have a current rating for the protection diodes. But two resistors forming a voltage divider can be a fine solution - more definitive than your proposal except for things that need to run for a long time on battery. But a 5v Arduino wouldn't be suitable for that to begin with.
    – Chris Stratton
    Dec 25 '18 at 14:11













2












2








2


1





I need to connect ESP32 (3.3 V) and Arduino UNO (5 V) on the UART bus. I used to connect two devices through a 1k resistor and it worked. I want to make a reliable connection.



On the Internet, I found a matching circuit for UART levels based on a BSS138 transistor.
enter image description here



Will this scheme work reliably at a transfer rate of 115200 BOD? If it were not, would you advise me a more reliable option?










share|improve this question















I need to connect ESP32 (3.3 V) and Arduino UNO (5 V) on the UART bus. I used to connect two devices through a 1k resistor and it worked. I want to make a reliable connection.



On the Internet, I found a matching circuit for UART levels based on a BSS138 transistor.
enter image description here



Will this scheme work reliably at a transfer rate of 115200 BOD? If it were not, would you advise me a more reliable option?







arduino






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 25 '18 at 12:24









Harry Svensson

6,50032346




6,50032346










asked Dec 25 '18 at 11:44









Алекс Гарисон

465




465







  • 1




    115.2 kBaud is not really high speed. Here someone simulated the same circuit and found that it works comfortably even at 2 MHz: electronics.stackexchange.com/a/367055/31091 The link also contains a detailed explanation of the circuit and its frequency-limiting factors.
    – Geier
    Dec 25 '18 at 13:20







  • 2




    One resistor is not really a proper solution except when you have a current rating for the protection diodes. But two resistors forming a voltage divider can be a fine solution - more definitive than your proposal except for things that need to run for a long time on battery. But a 5v Arduino wouldn't be suitable for that to begin with.
    – Chris Stratton
    Dec 25 '18 at 14:11












  • 1




    115.2 kBaud is not really high speed. Here someone simulated the same circuit and found that it works comfortably even at 2 MHz: electronics.stackexchange.com/a/367055/31091 The link also contains a detailed explanation of the circuit and its frequency-limiting factors.
    – Geier
    Dec 25 '18 at 13:20







  • 2




    One resistor is not really a proper solution except when you have a current rating for the protection diodes. But two resistors forming a voltage divider can be a fine solution - more definitive than your proposal except for things that need to run for a long time on battery. But a 5v Arduino wouldn't be suitable for that to begin with.
    – Chris Stratton
    Dec 25 '18 at 14:11







1




1




115.2 kBaud is not really high speed. Here someone simulated the same circuit and found that it works comfortably even at 2 MHz: electronics.stackexchange.com/a/367055/31091 The link also contains a detailed explanation of the circuit and its frequency-limiting factors.
– Geier
Dec 25 '18 at 13:20





115.2 kBaud is not really high speed. Here someone simulated the same circuit and found that it works comfortably even at 2 MHz: electronics.stackexchange.com/a/367055/31091 The link also contains a detailed explanation of the circuit and its frequency-limiting factors.
– Geier
Dec 25 '18 at 13:20





2




2




One resistor is not really a proper solution except when you have a current rating for the protection diodes. But two resistors forming a voltage divider can be a fine solution - more definitive than your proposal except for things that need to run for a long time on battery. But a 5v Arduino wouldn't be suitable for that to begin with.
– Chris Stratton
Dec 25 '18 at 14:11




One resistor is not really a proper solution except when you have a current rating for the protection diodes. But two resistors forming a voltage divider can be a fine solution - more definitive than your proposal except for things that need to run for a long time on battery. But a 5v Arduino wouldn't be suitable for that to begin with.
– Chris Stratton
Dec 25 '18 at 14:11










1 Answer
1






active

oldest

votes


















4














According to a quick simulation, the answer is yes. Note that I have not added any parasitics, but the outputs look ok.



There is an error in your schematic incidentally; the gate of the MOSFET needs to be pulled directly to 3.3V
Schematic driving 3.3V side



Driving from the 3.3V side, 5V side output:
5V output driven from 3.3V side



3.3V output when driven from the 5V side has some overshoot (but nothing serious):
3.3V output when driven from 5V side



Timings set for 115200 bit times. The overshoot on the 3.3V side is due to the body diode of the MOSFET which is involved in down shifting but not in up shifting.






share|improve this answer






















  • Peter, Thank you very much!
    – Алекс Гарисон
    Dec 25 '18 at 13:18










  • While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
    – Chris Stratton
    Dec 25 '18 at 14:09










  • I had problems using a voltage divider. For some reason I could not exchange data through it.
    – Алекс Гарисон
    Dec 25 '18 at 14:30










Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");

StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "135"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f413759%2flogic-level-conventer-for-uart-5v-3-3v-with-high-transmission-speed-115200%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














According to a quick simulation, the answer is yes. Note that I have not added any parasitics, but the outputs look ok.



There is an error in your schematic incidentally; the gate of the MOSFET needs to be pulled directly to 3.3V
Schematic driving 3.3V side



Driving from the 3.3V side, 5V side output:
5V output driven from 3.3V side



3.3V output when driven from the 5V side has some overshoot (but nothing serious):
3.3V output when driven from 5V side



Timings set for 115200 bit times. The overshoot on the 3.3V side is due to the body diode of the MOSFET which is involved in down shifting but not in up shifting.






share|improve this answer






















  • Peter, Thank you very much!
    – Алекс Гарисон
    Dec 25 '18 at 13:18










  • While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
    – Chris Stratton
    Dec 25 '18 at 14:09










  • I had problems using a voltage divider. For some reason I could not exchange data through it.
    – Алекс Гарисон
    Dec 25 '18 at 14:30















4














According to a quick simulation, the answer is yes. Note that I have not added any parasitics, but the outputs look ok.



There is an error in your schematic incidentally; the gate of the MOSFET needs to be pulled directly to 3.3V
Schematic driving 3.3V side



Driving from the 3.3V side, 5V side output:
5V output driven from 3.3V side



3.3V output when driven from the 5V side has some overshoot (but nothing serious):
3.3V output when driven from 5V side



Timings set for 115200 bit times. The overshoot on the 3.3V side is due to the body diode of the MOSFET which is involved in down shifting but not in up shifting.






share|improve this answer






















  • Peter, Thank you very much!
    – Алекс Гарисон
    Dec 25 '18 at 13:18










  • While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
    – Chris Stratton
    Dec 25 '18 at 14:09










  • I had problems using a voltage divider. For some reason I could not exchange data through it.
    – Алекс Гарисон
    Dec 25 '18 at 14:30













4












4








4






According to a quick simulation, the answer is yes. Note that I have not added any parasitics, but the outputs look ok.



There is an error in your schematic incidentally; the gate of the MOSFET needs to be pulled directly to 3.3V
Schematic driving 3.3V side



Driving from the 3.3V side, 5V side output:
5V output driven from 3.3V side



3.3V output when driven from the 5V side has some overshoot (but nothing serious):
3.3V output when driven from 5V side



Timings set for 115200 bit times. The overshoot on the 3.3V side is due to the body diode of the MOSFET which is involved in down shifting but not in up shifting.






share|improve this answer














According to a quick simulation, the answer is yes. Note that I have not added any parasitics, but the outputs look ok.



There is an error in your schematic incidentally; the gate of the MOSFET needs to be pulled directly to 3.3V
Schematic driving 3.3V side



Driving from the 3.3V side, 5V side output:
5V output driven from 3.3V side



3.3V output when driven from the 5V side has some overshoot (but nothing serious):
3.3V output when driven from 5V side



Timings set for 115200 bit times. The overshoot on the 3.3V side is due to the body diode of the MOSFET which is involved in down shifting but not in up shifting.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 25 '18 at 13:39

























answered Dec 25 '18 at 12:52









Peter Smith

13.7k11237




13.7k11237











  • Peter, Thank you very much!
    – Алекс Гарисон
    Dec 25 '18 at 13:18










  • While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
    – Chris Stratton
    Dec 25 '18 at 14:09










  • I had problems using a voltage divider. For some reason I could not exchange data through it.
    – Алекс Гарисон
    Dec 25 '18 at 14:30
















  • Peter, Thank you very much!
    – Алекс Гарисон
    Dec 25 '18 at 13:18










  • While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
    – Chris Stratton
    Dec 25 '18 at 14:09










  • I had problems using a voltage divider. For some reason I could not exchange data through it.
    – Алекс Гарисон
    Dec 25 '18 at 14:30















Peter, Thank you very much!
– Алекс Гарисон
Dec 25 '18 at 13:18




Peter, Thank you very much!
– Алекс Гарисон
Dec 25 '18 at 13:18












While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
– Chris Stratton
Dec 25 '18 at 14:09




While it may work, it's worth noting that this will be weaker than a voltage divider solution on the high side, and not meaningfully better on the low side.
– Chris Stratton
Dec 25 '18 at 14:09












I had problems using a voltage divider. For some reason I could not exchange data through it.
– Алекс Гарисон
Dec 25 '18 at 14:30




I had problems using a voltage divider. For some reason I could not exchange data through it.
– Алекс Гарисон
Dec 25 '18 at 14:30

















draft saved

draft discarded
















































Thanks for contributing an answer to Electrical Engineering Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f413759%2flogic-level-conventer-for-uart-5v-3-3v-with-high-transmission-speed-115200%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay