I want to design a circuit that is capable of blocking reverse voltage signals but allowing forward voltage signals to pass through.

The original problem and solution:

I was designing an Arduino to ESP8266 interface with a pair of the Arduino pins as a serial port. For the Arduino TX to send data to the ESP8266 RX, the circuit was a very simple resistive divider to divide 5V to 3.3V, which worked well. The problem came when I needed to do the same for the ESP8266's TX pin. As the ESP8266 operates on 3.3V voltage levels, feeding 5V by mistake into the ESP8266 would certainly mean disaster. Therefore, I was trying to figure out a way to let the ESP8266's 3.3V signal pass through to an Arduino IO pin without being distorted or its voltage decreased by a drastic amount while still protecting the ESP8266 in case the user on the Arduino makes an error and feeds 5V into the ESP8266.

The solution I came up with originally was to use a Schottky diode like the 1N5817, as shown in the schematic below, to prevent the Arduino IO pin from back feeding into the ESP8266: ESP8266 to Arduino

The new problem: In my tests, it turned out that the Arduino was completely incapable of receiving serial data from the ESP8266, most likely because the voltage level was too low. If I short a wire across that diode, the serial data gets through with no problems.

Is there any way to properly prevent voltage back feeding from a 5V IO pin to a 3.3V IO pin while still preserving the original voltage when the 3.3V side is transmitting a signal to the 5V side?

A few requirements for the solution:

  • The components used must not be too large, as PCB space is precious
  • Would prefer hand-solderable components (e.g. for resistors, 1206 is a good size)
  • Prefer SMD components

Simple, and FET gate provides isolation:


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Nononononono the 5V could backflow into the esp8266 Tx. This is not isolated. \$\endgroup\$ – Bradman175 Jan 7 '17 at 10:27
  • \$\begingroup\$ If you remove the 3.3 V then M1 is off. Leakage current is 1 uA maximum. If you wanted belt and braces then you could put 100k Ohm from ESP8266 pin output to ground, but this seems quite unnecessary. The FET gate provides isolation for the 3.3 V as mentioned and prevent any flows between supplies. \$\endgroup\$ – Jack Creasey Jan 7 '17 at 16:40
  • \$\begingroup\$ Consider the situations that need to be handled. +5 ok, 3.3 off ...Idss 1 uA @48V ......+5 off, 3.3 ok .... Intrinsic diode + 10k to +5, Ard uino input Intrinsic diode to +5 ....no damage possible. Did I read this wrong?? \$\endgroup\$ – Jack Creasey Jan 7 '17 at 16:53
  • \$\begingroup\$ What if the OP accidentally sets the IO pin to be an output? \$\endgroup\$ – Bradman175 Jan 7 '17 at 23:11
  • \$\begingroup\$ I assume you mean the OP set the Arduino Pin as an output. If he did and set the pin Low....nothing would happen. I he sets it high, then there are two condition to consider..... if the ESP(pin) is high then the output load becomes an Intrinsic diode and the current limit of the ESP(pin) or Ard(pin)....no damage. If the ESP(pin) is Low, nothing happens. But the larger question is that you seem to be designing a circuit that will handle any programmatic errors the Op may make. ...if you can come up with any scenario that might potentially damage any device, I'll happily change the circuit. \$\endgroup\$ – Jack Creasey Jan 7 '17 at 23:24

Use a logic level converter for being safe from any ambiguity and faster interfacing option. https://www.sparkfun.com/products/12009 If this module is again too large for your application, then directly solder BSS138 as per schematic provided in the link.


Why not this?

enter image description here

R1 keeps the current to the base of NPN at an acceptable amount to prevent a short circuit. It should be something like 1k. This is to activate the transistor based on the serial.

R2 keeps the current from the base of the PNP at an acceptable amount. This is to activate the PNP based on the NPN and should be around 1k.

R3 is to pull the PNP high when turned off. This saves a bit of power, but not essential. It also pulls the voltage level at the output a lil bit lower. Should be around 10k.

R4 pulls the output low when serial is low to prevent floating. Should be around 1k.

R5 is in case you accidentally set the arduino pin to output and low. Should be around 1k.

For being extra safe, you could use the equivalent MOSFETs instead of BJTs like the following.

enter image description here

This time R3 pulls the P mosfet up to prevent it from floating. Should be around 1k.

R4 still serves the same purpose.

R5 does the same.

R6 ensures the gate is pulled low. Not entirely crucial. Should be around 1k to 10k.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.