I need a way to spin a brushed motor in both directions with my Raspberry Pi 4. I don't have the right transistors. The only way I would be able to achive this is through a GPIO port that I could turn on and off as a ground, is this possible with NodeJS? After all, they are called General Purpose Input Output ports.
1 Answer
No problem as long as
- the motor only need to sink a maximum of 16 milliamps to ground as that is the maximum which may be safely sourced or sunk via a Pi GPIO.
- the voltage applied to the GPIO is within the range 0 to 3V3. I.e. no negative voltage and no voltage spikes caused by back EMF.
Of course if these conditions are not met the Pi will be destroyed.