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 1


No problem as long as

  1. 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.
  2. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.