0
\$\begingroup\$

I want to keep some state during a deep sleep of an ESP8266. To do this I used the following SR latch circuit:

used circuit

It works well. The only change I made is that I used 2N2222 transistors.

The only problem is that this circuit uses S1 and S2 switches to change the state. On the breadboard I recreated this with some buttons.

Now I want to replace the buttons with a signal from the ESP.

I just started dabbling in the world of electronics and sending out HIGH signals is no problem for me, but I can't for the life of me figure out how to send this 'ground' signal from the ESP. It feels like I'm overlooking something very easy.

\$\endgroup\$
2
  • \$\begingroup\$ Are you sure you are solving the correct problem? The ESP8266 GPIO states remain set in deep sleep. You just have to use a MOSFET instead of a BJT because the GPIO output current is only 2µA in deep sleep. \$\endgroup\$
    – JRE
    Apr 27, 2022 at 9:58
  • \$\begingroup\$ I will try that, thanks! However, while the problem might be solved just for the sake of learning I'm still interested in the answer =). But I'm going to try your suggestion right away! \$\endgroup\$
    – JstdK
    Apr 27, 2022 at 10:30

2 Answers 2

0
\$\begingroup\$

Just set the relevant output pin low combined with a resistor (10k) wired from GPIO to the base. It’s working against a 10k pull-up so should easily switch off the corresponding transistor.

\$\endgroup\$
3
  • \$\begingroup\$ I have tried this. What I did was connecting the output pins to the bases of the transistors. The difference here with regard to the physical button is that when it is not in the LOW state, instead of being an open circuit, the state of the pin is now HIGH. This results in the following: Both outputs HIGH -> LEDS off. One output HIGH -> one LED on. Both LOW -> both leds off. It doesnt latch anymore. \$\endgroup\$
    – JstdK
    Apr 27, 2022 at 10:33
  • \$\begingroup\$ @JstdK - Using a resistor (10k) wired from GPIO to the base will make ON the driven transistor and switch OFF the other. \$\endgroup\$
    – Antonio51
    Apr 27, 2022 at 10:48
  • 1
    \$\begingroup\$ It does indeed! Thank you very much. Can you explain why does this works? This will help me understand more instead of just blindly accepting the solution. \$\endgroup\$
    – JstdK
    Apr 27, 2022 at 11:30
0
\$\begingroup\$

A reliable way to turn off one of the transistors is to "pull down" the collector of the other transistor through a diode.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.