0
\$\begingroup\$

How can I find out why my wemos D1 mini board is randomly connecting and disconnecting from USB to PC? I got three boards from a chinese retailer. When I plug them in a PC and check device manager, the board randomly pops in and out of existence.

I have tried these things so far:

  • tried on three different Windows 10 Systems. Two of which have the random connection, but funny enough: one of them has a stable connection.
  • I tried using about 12 different cables.
  • I unplugged all other USB devices from the PC's in question.
  • I tried using every USB port available on the systems.
  • I uninstalled every CH340 related driver from the system. (note: Windows seems to automatically install new CH340 drivers when plugging in the device).
  • I have even completely erased Windows and did a fresh install of the operating system on one of the systems.
  • I tried all three boards from the same batch I received.
  • I tried connecting to a Mac and it seems fine, but I am not 100% certain how to verify a stable connection on a mac.

Normally I would say the board if defect - but why is it connecting ok to one single PC? I am now out of ideas how to further trouble shoot this issue. Any ideas how to find out whats wrong?

\$\endgroup\$
7
  • \$\begingroup\$ Are the boards new? Do you have access to a Linux computer? \$\endgroup\$ – eeintech Feb 18 '20 at 11:58
  • \$\begingroup\$ It is very likely that you have power starvation on your USB ports. The 'wemos" are radio devices, and can have bursts of current up to 400 mA peak (100% burst at 3.3V). \$\endgroup\$ – Ale..chenski Feb 19 '20 at 0:46
  • \$\begingroup\$ @Cisco25 Yes, all the boards are new. I had actually used a similar board from a different vendor for another project. That worked fine. I was going to install Ubuntu on the "problem machine" to see if I can find connection issues there. Hopefully tonight. I also have a MacOS laptop available I already bootcamped Windows on that one and had similar connection issues. What do you suggest I do on a linux machine to investigate further? \$\endgroup\$ – Bravewart Feb 19 '20 at 6:32
  • \$\begingroup\$ @Ale..chenski. That sounds like it could cause my problems. But how would I go about that? I was already looking for a USB debugger tool. I actually had one from the Windows SDK (forgot the exact name of it) - but only got as far as it showed the device on the USB bus - then gone - then back again. could not find any information to what the cause is \$\endgroup\$ – Bravewart Feb 19 '20 at 6:34
  • \$\begingroup\$ @Ale..chenski. And thinking further: The one setup this worked with was via a powered USB hub. All the other setups were direct connections to a mini ATX mainboard, an apple laptop with Windows on it and a different, also powered but much cheaper, USB hub. I will bring the USB hub from the working machine home tonight and try again. If it works, it was that power issue \$\endgroup\$ – Bravewart Feb 19 '20 at 6:49
0
\$\begingroup\$

As a last resort, I took SpasT's advise and cut pin 16 from the PCB and solder a jumper to 5V. It works!! My guess is that the RST/GPIO0 lines circuitry is "borrowed" from 5V design. There is only 2 lines (TX and RX) going to the processor, but they have 470 ohms resistor in series. These 2 resistors might have limited the voltage to the processor a bit. It is like 2 wrongs make it right. You can probably can reduce the resistor (R6 & R7) value on the base of the 2 transistors on the RST/GPIO0 circuitry too and stay on 3.3V. enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ Please provide a reference to where you got the image (unless it is your own), otherwise it is plagiarism (which is not good) \$\endgroup\$ – Voltage Spike Feb 20 at 18:20
0
\$\begingroup\$

The ESP8266 draws quite a lot of current, and does so in short pulses (e.g. when sending data on WiFi or writing to the Flash). The USB power supply is not able to cope with this, which leads the voltage to drop and the controller to reboot.

The solution is to provide a more stable power supply, by:

  • using a dedicated power supply that is able to deliver enough current and react quickly on changing power requirements.
  • adding some capacitors to the power supply. The D1 mini just has 20uF of capacity on the 3.3V rail. This is not sufficient if operating from a long USB cable. Try adding a 100uF capacitor in parallel and the board should work more stably.

Please note that operating the ESP8266 directly on an USB port is actually far outside the specification. A USB port is specified to deliver 100 mA at most (without special request from the device, which the D1 mini can not make), but the ESP8266 board will draw up to about 400mA in peak.

\$\endgroup\$
-1
\$\begingroup\$

I have exact same problem on my d1 boards. I foundout that VCC pin (16 of CH340 ) is connected to 3.3v instead of 5v from USB. The solution is: rise 16 pin of CH340 and connect it ot 5v. Now connection is stable.

https://i.stack.imgur.com/AgCqH.jpg

\$\endgroup\$
2
  • \$\begingroup\$ Nice work @SpasT. I'll have a closer look at the board tonight. Sounds like major surgery though. \$\endgroup\$ – Bravewart May 13 '20 at 8:36
  • 1
    \$\begingroup\$ This is wrong. The ESP8266 is not compatible to 5V on its IO pins, so the CH340 has to be operated at 3.3V or you risk to fry the processor. \$\endgroup\$ – asdfex Sep 19 '20 at 11:18

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.