Motor not spinning

Hi everyone,

I have 2 motors 1.5-3v and 3v-6v. I connect both using the alligator clips. On programming I use button A and have digital pin ‘P0’ set to 1 & button b, pin ‘P0’ set to 0. When I download and connect it, the motor does not spin. However when I swap the motor around with the led and use the same code, it works.

Any solutions?

Hi @E12345 — Welcome to the forum.

I believe this is a “power” problem. Electric power is the combination of voltage and current. The voltage will be about 3.3v, and the P0 and P1 pins have a maximum output current of about 5-15 milliamps (ma which is 0.015 Amps) (details here). The current is kept low to protect the micro:bit’s processor. If the current were too high, it could damage the micro:bit.

Electric power is measured as the product of the two. 3.3v * 0.015Amps = 0.045 Watts. That’s enough to light an LED, but not enough to activate most motors.

Usually transistors are used in some way to allow the low current provided by the micro:bit’s P outputs to control a slightly higher current needed by small motors. There are several companies that sell motor control boards based on this principle (like Kitronik’s Motor Driver Board). Or if you want to get a better understanding of how it works, you can see this example from the Elecfreaks’ micro:bit Starter Kit. It shows how to use a small transistor to control a small motor with the P connectors.

Be careful when connecting things like motors to the micro:bit. It’s best to only used devices meant to work with the micro:bit and follow guides, like the one from Elecfreaks. And be sure to only use batteries and power inputs made for the micro:bit.