Loading...
Hello, my name is Mr. Brown and welcome to this lesson on off-board components.
We're going to be thinking about all the different types of components that are going to be on a micro:bit and then also looking into the use of Tinkercad and trying to connect different components up that are actually found not on a micro:bit, but actually can be attached to one.
So without further ado, we will talk through the learning cycle, the key learning outcomes and the keywords for today.
So today's learning outcome is to name off-board components that can be added to a micro:bit.
Here's the keywords for today.
So the first one is off-board components.
Now off-board components are different parts of a product that can be attached to a micro:bit.
Pins.
Pins are the connections on the edge of a micro:bit that can be used to add off-board components.
Light Dependent Resistor or an LDR, that's an input device that can control circuits through sensing light.
And the last one is Tinkercad.
Tinkercad is an online computer-aided design application.
And then on to the lesson outline.
So today's lesson outline, there are two learning cycles in today's lesson.
The first one is micro:bit off-board components, and the second one is micro:bit off-board components in Tinkercad.
And of course, we're going to start with lesson cycle one, which is micro:bit off-board components.
So let's talk about micro:bits.
They have input components that send information to the micro:bit, and they've also got output components that will produce sound or light or movement.
So inputs are things that go into the micro:bit, and then the outputs are things that will happen with that information, what sort of signals it sends and what the micro:bit does next.
So let's go through the micro:bit components on the front of a micro:bit.
So we've got a light sensor, and that's part of using the LEDs.
We have a push button A, we have a touch button, a microphone, push button B, but also you can attach external off-board components such as a moisture sensor or switches to the pins.
There's lots of other things that we can do by adding to the pins.
Those are the gold bits that are along there.
On the back, there are also some other input components.
So we've got a temperature sensor, there's a compass and accelerometer, and there's a microphone.
Now output components, so things that will happen or producing light, or sound, or some movement.
We have the LED lights.
So again, they're interesting because the LED lights, they can act as a light sensor, but they can also be an output.
So they're an input and an output.
And an LED stands for Light Emitting Diodes.
But you can also attach outputs such as headphones or other LED lights and motors to the pins.
Output components on the back.
there's a radio antenna, there's a speaker.
Now what do pins on a micro:bit allow you to do? A quick check for understanding now.
What do pins on a micro:bit allow you to do? Is it A, attach inputs and outputs.
B, attach inputs not outputs.
Or C, attach outputs not inputs.
Which is it? Is it A, B or C? That's right, it allows you to attach inputs and outputs.
So let's talk about some more components that can be used as part of a museum alarm.
So we're thinking about creating a museum alarm using a micro:bit.
What sort of input components could be used? So the light sensors on the front, they could actually sense if something is nearby and set off an alarm.
So for example, let's say that a shadow comes across as someone gets too close, then that will actually sense it and then the alarm will sound.
It could have a microphone, so it could sense sound and set off an alarm.
So if there's a sound or a movement that it can hear that's very close by, then it would set off an alarm.
There are output components that can be used as part of a museum alarm.
These are just suggestions.
The LED lights could come on as actually a silent alarm.
It doesn't have to be a loud one.
Or we could also have a speaker that could sound an alarm.
Now these are all components within the micro:bit itself.
They are onboard components.
But other input components can be attached to the micro:bit pins using wires or crocodile clips.
And we call those off-board components because they're not actually on the micro:bit themselves.
They are separate, but they need to be attached to the micro:bit.
They are off the board, hence off-board components.
Now for a museum alarm, if we're thinking about the LED lights being a light sensor, we wanted to have something like that, then you could include a light-dependent resistor, which is an LDR.
And that would actually be a really good way of measuring the light and as soon as the light changed, then that would create a signal.
But you could also use a push-to-make switch as an input.
And that could be an external one that you actually add.
So if anyone gets near to a particular artefact, then the pressure switch is activated and then the circuit is complete.
and then the micro:bit will sense that signal and then produce something for an output.
We're just looking at inputs, remember, for this particular slide.
So quite a lot of information there already.
So let's do a check for understanding.
What is an LDR? Is it a Light Dancing Robot? B, a Light Dependent Resistor? C, a Light Display Reader or D, a Light Data Router.
So which do you think an LDR is? A, B, C or D? That's right, it's a Light Dependent Resistor.
So let's talk a bit more about an LDR.
So it does work like a light sensor.
So the light level changes and the micro:bit could be turned on or it could be turned off.
And a push-to-make switch, well, that could connect a circuit and turn the micro:bit on or off.
Now other output components, we're talking about outputs now, they can be attached to the micro:bit pins using crocodile clips or wires.
And these are also called off-board components because again, they are not on the board, they are off the board and so that's why we call them off-board components.
So for a museum alarm you might want to include a buzzer, for example.
So you might want to have an alarm buzzer that actually goes off or you might want to have an LED light, or a series of LED lights, or a light bulb.
There's so many different other types of things that you could choose to use.
Now a buzzer could sound when the micro:bit sends a signal.
Or an external light could turn on when the micro:bit sends a signal.
Right, time for you to do a task now.
Very quick task.
Place the components in the correct boxes of the table below.
So you've got an LDR, a buzzer, a speaker, and a microphone.
And what I'd like you to do is to choose which box they go in.
Now, just to let you know, there's one for each of the boxes.
So there's four different components, and there's four empty boxes.
One of each goes into each box.
Okay, so let's go through the columns that are there.
So you've got inputs and outputs.
So firstly, put those components into two groups of which are inputs, which are outputs.
And then which ones are on board, or on the micro:bit as a component, and which ones are off-board components.
Okay, that is the first part of this task.
And once you've completed that, then can you add some more components? We've talked about quite a few already, and maybe you know some others.
But what would you add? What could you add? Could you add maybe even an extra one into each box? There's the challenge for you.
I'm going to let you get on with that simple task, and I'll get back to some feedback in a moment.
Now you can do this.
Off you go.
Right, welcome back.
Here's some feedback.
Aisha actually did the components and put them in the correct box of the table below.
And there you can see a microphone is an input, but it's also on the micro:bit component.
There's an output, which is the speaker on the micro:bit.
And then the off-board components, well, the input could be an LDR and the output could be a buzzer.
Now she also went through and she added more components to the table.
So she added that a light sensor is also an input and a micro:bit component and an output is also LED lights on a micro:bit component.
And then the off-board components, she put as an input a push-to-make switch.
And as another off-board component as an output, she put LED lights.
There are lots of other answers as well, and I'm sure you've come up with all different sorts of suggestions.
But well done.
You've completed that.
That's the first part of today's lesson.
And we're going to be thinking about what we're going to be doing next in learning cycle two.
Learning cycle two, the micro:bit off-board components in Tinkercad.
So we'll go through and we'll talk about how to control the internal and off-board component buttons with a different software package.
And what we're going to use today is we're going to use Tinkercad.
Now that's an online computer-aided design application.
And by logging into Tinkercad, we can explore all the different electrical components further by just doing it on a screen.
So the first thing you need to do is to log into Tinkercad.
Students with class code.
Type in your class code from your teacher and then select join with nickname and enter your name.
You might already be given one as well.
So accessing Tinkercad circuits, the first thing you need to do is to create a new circuit.
Now it might be, if this is the first time you've been using Tinkercad, then you'll see on the left hand side, there will be a box saying "Create your first circuit's design." If you've used it before, you probably won't have that button, but what you will have is in the top right hand corner, a blue button that says "Create." Either way, you're going to be creating your new circuit with regards to off-board components.
Here's the Tinkercad workspace.
And there's the file name.
You might wish to choose with your teacher a name for your work and think very carefully about one that's going to be recognisable.
You might want to think about what year you're doing this in, what sort of unit it is.
I'll leave that down to you and your teacher to decide.
And of course, that big space there, that's the workspace.
And that's what we're going to be doing a lot of work with today.
Because what we're going to be doing on that workspace is using the electrical components and you can see there on the right hand side, you've got all the different types of electrical components and if you scroll up and down, you'll be able to go through a whole list of all the different components that we've got that we can use it within Tinkercad.
Let's go with a check for understanding now.
So how do you rename your work in Tinkercad? Is it A, click on the workspace under the Tinkercad icon? Is it B, click on the code editor next to the basic components? Is it C, click on Start Simulation above Basic Components? Or is it D, click on the heading bar next to the Tinkercad icon? So which is it? A, B, C or D? I'll leave it to you.
You decide.
That's right, well done.
It's the bottom one.
It's the heading bar that's next to the Tinkercad icons.
You click on that and then you'll be able to change and rename your work in Tinkercad.
So let's go through the Tinkercad workspace so we can scroll down the components list to see all the options.
And what you want to do is you want to select all components, not just basic.
Off-board components for a micro:bit.
What we're going to do is I'm going to go through a whole list of all the different off-board components that can be used with a micro:bit.
And you can see that I've put them out on the workspace there.
And what I've done is I've put the Tinkercad names in brackets because they can often be called different things.
So the LDR that we spoke about earlier, that's actually called a photo resistor within Tinkercad.
A micro:bit is known as a micro:bit.
Push-to-make switch, that's known as a push button within Tinkercad.
A bulb is known as a light bulb in Tinkercad.
LED is LED.
And a buzzer is known as a piezo.
So connecting a buzzer to a micro:bit, this is how we use the Tinkercad workspace.
So firstly, it's best to rotate the components as below.
And this is mainly so that the wires don't get crossed.
The idea is that actually some of these components, particularly buzzers, only work in one particular direction.
And so instead of actually having to swap the wires over, if you have it this way, with the negative towards the top and the positive towards the bottom, as you can see there on buzzer, then it will actually work really well.
Now we need to start thinking about how we actually connect these components within Tinkercad.
So the first thing to do is to actually click on the connector.
So this time, as you can see there, it's clearly marked where the connector is.
If you just hover over there, click on that, and then if you click on it again, it will change the direction and you can actually see it's going all the way around.
You can see that yellow areas at the end of the wire.
That's where it's got to and the idea is that we connect it to the micro:bit and here, it's just going to the ground pin and you'll be able to see a picture in the next slide about what that looks like when it's finished.
Right, so now you can see there from that picture, we actually have the negative going to the ground pin so that's the negative of the buzzer going into the ground pin of the micro:bit and then we have the positive connector being joined up to the zero pin of the micro:bit and we'll talk a bit about that in a moment.
We're now going to be thinking about changing the wire colour.
Now it can stay green, that's absolutely fine, it can change into any of those colours really, but it's a really good practise to get into using a black for negative and red for positive.
If you think about the buzzers that you've seen in physical person, you can actually see that they have a black and a red wire.
So what we're going to try to do is just to configure that.
There's a button there just under where it says components and if you click on that, then you're able to choose the wire colour.
So the first thing you need to do, highlight the cut of the wire and then click wire colour and choose the colour.
And there you go, we've got a completed circuit, we're now ready to do some coding.
So the negative wires are black and the positive wires are red.
Check for understanding, which one of these icons allows you to change colours of the wires? Is it A, B or C? Which one of those icons would you use to change the colours of the wires? That's correct.
Well done.
It's A.
Right, we're on to coding now.
So we're going to steps of coding.
We're going to, first of all, we're going to put a sad face.
So what this is going to mean is, is that when the buzzer sounds, there's going to be a sad face.
So on start, show icon, sad face.
So we bring in the on start, bring that over and then we put show icon and we put that in and we can choose whichever icon we want to.
In this case, it's a sad face.
The next step is now to push button A to turn on the buzzer.
So we drag over a On Button A and we click down and then we bring in a white pin.
We write a digital right pin P0.
Remember it's gone to zero pin, and we're going to put that to high.
And then we're going to duplicate that.
And we do that by right clicking on the on button A code and then we click duplicate and there you can see it's got exactly the same.
But what you will probably notice is that on button A, the second one has selected up and the digital right pin zero is down to low so let me just talk to you about what that means.
So what that code means is that when button A is pushed down then the pin zero will go high and basically means the buzzer will go on.
And when push button A is up, that means when you've let go of it, then the pin zero will go to low.
That means that the buzzer will turn off.
It's literally push button A, turn it on and the buzzer sounds.
Take your finger off it and the buzzer stops.
Very, very simple.
And hopefully you'll be able to understand how that works now.
Okay, so now we need to start a simulation and test that it works, and that happens by actually clicking on the start simulation button.
And when you click on that start simulation button, what that means is that micro:bit that's on the workspace, if you click and hover over the A button and press it, then you should be able to hear a noise that comes out of the buzzer.
All right, that should be all working now.
But let's have a quick check for understanding before we move forwards.
So how can we test code in Tinkercad? Do we click code? Do we click start simulation? Do we click stop simulation? Or do we click send to? How do we test code within Tinkercad? Is it A, B, C, or D? That's right, well done.
It is B.
Click start simulation.
Okay, so let's go through that code again.
So what will happen is, on start, so when the micro:bit is turned on, it will display a sad face.
When the button A is pressed, the buzzer will be turned on.
And when the button A is not pressed, when you've let go of it, then the buzzer is turned off.
And now there's lots of different other ways of doing that.
We can even change the pitch of the sound.
And if you wanted to do that, here's the code for doing this.
So if you wanted to change the pitch of the buzzer, this is what you can actually do.
So instead of having digital right pin, we put right analogue pin.
And you change the number to change the pitch.
In this case, it's got 500.
And then you change the number to zero to turn the sound off.
So it's very similar to the previous way of doing it.
And you might want to investigate changing the number and seeing whether it's a high pitch or a low pitch.
Is that a high pitch when it's a high number or a low pitch when it's a low number? I'll let you investigate and see how you come up with.
And it is your turn now.
So number one, can you choose an off-board output component such as a buzzer for an alarm? We're talking about an off-board output component.
We're not going to be worrying about inputs right now, just the outputs.
And then create a Tinkercad circuit for linking the off-board component.
Now of course with task one, you don't actually need the component there physically in front of you because we're going to be virtually doing this within Tinkercad.
You need to have made sure you've got your choice about what the output is going to be.
And then we create the circuit.
And then you code the off-board output component to come on when button A is pushed and off when button A is released.
And then explore, have a go with changing different things, see how you can change your off-board output component, just like with a buzzer, changing the pitch of it.
But you might want to do all different sorts of things and just explore using Tinkercad and see what you can come up with.
And obviously, as you're doing this, think very carefully about how to debug all of the code that you've done.
So if it hasn't worked, why not? Keep going backwards and forwards throughout the slide deck.
I'm sure that will be able to help you.
Right, I'm going to stop talking now and let you get on.
You've got a lot to work through, but remember, choose which output you're going to use.
Create a circuit, code the circuit, and then think about what else you can actually do with the output components that you've decided to use.
Right, off you go.
Enjoy, and I look forward to speaking to you in a moment when we talk about the feedback.
Right, welcome back.
So Jacob chose to use a buzzer and when the push button A was pushed, it made a deep sound and when the push button A was let go, it went silent.
And so he's gone through and he's decided to change the pitch of the actual sound.
And as you can see there, he's got very simple, he's got the buzzer connected to the ground button and to the zero pin and then we've got the pins being controlled by the code that he's put in there.
Well done Jacob and well done you.
I'm sure you've got to that stage too.
Well done.
Now let's go through the key learning points from today's lesson.
Micro:bit inputs include buttons, microphones, sensors for light and temperature, acceleration and magnetism through the compass.
Micro:bit outputs include the LED display and the speaker.
And additional outputs can be added to a micro:bit using the pins.
And that can include adding things like the LED lights, switches, sensors, LDR and buzzers.
And the last thing, Tinkercad has off-board components in the circuits mode.
All right, that's it, well done today.
That's the end of our lesson today on off-board components.
I'm sure you've all understood what off-board components are and you can name some of them now.
And you've also been able to code them to actually practise working with them within Tinkercad.
A huge amount done today.
So well done.
You should be very proud of your efforts and I look forward to working with you next time.