Fixing CH340 Problems On A NodeMCU V3 Board
A while back I bought a couple of NodeMCU V3 boards via EBay. They’ve sat among my “projects waiting to happen” until I pulled them out this past week intending to install MicroPython on one of them. However, when I connected the boards to my Linux laptop’s USB port they weren’t recognized. This board uses the CH340G USB-to-UART chip and when I ran dmesg I saw the errors shown below:
This is not an uncommon problem if the number of people posting questions with similar errors is any indication. Some saw it as a software driver problem. Some indicated changing to a different USB cable or using a powered hub fixed the problem. I believed it was a hardware problem since removing and reinserting the USB cable would occasionally result in different errors.
This was confirmed when I noticed the laptop would recognize the CH340G with no errors if I flexed the board’s microUSB connector while pressing the reset button. I suspect the problem was caused by a solder bridge on the board below the USB connector or a problem in the connector itself but ultimately the question was, how to fix it?
First I tried to reflow the connector’s solder using a hot air gun. When that didn’t work I decided to replace the connector with something a bit more substantial.
The result is shown below. The microUSB connector was removed and replaced with a 4 pin header attached to the board using super glue. The header pins were connected to appropriate locations on the NodeMCU board using wire-wrap wire as shown in the photo and specified in the accompanying list.
|Header Pin||Name||USB Wire Color||Board Connection|
|1||USB GND||Black||AMS1117 (3.3V Reg) Pin 1|
|2||USB D+||Green||CH340G Pin 5|
|3||USB D-||White||CH340G Pin 6|
|4||USB 5V||Red||AMS1117 (3.3V Reg) Pin 3|
Replacing the NodeMCU’s microUSB connector means a custom programming cable is needed for the board. That was easily accomplished by cutting the end off an old USB cable and replacing it with a 1X4 crimp connector. Now when the board is plugged in the laptop’s USB port the CH340G is recognized with no errors.
If you’re careful you may be able to just remove the existing microUSB connector and replace it with a new one. However, the board traces below the connector are tiny and pull up easily. Ultimately, it may be easier (and lesss frustrating) to go with with pin header replacement in the first place.