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.
GPIO to Power a Sensor
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: GPIO to Power a Sensor
Yes, you should be able to do this.
-
- Posts: 15
- Joined: Sun Dec 16, 2018 4:06 am
Re: GPIO to Power a Sensor
Thank you. Can you think of any side effects or down sides?
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: GPIO to Power a Sensor
For one sensor? Not really. I wouldn't go overboard with this technique and try to pull 40mA from every single available GPIO as that'll probably heat up the chip a fair bit, but for one sensor, you should be good to go.
Who is online
Users browsing this forum: No registered users and 99 guests