logo elektroda
logo elektroda
X
logo elektroda

Wemos D1 Mini, PCB project: difficulties in starting ESP after soldering

mtbchn 804 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20821302
    mtbchn
    Level 3  
    Hi,

    I have designed a PCB with the Wemos D1 Mini. In brief: the ESP controls five MOSFET transistors and one optotriac (MOC3021). The whole thing is powered by the HLK-5M03. I will mention that I tested all the modules (triac control, mosfet control) before transferring the concept to the schematic and to the PCB. After soldering the board I had problems with getting the circuit to work

    The problem was that the ESP would not start. I suspected via the UART that it was spitting out a string of "bushes" after a reset and would not go to network connection. This was happening when the D1 Mini was embedded in the PCB. After removing it from the PCB and connecting the ESP via the cable to the PC, the D1 would boot normally (connect to the network and execute the program).

    Connecting the D1 module via cable to the PC (while embedding D1 in the PCB) and powering it via USB (with HLK-5M03 disconnected) had the same effect as above - ESP on startup spit out a few bushes and stopped, without proceeding to the WiFi network connection procedure.

    In D1 Mini I use such pins as: D1, D2, D3, D5, D6, D7.

    I started to wonder if by chance the loads (mosfets, to which I didn't connect anything during the first tests) don't cause problems with ESP starting. So I connected the ESP on the PCB "in the air", connecting only 3.3 V and GND. It turned out that the circuit works.

    For the moment I am able to start the circuit like this:
    1) I start the designed board without the D1 Mini.
    2) I insert the D1 Mini into the socket on the board starting from the back pins, so that I first connect 3.3 V to 3.3 V and GND to GND.
    3) I wait a second, D1 Mini connects, I insert it all the way into the socket and the whole circuit from the PCB works as it should, i.e. as intended.


    The conclusion then is that I have a problem with the ESP starting while its leads (D1, D2, D3, D5, D6, D7) are connected to the mosfets and the optotriac at the start. However, once the ESP passes the startup, it then works properly in the PCB.

    What can I do about this fiasco? How can I solve this problem and make the ESP start without "combinations"? I am able to do something software or hardware without much interference? The only thing I can think of is a power sequencer: when the voltage is applied, the ESP starts first, and only then the other circuits (i.e. ground to the mosfets and optotriac, for example). Only it's too late for that at this stage - the board is ready.

    I have included the schematic elements below: D1 Mini, mosfet control (5 pieces), optotriac control.

    Please give me any hints, tips, explanations as to why the ESP behaves this way, and any suggestions on how to solve the problem. Thanks in advance.

    Electronic schematic fragment with a MOSFET transistor Wemos D1 Mini connection schematic with capacitors and ground. Optotriac MOC3021 control schematic with resistors and pins. Optotriac MOC3021 control schematic with resistors and pins.
  • ADVERTISEMENT
  • #2 20821388
    elezibi
    Level 21  
    Check to see if maybe if one pin is pulled down to ground (220r+led) during start-up, the procec is not entering some mode.
  • ADVERTISEMENT
  • #3 20821427
    TvWidget
    Level 38  
    "Strapping pins" can be used but they must have the correct state at power-up. See where they are connected.
  • #4 20821600
    urkotrebor
    Level 21  
    I once had a problem with ESP32 CAM , as with you after inserting the module into the board the chip did not work or worked not necessarily as I wanted .
    It turned out that my board effectively shielded the ESP from the world , adding an antenna saved the situation .
    Try to run the chip without firing WIFI , at the same time all the operations report in the terminal you will know where it stops .
    You may also have a problem with the power supply .
  • ADVERTISEMENT
  • #5 20821624
    mtbchn
    Level 3  
    Gentlemen, thank you for all the answers.
    Unfortunately, the problem is pin D3 (GPIO0) - connected to FLASH button, boot fails if pulled LOW. In my case, this pin is connected to the optotriac, i.e. I pull it down (as my colleague above suggested) via a resistor and the diode built into the optotriac to ground. With this, the ESP enters flashing mode. This can be seen in the attached pictures in the first post.

    I'm afraid I won't be able to do anything programmatically, because in order for the program to be read, the ESP must first start - and here, as you already know, it enters flashing mode.

    In the documentation for the Wemos D1 Mini, I see that D3 (GPIO0) is pulled up to 3.3 V via a 12 k resistor (so it's no surprise that I'm effectively pulling it down to ground with my 330 R - the schematic mistakenly left a value of 220 R, appropriate for 5 V).

    Can I do anything else with this? So that the chip can boot normally and after a manual reset it doesn't enter flashing mode again? Theoretically I could leave it like that, but... every time the mains voltage is lost, I will have to play with the combined insertion of D1 into the circuit and thus physical interference.

    I am open to any suggestions/solutions/answers.
    Schematic showing the connection of GPIO0 and GPIO2 with pull-up resistors to 3.3 V.
    I am attaching the mentioned excerpt from the D1 Mini documentation.
  • ADVERTISEMENT
  • #7 20821667
    mtbchn
    Level 3  
    Thanks for the hint. The board consists mostly of SMD components. The exceptions are the sockets, the Hi-Link and the Wemos D1 Mini. The D1 is embedded in a goldpin socket. I think it will be easiest if:

    - I cut the D3 goldpin from D1 Mini (plug),
    - I make a bridge between D8 and D3 in the socket
    - I use D8 on the optotriac control path (Boot fails if pulled HIGH - for D8, I checked and it boots without problem).

    I deliberately used pins that should not be problematic (OUTPUT section), suggesting the table below. Unfortunately, I overlooked the comment on D3. Hardly, I'll learn my lesson for the future.

    Table showing GPIO configuration for microcontroller pins, with input and output functions and notes on boot behavior. .
  • #8 20837840
    kmarkot
    Level 29  
    tos18 wrote:
    I'm betting on D3
    And I'm betting on D1
  • #9 20839242
    mtbchn
    Level 3  
    kmarkot wrote:
    And me on D1


    Wrong bet. Problem long since solved - above. Obviously the cause lay in pin D3 and its specific requirements.

Topic summary

The discussion revolves around issues encountered when starting an ESP module embedded in a custom PCB designed with the Wemos D1 Mini. The user reports that the ESP fails to boot properly when soldered onto the PCB, displaying erratic behavior and entering flashing mode due to GPIO0 (D3) being pulled low by an optotriac connection. Various suggestions are made, including checking pin states during startup, ensuring proper strapping pin configurations, and considering power supply issues. The user ultimately identifies the problem with pin D3 and proposes a solution to reroute the optotriac control to another pin (D8) to avoid conflicts during boot.
Summary generated by the language model.
ADVERTISEMENT