You are on page 1of 17

Module 7a:

automatic movements

In this module, students will learn:


 How DC motors work
 How to run you Mio Jr.
 How to program and execute it
What is a dc motor?
• A DC motor is a component that converts
electrical energy into mechanical energy
that results spinning.

Mio Jr. M7A 2


What is a dc motor?
You can see DC and AC motors in water
pumps, cars, and electric fans.

Mio Jr. M7A 3


How dc motors works?
DC Motors composed of two curved magnets (stator
“permanent magnets”) that makes the rotation of the
electromagnet (armature). As the electricity flow through the
brushes it passes it to the commutator. Then the commutator
pass the electricity to the electromagnet and repels and attracts
by the two curved magnets that causes it to rotate.

Mio Jr. M7A 4


How dc motors works?
To make it spin faster (torque) we must increase the
number of wires to make the electromagnets stronger.
We can also increase the power source of the circuit to
produce more electricity making stronger
electromagnets.

Mio Jr. M7A 5


Recall: How to connect mio jr. to your
pc
• First get your USB to Mini USB cable and plug it to the
Microcontroller (it can reattach to your Mio Jr.).

You should see this in


your PC. MATRIXBIT

Mio Jr. M7A 6


Recall: Makecode
1. Go to makecode.microbit.org
2. Click New project
3. Follow the code blocks stated
in the next slide

Mio Jr. M7A 7


Recall: Makecode
4. Go to Settings and click Extensions.
5. Put in the search tab https://github.com/onion3/Zero
6. Press enter and click the extension showed up.

Mio Jr. M7A 8


Recall: Makecode

Mio Jr. M7A 9


Recall: Makecode
After you click it, it will download into your
workplace and this new menus will be added.

New added menus

Mio Jr. M7A 10


Recall: Makecode
After you code click save then put the download
file into your microcontroller’s folder.

Click this
Find where you
download it then copy
and paste your hex file
to the Matrixbit (G:)

Mio Jr. M7A 11


programming blocks
Programming Function

Allows you set the


direction of your Mio Jr

Allows you to control the


speed on the two motors of
your Mio Jr

Mio Jr. M7A 12


exercise # 1
Running your Mio Jr. The movement and rotation of the two
motors determines the direction of the movement of your
Mio Jr. Below is the code for the movement of the Mio Jr.
Forward
Backward
Left

Right
Stop
Mio Jr. M7A 13
exercise # 1
Forward Backward

Left Right

Mio Jr. M7A 14


Activity # 1
Instruction: Make your Mio Jr. move upward then backward
then left then right then stop. Each movements must have a
1 second duration. While moving in your Matrix LED you
must show the direction of the Mio Jr.

Mio Jr. M7A 15


Activity # 1
Solution:

Mio Jr. M7A 16


GET EXCITED FOR THE NEXT
ONE!

In this module, students will learn:


 How to control the speed
 How to calibrate the speed

Mio Jr. M7A 17

You might also like