Power RFID module using GPIO I am building an ESP8266 device that uses RFID but need to conserve battery power.

The ESP is a Wemos D1 Mini and the RFID module is a RC522 (still waiting for it to arrive), which needs 3.3&nbsp;V. I'm powering the ESP with a battery shield and 3.3&nbsp;V.

But I don't want to connect the RFID module directly to the battery shield because it will be sucking voltage constantly. Instead, I want to be able to control its power using the ESP.

So I thought the easiest would be simply to connect the RC522's 3v3 line to one of the ESP's available GPIO pins, set it to output, and when I need  RFID, set the GPIO pin high, to turn on the RFID module.

Is this an acceptable solution, or do I need to wire in a transistor and capacitor somewhere?
No, this is not an acceptable solution.  The RC522 needs in excess of 100mA to operate, and an ESP8266's GPIO pin can only supply 12mA maximum.  You will damage the ESP8266.

You need to use a P-channel MOSFET with the gate pulled HIGH as a high side switch.







simulate this circuit &ndash; Schematic created using CircuitLab

Set the GPIO to LOW to turn on the MOSFET. Set it HIGH or to INPUT to turn off the MOSFET.



Note 1: Set the communication IO pins to INPUT before powering off otherwise they could back-power the target device through the ESD diodes in the IO pins.