0
\$\begingroup\$

I am trying to save some power, using an Arduino and an ESP8266 (ESP12 ESP-14F version).

The 3.3v is provided thanks to an LD1117V33. I've placed a 2n2222a transistor between the LD1111V33 and the ground. When ESP is powered on through the transistor, AT commands don't work anymore (I am mesuring 3.2V between Collector and the ESP VCC). When I short Collector to Emitter, everything is fine.

Here is a log of AT exchange with the ESP. As you can see, the 2 first "AT" requests return something I can't read, then, all the other "AT" commands don't receive anything:

***** SEND *****
AT+CIOBAUD=9600[CRLF]
======= WIFI INIT START =======
***** SEND *****
AT[CRLF]
***** RECEIVE *****
sllœ�sŒ!ãoŒ€lìpŒ|�ƒŸìp“Ÿ�“œæŒpŒpóoŸlooœccpŒ�!lãú
***** SEND *****
AT[CRLF]
***** RECEIVE *****
kÿ
***** SEND *****
AT[CRLF]
***** RECEIVE *****

***** SEND *****
AT[CRLF]
***** RECEIVE *****

I read on the post below, that it is not possible to use the 2n2222a NPN transistor to do so. Could anyone give me some explanations? (I know, there is a deep sleep mode I could use, but I'm trying to learn from my mistakes).

For an Arduino and ESP8266, can I power up the ESP8266 from a set of 2n2222 transistors?

Here is how I wired it up (I removed the resistors to ESP RX, and CH_PD to simplify the picture).

Here is how I wired it up

enter image description here

\$\endgroup\$
  • 3
    \$\begingroup\$ Can you draw a normal schematic? \$\endgroup\$ – Eugene Sh. Feb 1 '17 at 23:05
  • \$\begingroup\$ Fritzing can produce real schematics. Get it to cough one up, and post that instead of the wiring diagram. \$\endgroup\$ – JRE Feb 1 '17 at 23:13
  • \$\begingroup\$ There's a 12E, a 12S, not sure about the 12 anymore. Do you have a link to the exact device and some manual describing your specific pinout for the device? \$\endgroup\$ – jonk Feb 1 '17 at 23:17
  • 1
    \$\begingroup\$ Tangential: the ESP8266 has a deep-sleep mode, which brings the power consumption down to 10uA. Consider using that instead of trying to disconnect power. \$\endgroup\$ – uint128_t Feb 1 '17 at 23:55
  • \$\begingroup\$ Sorry, I was wrong on the ESP version. It is an ESP-14F \$\endgroup\$ – Christophe Bouin Feb 2 '17 at 22:14
2
\$\begingroup\$

Thanks to mkeith & JRE, I finally got the solutions. There were 2 problems:

  • voltage drops to 3.2 instead of 3.3 beacause of the NPN transistor. Using a PNP to give the LD1117V33 a real ground fixed it.

  • serial messages were corrupted because the esp ignored the first message: it didn't have time to wake up between transistor activation, and the first serial message, which goal is to set up the baud speed! Adding a "delay(1000)" fixed the issue.

Thanks a lot!

\$\endgroup\$
  • \$\begingroup\$ Glad you were able to solve the problem. But If I may, I suggest you use a MOSFET instead of a transistor. mainly because of significantly less powerloss and mosfets are able to switch higher current devices. \$\endgroup\$ – Suraj Bhawal Feb 7 '17 at 15:23
  • \$\begingroup\$ I found this affordable P-Channel MOSFET (AO3413): aosmd.com/res/data_sheets/AO3413.pdf I think this should do the work... could you please confirm? So you know how to estimate the power loss? Thanks! \$\endgroup\$ – Christophe Bouin Feb 8 '17 at 9:28
  • \$\begingroup\$ While choosing a MOSFET, you need to focus on 4 main things. i.e drain to source voltage (The amount of voltage that can pass though the MOSFET without damaging it) , gate to source voltage( voltage required to activate the MOSFET) , continuous drain current(The amount of current that can pass through without damagin it) and power dissipation(the amount of power loss dissipated in the form of heat). \$\endgroup\$ – Suraj Bhawal Feb 9 '17 at 10:41
  • \$\begingroup\$ power dissipation is directly proportional to drain to source resistance(Rds)... The MOSFET you've chose has has relatively large Rds ranging from 80-130 mOhm depending on the voltage. All of these parameters can ofcourse be referred from the datasheet. Instead AO3413 I suggest you use IRFz44n which is an n-channel MOSFET and is much more common, hence easy to find. \$\endgroup\$ – Suraj Bhawal Feb 9 '17 at 10:42
  • \$\begingroup\$ If I use a n-channel mosfet, I guess There will be the same voltage drop than with a npn transistor, isn't it (the voltage regulator needs to be connected to a real ground)? \$\endgroup\$ – Christophe Bouin Feb 9 '17 at 16:46
-1
\$\begingroup\$

Possibility 1, Transistor is on Maybe the transistor is on. Check voltage between base and emitter. Should be close to zero. If it is above 0.3 or so, it may be turning on a bit.

Possibility 2, transistor is fried Maybe the transistor is defective and provides a conductive path from collector to emitter regardless of base voltage and current.

Possibility 3, ground current has alternate path Maybe one of those yellow wires is at GND potential and is providing an alternate pathway to GND for the regulator current. For example, if any of them is an output driven low, this could happen. You really want them to be in a high impedance state. It is OK to pull them high weakly, or even drive them high after the 2n2222 is off.

Note: it may be easier to use a small PMOS transistor to switch the positive side of the regulator. That is what I would do for sure. Then when you want to turn off power to the board, in addition to turning off the PMOS (by driving the gate high) you also need to make sure all other IO lines to the board are low.

\$\endgroup\$
  • \$\begingroup\$ Thanks for this analyze. I tried several transistors to ensure it is not fried, I will mesure the voltage when the signal is off. I think the problem is with those yellow wires (SoftwareSerial). Maybe some diodes would solve the problem? \$\endgroup\$ – Christophe Bouin Feb 2 '17 at 9:12
  • \$\begingroup\$ Let's confirm the cause first. \$\endgroup\$ – mkeith Feb 2 '17 at 17:48
  • \$\begingroup\$ The voltage between base and emitter is 0.78V, so what do you mean by "it may be turning on a bit"? \$\endgroup\$ – Christophe Bouin Feb 2 '17 at 21:41
  • \$\begingroup\$ I realize I wasn't clear in my question. I can power off the ESP, this is not a problem. The problem is when I power it on, the AT commands don't work fine. when I short Emitter to Collector, everything is OK. \$\endgroup\$ – Christophe Bouin Feb 2 '17 at 22:36
  • \$\begingroup\$ In that case, replace it with an N-channel FET such as BSS138. This is an entirely different question, by the way. \$\endgroup\$ – mkeith Feb 3 '17 at 5:21

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.