I have a sensor which I want to power from my electron.
It draws average 2.1mA at 3.3V, Peak 50mA
I’ve had it working powered straight from the 3.3v on the electron but I want to be able to control when it is powered and not. Can I power it from a digital I/O pin, I’ve read that these can only supply 20mA?
If theoretically it cannot provide enough power, would I do any damage if I were to attempt to power it from a digital pin and see whether it still works?
Alternatively I guess I just have to connect an NPN transistor from a digital pin to the sensor and up to the 3.3v and gnd pins. Any problems with that and does anybody have any suggestions for good transistors.
Thanks