Motor MOSFET and Trinket M0

by Dan Peirce B.Sc.

Motor MOSFET and Trinket M0

Simple example of Trinket M0 controlling a motor with a power MOSFET. The trinket M0 digital output can only source 7 mA. The motor in this example has a stall current of 500 mA so the trinket M0 can not drive the motor directly.

Power MOSFET

The Circuit

The MOSFET is used in much the same way as in https://danpeirce.github.io/remote-actuator.html#schematic-of-circuit except the gate circuit is replaced with a Trinket M0 and D2 is not required.

Trinket M0

Another page lists some significant links for the Trinket M0 and testing that was done in 2017:

CircuitPython Code

Sample CircuitPython code is provided by Adafruit for blinking an LED. I have modified the code to cycle a motor on and off continuously.

import board
import digitalio
import time
motor = digitalio.DigitalInOut(board.D1)
motor.direction = digitalio.Direction.OUTPUT
while True:
motor.value = True
time.sleep(0.25)
motor.value = False
time.sleep(0.5)

Mu Editor

Adafruit recommends using the Mu editor.