The next lesson for the Microbit is nearly finished. The lesson is how to control a small DC motor with the Microbit programmed in the Makecode block language. The circuit is pretty simple. The circuit uses a transistor, a diode and a resistor.
The lesson starts with simply turning on and off the motor using the built-in Microbit button using the DigitalWrite block. Next, there are instructions on how to vary the motor speed with the AnalogWrite block.
The circuit is then modified to use a knob to control the speed of the motor. The detailed lesson is here. The next lesson is adding the ability to change the direction of the motor.
The class I’m teaching will make DC motor instruments. For example:
Can I not turn the dc motor on only by using pins such as p0 and gnd?
LikeLike
The current from the pins do not provide enough power for the motor. That is why you need to “amplify” the signal.
LikeLike
Hi– I’m interested in your detailed lesson, but I can’t access it. Would you open access for me? Thanks!
LikeLike
I fixed the link. You can access the lesson here – https://drive.google.com/open?id=1lPu3yNbNnEjcNbhkx-jtpx01nyoOD-lB66QQqUEqaMs
or all the lessons here – https://drive.google.com/open?id=0B3heHyQhpPPaZlNoQjNhd0pwOG8
LikeLike
Hi, thank you for the detailed lesson. I reproduced your exact layout (all parts are facing the way you mentioned), with the exact same parts. I have the LED row light up, but motor is not moving. Any idea what could go wrong? It’s a small 3V DC motor that turns on and off fine with just a battery source.
LikeLike
My 1st thought is always to double check the wiring. My 2nd thought is to make sure you have the correct parts. The transistor looks exactly like the temperature sensor in many kits. If you can post a picture, I’ll take a look.
LikeLike
I’ve got the same problem as mentioned by Renata. All seem fine but the motor is not moving.
LikeLike
You may. Have to power the motor with another power source. The micro it doesn’t have enough power to spin the motor.
LikeLike
thank you david where in the circuit I should connect the extra power? thank you
LikeLike
take a look at https://makingwithheld.com/2017/10/16/dc-motor-with-microbit-part-2/
LikeLike
Hi, I’ve got the same problem as Renata. All part seem fine but the motor isn’t moving.
LikeLike
Try using a separate power supply for the motor (like 2 AAAs). The Microbit does have enough current to run the motor.
LikeLike
This is very interesting, I’m trying to build a spiderbot and wish to control two motors independantly…is this possible?
LikeLike
yes, this chip can control 2 motors independently.
LikeLike