logo elektroda
logo elektroda
X
logo elektroda

ESP8266 start-up problem with shared ground with PC817 and 5V signal from Tapo P100

JDam 75 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21847993
    JDam
    Level 2  
    Good morning,

    I am carrying out a project to detect the relay status of a Tapo P100 and send information via an ESP8266 (Wemos D1 mini) with a CC1101 module.

    Connection description
    TAPO side:
    - 5 V - wires: orange / blue / red from the power supply
    - GND - three black wires (including power supply) 2 Cathode
    - Green - relay control signal (0-5 V)
    - The 0-5 V signal is applied to the optoisolator PC817 <-> 470 Ω <-> 1 Anode

    ESP8266 side (Wemos D1 mini - CC1101):
    - GND - common ground with power supply and common ground with PC817 (Grey 1, Grey 2) 2 Cathode / 3 Emitter
    - 3.3 V - pull-up for PC817 output (Green) <-> 10 kΩ <-> 4 Collector
    - 5 V - power supply for Wemos D1 mini (White)
    - PC817 output connected to GPIO of ESP8266 (Blue) 4 Collector <-> GPIO
    - CC1101 connected via SPI


    Problem
    If all the grounds are connected and I switch on the 5 V power supply:
    - ESP8266 does not respond to the signal,
    - the LED on the Wemos is clearly dimmed,
    - the circuit gives the impression of a short circuit or overload.

    On the other hand, if I disconnect the GND wire between the ESP8266 and the PC817 (Emitter 3) before turning on the power, then turn on the power and only then reconnect the ground to Emitter 3, the circuit works fine.

    What could be causing this circuit effect?

    I can provide a detailed schematic with component values if required.

    PC817 optocoupler diagram showing the package, pin numbers, and schematic symbol with pin names
    Electronics prototyping setup with ESP8266 board, radio modules, breadboard wiring on an ESD mat
    Block diagram: TAPO → microcontroller (wakes on high) → SPI → CC1101
  • ADVERTISEMENT
  • #2 21848004
    elktrod
    Level 40  
    I have poor eyesight and I'm rather visual so the schematic may be helpful if not here then on priv but try the option also of undoing the collector of the right side of PCB17 before switching on the device to determine if the same effect? Because if same then its not likely to be an optoisolator but a conductor?
  • #3 21848007
    JDam
    Level 2  
    I found what the problem was I soldered in the D3 side of the ESP8266 to the output of the PC817 connected to the 4 Collector <-(Blue) -> GPIO

    Quote:
    The ESP8266 has specific pins that must be in a certain state (High or Low) to boot.

    GPIO 0 (D3): Must be HIGH to boot. If your optocoupler is active (pulling it LOW) during power-up, the ESP enters "Flash Mode" and won't run your code.

    GPIO 2 (D4): Must be HIGH to boot.

    GPIO 15 (D8): Must be LOW to boot.


    At startup I had HIGH and the whole thing was falling apart :) After re-soldering and changing pins everything works.

    Added after 4 [minutes]:

    I'm throwing in some photos that I think would be useful, maybe someone will need them one day.

    The Tapo P100 uses the RTL8720CF microcontroller, and is powered by the BP2525

    RELAY controlled by GPIO_8

    Bottom side of a green PCB labeled “BOTTOM,” with an IC and large soldered contact areas

    Close-up of a PCB showing a BP2525 IC, solder joints, and traces

    Datasheet page for BP2525X showing features, protection list, and a typical application circuit diagram

    In BP2525 SEL to ground, which sets 5 V to DC OUT
ADVERTISEMENT