0% found this document useful (0 votes)
18 views

INTRODUCTION_ Micro_bit

The document provides an overview of the BBC micro:bit, a pocket-sized computer designed to teach programming through hands-on projects. It includes essential questions, learning outcomes, and a variety of experiments that can be conducted using the micro:bit, such as generating sounds and measuring temperature. Additionally, it covers the hardware essentials, programming methods, and how to connect and power the micro:bit for various applications.

Uploaded by

mark.balatbat
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

INTRODUCTION_ Micro_bit

The document provides an overview of the BBC micro:bit, a pocket-sized computer designed to teach programming through hands-on projects. It includes essential questions, learning outcomes, and a variety of experiments that can be conducted using the micro:bit, such as generating sounds and measuring temperature. Additionally, it covers the hardware essentials, programming methods, and how to connect and power the micro:bit for various applications.

Uploaded by

mark.balatbat
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

Micro:bit

Creative Engineering with Microbit


Hook https://www.youtube.com/watc
h?v=Wuza5WXiMkc
Pre - Assessment https://quizizz.com/
ESSENTIAL Use this Topical Questions
How can I use microbit to make
QUESTIONS cool stuff that connects to the
How can I apply ICT to communicate, physical world?
collaborate and learn?
How do artists, engineers, and
makers solve problems when
they’re working/inventing?
Habits of Mind Working with and learning from
Thinking Interdependently others in reciprocal situations.
Teamwork.
INTRODUCTION: Micro:bit
Millions of the BBC micro:bit have been issued since its launch in
2016. People all throughout the world, young and old, love them.
The micro:bit was created as a simple method — to impart
programming knowledge to children. Its simplicity of use—all you
need is a computer and a USB cable—is one of its many benefits.
It can also be turned off the power supply and operated only on
batteries once it has been programmed.
The micro:bit features all the components you need to create
engaging projects, including a tiny LED display and sensors for
motion, light, and magnetic fields. When the time comes,
alligator clips make it simple to connect components like motors,
sensors, and loudspeakers without the need for soldering.
INTRODUCTION: Micro:bit
The BBC Micro:bit, a pocket-sized computer with several
features, is used in this device. It has an accelerometer, two
programmable buttons, Bluetooth, a built-in compass, and the
capacity to handle external features like speakers, servos, and
buttons. Microsoft MakeCode is a free online code editor that
utilizes a block-based programming language to program
Micro:bits.
Here’s a sample list of the
experiments
● Generating sounds - Learn to make your micro:bit play musical notes and other sounds.
● It speaks -Teach your micro:bit to speak!
● Sensing light - Use the built-in light detector.
● Measuring magnetic fields - Use the built-in magnometer to sense magnets.
● Gestures - Use the micro:bit’s gesture recognition software to have the device do
different things when you shake, drop, or throw it.
● Real-time acceleration plotting - Learn about Mu’s data visualization feature.
● Logging acceleration to a file - Record the data detected by the micro:bit so you can
look at it later.
● Making a servomotor move - Experiment with motors!
● Keeping time - Learn how the micro:bit tells time.
● How fast are your nerves - Test your reaction time.
● Measuring temperature - Use the micro:bit temperature sensor to build a thermometer.
● Finding the radio range- Learn how to use the micro:bit for radio communication.
INTRODUCTION: Micro:bit

Makers will learn how to start using a microcontroller


(Micro:bit) with coding software (MakeCode) to begin designing
cool physical computing projects.
01 Learn about a microcontroller and how
to program one with coding software.

Write lines of code and learn how to

LEARNING 02 save, download, and upload code


from software to the microcontroller.

OUTCOMES Engage in pair programming as a


03 way of collaborating with a partner.
• Micro:bit microcontroller
• Laptop with internet connection

MATERIALS •

USB to micro-USB cord
USB flash drive

LIST •

External battery pack
AAA batteries (2)
• Notebook
01 Get to know
the Micro:bit
microcontroller
board.
INTRODUCTION
TO MICRO:BIT
The Micro:bit is one of many
types of microcontrollers—small
devices, similar to a mini
computer, used to control other
devices and machines.
The Top
The Bottom
Power and the
Micro:bit
You can power the micro:bit through the USB connector or
with batteries, depending what you want to do with it.
Using USB
The USB connection will provide the micro:bit with 5V (5 volts) of
power when you plug it into your computer. However, the micro:bit
needs only 3.3V, not 5V, and too much voltage would damage the
micro:bit. Therefore, it has a USB interface chip that converts this 5V
to the 3.3V that the micro:bit expects.
Using USB
When the micro:bit is plugged in via USB, you can use the 3V
connector on the edge connector to provide power to low-current
electronic devices, like external LEDs or speakers designed to work
with the micro:bit.
Using USB
The connection labeled GND is the ground or 0V power
connection. When you power your micro:bit, current flows out of the
3V connection, and it needs to return to the micro:bit in order to
complete the circuit—the GND connection is where the current
returns.
Using Batteries
Once you’ve programmed
your micro:bit, you may
want to move it
away from your computer,
in which case you’ll need
batteries. You
can use a AAA battery
pack, Simply plug the ends
of the battery pack wires
into
the 3V socket on the
underside of the micro:bit.
Using Batteries
A built-in switch is useful
because you can power the
micro:bit down without
unplugging the battery pack, a
task that can be a bit tricky.
Don’t use rechargeable AAA
batteries because their voltage
is generally too low to power a
micro:bit. These batteries can
also allow dangerously high
currents if the flow of electricity
is accidentally short-circuited. If
you want to use rechargeable
batteries, one option is a USB
battery backup.
Using Batteries
A built-in switch is useful
because you can power the
micro:bit down without
unplugging the battery pack, a
task that can be a bit tricky.
Don’t use rechargeable AAA
batteries because their voltage
is generally too low to power a
micro:bit. These batteries can
also allow dangerously high
currents if the flow of electricity
is accidentally short-circuited. If
you want to use rechargeable
batteries, one option is a USB
battery backup.
Connecting Electronics
with Input/Output Pins
One especially fun thing about the micro:bit is that you
can use the connections to attach electronic gadgetry
of your own creation. In this book, you’ll build projects
that use these connectors to control motors, lights, and
a loudspeaker. You’ll also use them as inputs to gather
data from sensors that measure light, sound, and
temperature.
Connecting Electronics
with Input/Output Pins
The 3V and GND connections are there to supply power.
The connections labeled 0, 1, and 2 are usually referred
to as input/output pins, and you’ll be attaching
electronics to these.
Connecting Electronics
with Input/Output Pins
The pins 0, 1, and 2 can be used for:
● Digital output—turning an external LED on and off
● Analog output—controlling the brightness of an LED
● Pulse generation—to control a servo motor
● Digital input—to detect when an external button has been pressed
● Analog input—to measure temperature using an analog temperature
sensor
● Touch input—to detect that you have touched the pin or a wire
connected to a pin
Digital and Analog Inputs

When you use a pin as a digital output, you can write


commands in your programs to turn the output on (set it
to 3V) or turn it off (set it to 0V), but only on or off—
nothing in between. This is also the case with digital
inputs: they can only ever be on or off. When your
program code reads a digital input, if the voltage at the
input is nearer 3V than 0V, then the input counts as being
on; otherwise, it’s off
Digital and Analog Inputs

Analog inputs, however, can be somewhere between on


and off. Analog inputs on a micro:bit can be any value
between 0 and 1,023, depending on the voltage at the
pin.
Making an Analog Signal:
Pulse Width Modulation
A micro:bit, like all other electronics, can work only with
digital on or off signals. To get analog signals between 0
and 3V, electronic devices simulate the analog signal by
providing a rapid series of digital pulses. The longer the
pulse, the more power is delivered to whatever is
connected to the analog output. This is known as pulse
width modulation, or PWM. Figure 1-5 shows PWM in
action.
Making an Analog Signal:
Pulse Width Modulation
Making an Analog Signal:
Pulse Width Modulation
Making an Analog Signal:
Pulse Width Modulation
Making an Analog Signal:
Pulse Width Modulation
Making an Analog Signal:
Pulse Width Modulation
If the output is connected to an LED and the pulse is at 3V
only 5 percent of the time, the LED will appear to glow
dimly. In contrast, if the pulse is at 3V for 90 percent of
the time, the LED will appear to be at almost full
brightness.
Making an Analog Signal:
Pulse Width Modulation
Interestingly, in both cases, the LED would actually be
flashing at 50 times a second, but the human eye can’t
see a light flash that quickly. Instead, we just register a
relatively dim or bright light. If the three pins 0, 1, and 2
are not enough for your project, you can use an adapter
to access the many pins between the three numbered
ones.
Built-In Peripherals

The writing on the underside of the micro:bit gives us


some clues about other things the micro:bit can do. Two
areas at the bottom left are labeled compass and
accelerometer.
Built-In Peripherals

The compass is actually a magnetometer, meaning it


measures the strength of magnetic fields. You can use it
as a compass, but you can also use it to detect the
presence of magnets.
Built-In Peripherals

The accelerometer measures forces acting on the


accelerometer chip. Because gravity is a constant force
pulling down on everything, you can, by measuring the
forces acting in different directions, use the accelerometer
to detect when the micro:bit is being tilted and by how
much, as well as when it is being shaken or in free fall.
Built-In Peripherals

Also on the underside, you will see the words BLE


Antenna. The micro:bit includes BLE (Bluetooth Low
Energy) hardware that allows your micro:bit to
communicate wirelessly with other micro:bits or
Bluetooth-enabled phones. Note that the technology for
micro:bit-to-micro:bit communication is not actually
Bluetooth; it just uses the same frequency.
HARDWARE ESSENTIALS

There are a few things you’ll need for nearly all the
experiments and projects in this book. They include:
HARDWARE ESSENTIALS

Micro:bit
HARDWARE ESSENTIALS

Micro USB cable To connect your micro:bit to a


computer
(Make sure this is a standard micro USB data cable and not a
charging cable, which lacks the necessary connections for
communication. You can’t use a charging cable to load
programs
onto the micro:bit.)
HARDWARE ESSENTIALS

3V AAA battery pack with two AAA


batteries Ideally, these should be no longer than 4 to
5 inches to avoid getting tangled up.
PROGRAMMING THE
MICRO:BIT
One of the nice things about a micro:bit is that to get started
with it, you just need a USB cable and a computer with a
browser and internet connection. You can use a computer
running on Windows, macOS, or Linux. As long as your device
has a modern browser, such as Chrome, it will work fine. We’ll
first connect up the micro:bit. Then we’ll make a small
program using two methods: the drag-and-drop Blocks code
and MicroPython, which you need to type out.
Connecting your Micro:bit

Start by connecting your micro:bit to your computer with a


micro USB cable. Nearly all micro USB cables will work fine,
but remember that charging-only cables don’t have the
necessary data connections and won’t work. If you have
trouble programming your micro:bit using the following
instructions, try using a different USB cable.
Connecting your Micro:bit

Once you connect your micro:bit, your operating system


should react as if you’d just plugged in a USB flash drive. To
transfer a program onto the micro:bit, find the micro:bit in
your filesystem just like you’d find a flash drive or some other
plug-in. Then copy a file called a hex file into the micro:bit
folder icon, and, hey presto!, your program will be installed.
Loading a program onto your micro:bit is also known as
flashing.
Programming with Blocks:
Hello World
You can build programs for the micro:bit through the micro:bit
website without downloading any software. We’ll make a
program that scrolls some text across the LED display on the
micro:bit. Open your browser and navigate to
https://makecode.microbit.org.
Programming with Blocks:
Programming with Blocks:
Programming with Blocks:
Programming with Blocks:
Programming with Blocks:
Programming with Blocks:
Programming with Blocks:
Now let’s transfer your program to the real micro:bit. Connect
your micro:bit using a USB cable and click Download at the
bottom left of the web page.
Programming with Blocks:
This will download the file from the editor in the same way as
any other file that you might download from the internet.
Where the file is saved will depend on your operating system
and browser, but usually it’s in a folder called Downloads.
Find this folder, click into it, and you should find a file called
microbit.hex. Using the File Manager (or Finder on a Mac)
select this file and drag it onto the micro:bit where it appears
in your filesystem
Programming with Blocks:
Adding Graphics

You might also like