case 11 DC motor
14. case 11 DC motor#
The servo is a device that can transfer electric energy to kinetic energy based on a law of electromagnetic induction. In this case, we will use a switch to turn the motor on and off.
14.3. Hardware Connect#
Connect circuit as above picture and put 2 AAA batteries into batteries pack.
14.4. Principles of Circuits#
The GND of slot on micro:bit is into innards of batteries’ GND to generate the current loop.
14.5. Introduction of Components#
There are many categories of motors, but a motor basically transforms electric energy into kinetic energy according to the rule of electromagnetic induction. When the direct voltage was added on the two sides of the motor, the motor turns. The higher the voltage, the faster the rotation. The experiment box included a DC motor, and it connects a fan to show rotation.
Note: Please note the positive and the negative when you are connecting.
Click on “New Project” and set a new Project.
Under the on start block, Wirte 0 to the P0 port to prevent motor from mis operated. Set pull pin P1 to up for waiting button signal.
Judge the value of P1 if it is equal to 0. If it is, write 1 to the P0 port for starting the servo; If it is not, write 0 to the P0 port to stopping the servo.
You also could directly download program by visiting website as below:
Press switch, the motor runs; press it again, the motor stops.
How can we use the trimpot to control the speed of the motor?