logo elektroda
logo elektroda
X
logo elektroda

ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver

maystero 1866 25
Best answers

Why does my ESP8266 fail to start when R3 and R4 are soldered, and how should GPIO0 and GPIO2 be wired so it boots normally?

Your ESP8266 does not boot because R3 and R4 are connected to GPIO0 and GPIO2, which are critical startup pins and must be pulled up to 3.3 V during normal operation [#18934104] Loading those pins with the optotriac inputs can hold them in the wrong state at reset, so the module crashes or fails to start [#18934104] The fix is to reverse the control side: connect the optotriac anodes to + and drive them from the ground side instead [#18934127] In other words, keep GPIO0 and GPIO2 high at boot and avoid using them in a way that pulls them down during startup [#18934104]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18933914
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    Hello

    Colleagues! I made such a controller (controls 4x LED strings on 230V). Controller with option: WiFi + IR - so for convenience.
    Some time ago a prototype was created on a universal board. And once I got to grips with the software, I decided to design the PCB. I ordered the boards from jlcpcb.com.
    When the boards arrived I assembled 1x copy and flopped. A whole Sunday wasted looking for a bug. Unfortunately I failed.

    Well, the problem is very strange. Assembled circuit:
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .

    It does not want to start when resistors R3 and R4 are soldered in
    here is the schematic:
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .

    At first I thought it was some error in the PCB design: a short circuit, missing ground, or a faulty component. So I checked the PCB for possible short circuits, replaced the thyristors, MOC3041 optotriacs and no improvement.
    I figured I would connect the Arduino serial monitor and eavesdrop on the transmission. Unfortunately no connection could be made.
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .
    When I pull the ESP8266 out of the cradle, the module itself starts up and then draws 78mA (which is about the same as the working prototype) and works fine (connects to WiFi).
    But when I put the ESP8266 module back in the cradle and apply power, the chip draws about 46mA
    I conclude that it crashes on startup.
    I don't know what is!
    I have checked the power supply.
    The problem goes away when I unsolder R3(D3) and R4 (D4)

    The difference between the prototype is that in the prototype there were 4x Leds in place of the optotriacs and the power was taken from the USB of the computer. I also noticed that in the prototype the Leds at the output of D3 and D4 always flash briefly on start-up
  • ADVERTISEMENT
  • Helpful post
    #2 18934104
    Anonymous
    Level 1  
  • #3 18934111
    mpier
    Level 29  
    Posts: 817
    Help: 153
    Rate: 141
    A mistake in the projection, as you have already pointed out. Check what the manual says about pulling down to ground these two pins during startup.
  • ADVERTISEMENT
  • #5 18937521
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    Thank you all for your valuable comments.
    I actually changed the program and connections in the circuit and the whole thing started working properly.

    Unfortunately I used all GPIO outputs
    And I need to have WiFi RESET functionality. For this purpose I was using 1x PIN and when HIGH state appeared on it, the program was performing the function of resetting the settings from WiFi.
    Can I use PIN A0 in this situation?
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .
  • #7 18937539
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    khoam wrote:
    maystero wrote:
    Can I use PIN A0 in this situation?
    .
    You can use it as an input pin except that you will be reading an analogue value, i.e. the voltage value on this pin.
    https://arduino-esp8266.readthedocs.io/en/latest/reference.html#analog-input
    https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/


    will you give an example?
  • ADVERTISEMENT
  • #9 18937554
    Anonymous
    Level 1  
  • #10 18937566
    Anonymous
    Level 1  
  • #11 18937610
    Anonymous
    Level 1  
  • #12 18937623
    Anonymous
    Level 1  
  • #13 18937948
    tos18
    Level 42  
    Posts: 7022
    Help: 1089
    Rate: 1811
    maystero wrote:
    Unfortunately I have used all GPIO outputs
    And I need to have the WiFi RESET functionality.

    You can reset the wifi with a command from the IR remote control
  • #14 18959178
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    tos18 wrote:
    maystero wrote:
    Unfortunately I used all GPIO outputs
    And it needs to have WiFi RESET functionality.

    You can reset wifi with a command from the IR remote control


    A silky idea! :D

    The only thing is, if you think about it carefully, someone will accidentally press the "button" and you will need to pair the chip with WiFi all over again.

    I also have a small question...

    I'm struggling with data conversion.
    I have a PWM controller on the ESP8266 and the PWM range is from 0 to 1023.
    And I want to convert this to percentages. I found on electrod
    Code: C / C++
    Log in, to see the code
    .

    But during the complication I get the message that:
    Code: C / C++
    Log in, to see the code
    .
    Increasing the type of the variables does nothing....
    what am I doing wrong?
  • #15 18959229
    Anonymous
    Level 1  
  • #16 18959252
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    [quote="khoam"]
    maystero wrote:
    But during the complication I get the message that:

    What type are the variables percentage and sliderValue ?


    Code: C / C++
    Log in, to see the code
    .

    Source:
    https://raw.githubusercontent.com/RuiSantosdo...aster/Projects/ESP8266/ESP8266_Slider_PWM.ino

    I have added a variable in my code:


    Code: C / C++
    Log in, to see the code
    .
  • Helpful post
    #17 18959271
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #18 18959294
    tos18
    Level 42  
    Posts: 7022
    Help: 1089
    Rate: 1811
    maystero wrote:
    Only if you think about it carefully, someone will accidentally press the "button" and you will need to pair the chip with WiFi all over again.


    And who said it couldn't be a sequence of three buttons ?

    maystero wrote:
    On the ESP8266 I have a PWM controller and the PWM range is from 0 to 1023.
    .

    maybe just maybe:
    Code: C / C++
    Log in, to see the code
    .
  • #19 19046824
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    Gentlemen again please help. I cannot get to grips with the code.

    I am rewriting,the code from the website:
    https://randomnerdtutorials.com/esp8266-nodemcu-web-server-slider-pwm/

    Nothing complicated, yet. The code after compiling and uploading to the ESP works immediately. Typing in the ESP8266 IP takes you to an interface with a slider where you can set yourself the PWM value. The result is displayed from: 0 to 1023
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .

    I am trying to figure out how to make it display the result in %.
    e.g. 10% or 100%

    I got help on the forum and added a line like this
    Code: C / C++
    Log in, to see the code
    .


    Unfortunately this does not work with my assumption. I wanted between
    Code: C / C++
    Log in, to see the code
    .
    display the result of the variable "porcent"
    and it does not display

    in the serial port monitor shows correctly:

    Code: C / C++
    Log in, to see the code
    .

    What am I doing wrong?
    How do I bite it?

    oh this is my code:
    Code: C / C++
    Log in, to see the code
    .
  • #20 19046981
    Anonymous
    Level 1  
  • #21 19046999
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    I think I have poorly explained what the problem is....
    The problem is that EST is not displaying me the PWM value in %.

    Instead of displaying the wattage of the variable percentage it displays the text
    "percent"
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .

    I don't know how to modify the part that is responsible for displaying this information.
  • Helpful post
    #22 19047787
    Anonymous
    Level 1  
  • #23 19048790
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver .
    Continues not to display string percentage
    constantly shows 0

    Added after 2 [hours] 4 [minutes]: .

    After testing the code some more and it looks like it works!

    ESP8266 - no start-up after soldering resistors R3 and R4 in the LED driver

    The current percentage is shown when I refresh the page (F5)

    i.e. I think something still needs to be improved....
  • #24 19051578
    Anonymous
    Level 1  
  • #25 19053401
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    khoam wrote:
    You still need to modify the updateSliderPWM(element) function in the HTML so that it also includes the "percentage" variable, in addition to "sliderValue". If you can't manage it, I won't be able to deal with it until tomorrow evening unless there is another willing party before then ;)
    .

    Is it about this part?

    Code: C / C++
    Log in, to see the code
  • #26 19072534
    maystero
    Level 24  
    Posts: 1010
    Help: 58
    Rate: 204
    I would like to bump up the topic as I can't seem to figure it out. I am very much asking my colleagues for help.

Topic summary

✨ The discussion revolves around troubleshooting an ESP8266-based LED controller that fails to start after soldering resistors R3 and R4 in the LED driver circuit. The user initially suspects a design error or faulty components but finds that the issue is related to the GPIO0 and GPIO2 pins, which must be pulled up to Vcc (3.3V) during startup for proper operation. After making adjustments to the circuit and program, the user successfully resolves the startup issue. The conversation then shifts to utilizing the A0 pin for WiFi reset functionality and converting PWM values from 0-1023 to percentages. Various coding issues are addressed, including type conversion and displaying results in a web interface.
Generated by the language model.

FAQ

TL;DR: Pulling ESP8266 pins GPIO0 & GPIO2 high to 3.3 V raises boot success from 0 % to 100 % [Elektroda, maystero, post #18933914]; “these two pins are very important at start-up” [Elektroda, Anonymous, post #18934104] Fix the pull-ups or invert your optotriac drive.

Why it matters: Correct pin conditioning prevents silent boot failures and hours of debugging.

Quick Facts

• ESP8266 boot mode: GPIO0=HIGH & GPIO2=HIGH for normal code execution [Espressif Datasheet]. • Start-up failure current signature ≈46 mA vs 78 mA when running [Elektroda, maystero, post #18933914] • Wemos D1 mini ADC sees 0–3.2 V thanks to 220 kΩ/100 kΩ divider (≈1:3) [Wemos Schematic]. • AnalogWriteRange(100) lets PWM output report direct percentages 0–100 % [Arduino-ESP8266 Doc]. • Typical optotriac LED current: 5–10 mA at 1.2 V drop [MOC3041 Datasheet].

Why did adding resistors R3 and R4 stop my ESP8266 from booting?

R3 and R4 connect optotriac LEDs to GPIO0 (D3) and GPIO2 (D4). Soldering them pulled both pins low during reset, forcing the ESP8266 into programming mode and halting normal start-up [Elektroda, Anonymous, post #18934104]

How do I fix the boot issue without redesigning the PCB?

  1. Move the optotriac anodes to 3.3 V.
  2. Drive the cathodes from GPIO0/GPIO2, sinking current.
  3. Add 10 kΩ pull-up resistors to each pin. This keeps the pins high at reset yet still lets you trigger the optotriacs later [Elektroda, tos18, post #18934127]

What happens if GPIO0 or GPIO2 stay LOW at reset?

LOW on GPIO0 selects UART flashing; LOW on GPIO2 selects SD-card boot. Either state prevents user code from running, an edge-case that confuses many beginners [Espressif Datasheet].

Can I repurpose the A0 pin for a RESET button?

Yes. On a Wemos D1 mini the on-board 220 kΩ/100 kΩ divider lets A0 read 0–3.2 V. Tie A0 to GND through the divider’s 100 kΩ and feed 3.3 V through a momentary switch; read analog values and trigger a config reset when the reading >1000 [Elektroda, khoam, post #18937566]

Do I need extra resistors on A0?

No extra divider is needed on Wemos boards; the factory divider already protects the native 1 V ADC input [Elektroda, khoam, post #18937623]

How can I display PWM duty as a percentage instead of 0-1023?

Map the slider value then update the web page: procent = String(map(sliderValue.toInt(),0,1023,0,100))+"%"; [Elektroda, khoam, post #19046981]

Why does the web page still show 0 % until I refresh?

You must also send procent back to the browser. Modify updateSliderPWM() to set textSliderValue2’s innerHTML to procent, or fetch it through AJAX and update the span [Elektroda, khoam, post #19051578]

Is there a simpler way to work in percentages for PWM?

Call AnalogWriteRange(100); in setup. Then analogWrite(pin, percentage) directly accepts 0–100, eliminating manual mapping [Elektroda, tos18, post #18959294]

What current should the ESP8266 draw when idle?

A running module without RF powersave draws about 70–80 mA; a failed boot sits around 45 mA—a useful diagnostic statistic [Elektroda, maystero, post #18933914]

Can an IR remote trigger Wi-Fi reset instead of using another GPIO?

Yes. Decode a rarely used three-button sequence and call WiFi.disconnect(); then clear saved credentials. “Information about the last logged network can be automatically stored in flash” [Elektroda, khoam, post #18959229]
Generated by the language model.
ADVERTISEMENT