GPIO to Power a Sensor
Posted: Sat Feb 23, 2019 8:08 pm
I have a magnetic sensor on my board. Currently it is powered directly by the 3.3v rail.
I have found that when I update the firmware using OTA the sensor doesn't work until I power cycle the whole system. I suspect that the magnetic sensor is just in a state that it needs to be reset.
I know I could add a FET or transistor with a GPIO to be able to power cycle the sensor, but was wondering if I couldn't just power the sensor directly from a GPIO. That way I could just set the pin low and then high to cycle power on the sensor.
The data sheet says the average current draw during normal operation is 3.7 mA and the note says this is the peak during ADC operations for about 270 microseconds, so I guess that is the max.
I read a post that says the max current draw on the esp32 GPIO is 40 mA, so it seems this would be fine. I just didn't want to bank on it without asking someone.
I have found that when I update the firmware using OTA the sensor doesn't work until I power cycle the whole system. I suspect that the magnetic sensor is just in a state that it needs to be reset.
I know I could add a FET or transistor with a GPIO to be able to power cycle the sensor, but was wondering if I couldn't just power the sensor directly from a GPIO. That way I could just set the pin low and then high to cycle power on the sensor.
The data sheet says the average current draw during normal operation is 3.7 mA and the note says this is the peak during ADC operations for about 270 microseconds, so I guess that is the max.
I read a post that says the max current draw on the esp32 GPIO is 40 mA, so it seems this would be fine. I just didn't want to bank on it without asking someone.