-1
\$\begingroup\$

I know that there are many questions dealing with logic level conversion/shifting between 3.3V and 5V devices, but my goal is to do do this with standard breadboard parts, so either discrete parts or DIP/DIL packaged ICs.

The serial communication shall take place between an ESP8266 and a device that outputs/receives 5V TTL, and the desired speed is 38400bps, so I'm not sure if a simple voltage divider will be up for this speed, the same goes for using 4N25 optocouplers.

I know there are ready-made solutions like this here from Adafruit available, I would prefer to use generic parts that are available long-term.

I have used a MAX3232CPE for a similar project converting 3.3V to RS232 levels in both directions, does something like this exist for 3.3V to 5V as well (and in DIP/DIL packaging)?

\$\endgroup\$
4
  • \$\begingroup\$ What is the 5 volt device? \$\endgroup\$
    – Andy aka
    Jun 1, 2020 at 8:21
  • \$\begingroup\$ ... and what's the communication protocol between them? UART, SPI, I²C? If it's UART then a simple bidirectional buffer (one transistor and a few resistors) for both RX and TX would do the job. \$\endgroup\$ Jun 1, 2020 at 8:23
  • \$\begingroup\$ @Andyaka: It's a proprietary lawn mower robot . \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 20:12
  • \$\begingroup\$ @RohatKılıç: Communication is done via 5V TTL UART protocol. \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 20:13

2 Answers 2

2
\$\begingroup\$

The classic FET level shifter should do

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • \$\begingroup\$ Thanks, this looks like a doable and breadboard compatible solution - just one more question: I found a similar schematic here: hobbytronics.co.uk/mosfet-voltage-level-converter But they are using 10k Ohms resistors instead of 100 Ohms that you are suggesting. May I ask whether the difference is irrelevant? If not, in which situations should I choose 100 Ohms and 10k Ohms respectively? \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 20:17
  • \$\begingroup\$ sorry, it should be 10k (well definitely not 100R, teh default in circuitlab...). ill update the cct \$\endgroup\$
    – user16222
    Jun 1, 2020 at 20:23
  • \$\begingroup\$ Thanks! Last question: Do you have any idea up to what serial speed (in bps) such a setup would (roughly) be sufficient? Would I be stretching it with 38400bps or would there still be enough room? Just want to make sure I get a technically working, but rather unstable connection due to this kind of logic level shifting. \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 20:54
  • \$\begingroup\$ it will easily manage that. This circuit is surprisingly fast. I recently recommended this to a psu engineer. They had a level shifter (5V to 28V) and the resultant propagation delay was causing control problems. Using this cct recovered all performace. This was with a switching frequency of 200kHz (so the edges were at least 10x this) \$\endgroup\$
    – user16222
    Jun 1, 2020 at 21:05
  • \$\begingroup\$ Thanks a lot, also for your promt replies! \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 21:15
3
\$\begingroup\$

Converting to a lower voltage can be done with any buffer that has overvoltage-tolerant inputs, i.e., one in the LV or AHC logic families (e.g., SN74LV125A, SN74AHC125/126/244/541).

3.3 V happens to be near the high voltage of TTL outputs, so converting from 3.3 V to 5 V can be done with any buffer that has TTL-compatible inputs (xx74(A)HCT125/126/244/541).

\$\endgroup\$
6
  • \$\begingroup\$ Thanks! I have come across these ICs at some point of my research but couldn't find them in DIP/DIL packages so that they could be used on breadboards. Or did I miss something? \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 20:14
  • \$\begingroup\$ One more question: Since I only have to shift two lines, but in opposite directions, it would mean that I would have to use two ICs, correct? Or are there ICs available that can do the shifting in both directions at the same time? \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 20:58
  • \$\begingroup\$ All of them are available in DIP, at least at big distributors like DigiKey or Mouser. And there are no small DIP logic devices, so you waste lots of channels. And you need two chips because they must be run at the target voltage. For just two lines, it might be a better idea to find TO-92 FETs (but the 2N7000 is not guaranteed to work at 3.3 V). \$\endgroup\$
    – CL.
    Jun 1, 2020 at 21:13
  • \$\begingroup\$ Ah, ok, thanks! Also for the info on the 2N7000 and 3.3V! \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 21:18
  • \$\begingroup\$ May I ask what would qualify a TO-92 FET to be working at 3.3V? If I understood what I read correctly, the RDS resistance is relevant here. Adafruit uses the BSS138 which has an RDS of 1,4 Ohms, but there are 2N7000s around with an RDS of 1,2 Ohms. Also, the load of a serial line is probably not to be compared with a situation where you use the MOSFET to drive a motor. But I'm no expert here, so I'd be happy to hear what I should be looking out for... \$\endgroup\$
    – fredlcore
    Jun 1, 2020 at 21:36

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.