1
\$\begingroup\$

I am creating simple expansion board for my Raspberry Pi with a few I2C components (EEPROM, RTC,...) and I would like to add a USB to serial converter to be able to connect to the RPi's serial port for debugging purposes (console access).

Until now I've been using a simple module with CH340 and I've decided to "just move" the chip onto my expansion board. Unfortunately the official CH340 datasheet is only in Chinese and the unofficial translation is not detailed enough.

I am not sure how to power the chip. In all examples it is powered from the USB port via voltage regulator (I need 3V3 logic for my RPi) however I have 3V3 available from RPi and I would like to power the CH340 chip from it to avoid using additional voltage regulator. Is this possible or does the CH340 need to be powered from the USB port?

\$\endgroup\$

3 Answers 3

2
\$\begingroup\$

It is not necessary to power the USB to serial converter device from the USB cable. There are plenty of "self powered" USB devices that are USB compliant.

I have made multiple products using a chip like the FTDI FT232RL and powered it from the local power rail of the MCU (in my case with that chip it was a local +5V).

You may still want to monitor the 5V coming from the USB connector so that you can tell if it is plugged into the upstream port. A simple connection of the USB 5V to a parallel pair of components (0.1uF capacitor to ground and a 10K resistor to ground) can then feed into the input of a 74LV14 to provide a USB VBUS detect.

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ This sounds interesting. I do not need VCC detection, all I really need is to be able to connect to the RPi via serial port. FTDI chips are more expensive and this is really just for me to be able to connect to RPi in case something is not working... \$\endgroup\$ Nov 13, 2019 at 16:29
  • \$\begingroup\$ Michael Karas - Hi, A new answer has made me visit this page. Can you please confirm that the schematic in your answer is your own design, and therefore doesn't need a reference link to a source elsewhere? Thanks. (Considering the details I expect that this is your own design, but to be equitable when applying the site rules, I should ask. No offense intended! Please let me know in a comment and then I can delete this comment.) \$\endgroup\$
    – SamGibson
    Nov 15, 2021 at 16:02
1
\$\begingroup\$

You can wire the CH340 with many setups. Below are 2 most common: one using the N and the other using the E SOIC.

the schema below can be found here: http://www.obddiag.net/usb-2-serial.html

Here's one possible setup using CH330N

The schema below can be found also here: https://www.chippiko.com/2021/03/ch340e-usbtoserial.html

Here's one possible setup using CH340E

\$\endgroup\$
0
0
\$\begingroup\$

I believe, to be standard compliant, the CH340 should be powered from the upstream USB port so that it can also provide protection against short circuits and overloads. The CH340 should share a ground with the Pi but otherwise only the TX and RX lines (and any others your want) will go from the CH340 to the Pi.

\$\endgroup\$
5
  • \$\begingroup\$ That is unfortunate... I have to add an additional voltage regulator while RPi has a rather good one \$\endgroup\$ Nov 13, 2019 at 9:49
  • \$\begingroup\$ You do but it's a matter of 3 components if you keep it simple. A SOT-23 packaged voltage regulator and a pair of capacitors. \$\endgroup\$
    – hooskworks
    Nov 13, 2019 at 9:54
  • \$\begingroup\$ I understand. It is just that I like to keep things simple and avoid duplication of things :-) \$\endgroup\$ Nov 13, 2019 at 10:37
  • \$\begingroup\$ This answer is incorrect. The concept of a self powered USB device has always been a compliant configuration. In fact any USB hub device that is powered by its own plug in power supply is an example of self powered device. \$\endgroup\$ Nov 13, 2019 at 17:15
  • \$\begingroup\$ Hubs, like root ports, are considered differently as far as i know to end devices since they are intended to supply power whereas the end devices only consume. The exception being OTG devices. \$\endgroup\$
    – hooskworks
    Nov 14, 2019 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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