Workshop 2

Streamed live 9 July, 10:30 am AEST

Click to toggle workshop transcript

Hello and welcome back to the EduKits Interactive coding experience. I’m thrilled to have you join us again today for the second workshop in this series of four workshops where we’re taking a look at building some new inventions with the amazing Annoyatron.

It’s very chilly this morning where we’re recording this, so I hope you’re all keeping warm. Luckily this year we’ve got a little bit more indoor time than we usually do, so that makes it a little bit easier for us all.

Today we’re going to be looking at two new inventions to build with the Amazing Annoyatron kit and I’m going to go over what those are in just a second, but first a few things to get out of the way and if you were with us for the last session this will sound familiar, at least some of it.

Firstly I’d like to talk about the Q&A session that’s going to happen at the end of this workshop. You can send us in your questions and comments that you might have throughout the video or even afterwards if you’ve pressed pause and are coming back later or if you’re just watching this whole session after it’s been streamed.

You can find our email address to send us these questions or comments in the sidebar of your stream page or it’s appearing on the screen right now. This email address is [email protected]. You can use this email address to get in touch with us. as I said before, even after the workshop is done. And even though we won’t be able to answer your questions live on the program today, we will be able to get back to you over email.

Also, we’re going to be using an app today called Code Kit by EduKits. And this is going to be linked in the sidebar of the video as well. And unlike the Arduino software, you won’t need to download it. It’s a free app by EduKits which you’ll access just by opening a new tab in your browser. And we’ll go over that when we get to it in the video.

Lastly it’s time to talk about what we’re going to be building. Last week we looked at the ticking clock and the alarm and flashing light. Those were pretty cool inventions but today I think we’ve got two that will run for their money. Let’s take a look now.

So today in this workshop we’ve got our two inventions and they are the Button Master. This involves a button and a buzzer and as you know from last week the buzzer is a great little device. It’s sure to cause chaos in all types of scenarios. And we also have the Wakey Wakey invention. This is one of my favourites. When I first came up with it, it was called the Electronic Rooster because the premise behind it is that you put it in a dark room, say overnight, and then when there’s morning it makes a very loud noise. It’s essentially a buzzer that is triggered when there’s light. That has some pretty cool uses. Not that I recommend doing what I just described, but maybe.

Okay, so let’s take a look at the parts we’ll need to build the inventions for today. I’m I’m going to put them out on the table in front of me and you can take a look. There are two inventions and like last week, there will be different parts needed for both, but I think it’s a good idea to get the parts for all the inventions out of the kit, put them out on the table, and then we can have them on the side for when we need them later. So let’s take a look.

Firstly, you will need the Brain Board. As we know from last week, this Brain Board is the brains of our invention. It’s what we use to connect the different parts and we also upload our code to it. Next, you will need the buzzer, which is our favorite handy-dandy little part, makes lots of noise. And all we need to do to connect that to the brain board is just slide its legs in, which we’ll go over in a moment.

You will also need the blue USB cable to connect it to the computer. Now, you will also need this touch sensor. This is for the Button Master. And you can see that it has, it’s a little circuit board, it’s blue and it has a little target shape in the middle. That’s going to be important. That’s where you touch and it can sense when you touch it. This is probably the only board I’d recommend touching. Generally when you touch circuit boards, it’s not a good idea, especially when they’re connected to power, but this one you’re supposed to.

Getting close to finishing up now in terms of what we need to get out. we have three different coloured cables. And like last week, you’ll need to make sure that on one end of these cables is a hole and on the other end, there’s a pointy bit. And also like last week, it doesn’t matter what colours you pick. They’re all the same, but picking the same colours as me will help you to make sure that you’re connecting the right things to the right things.

Second last part, you will need a resistor And it’s essentially this funky looking thing. It’s a little blue cylinder and it has a leg sticking out either side. This is for the Wakey Wakey. And lastly, you will need this light dependent resistor. It is, as you can see, it’s got a little top there and two legs that stick out the bottom.

Now, I’d also like to mention while we’re on the topic of components that you can find in your yellow instruction booklet with the Annoyatron, a list of components included. This is on page six and also across page seven. And it explains what each of these do, if you’re interested and also tells you what’s in there.

So now that we have all the components out, it’s time to launch into Code Kit and to take a look at the app we’ll be using to code today. So jump onto your computer and open up the EduKits website, that’s it, edukits.co.

Now that we’re on the EduKits website, we can take a look at the top bar. Last week we went under products and inventions and clicked on there to access all the Annoyatron inventions which are available with the kit. But this week we’re going to be opening up a new app called Code Kit. So to do this I’m going to go under our code menu and click on code and then launch web app and it says open Code Kit in a new browser tab. This is the one I want. You can see here that the Code Kit app is loading and it will take a moment if you’re doing this for the first time. And you’ll notice that a quick settings menu opens up automatically when we’ve arrived at this app for the first time.

Now you can see that we have to select our kit and the kit we’re using is the Amazing Annoyatron and you can see there’s a little switch here for appearance and you can switch between dark mode and light mode. And as you can see the change there happens so you can preview it. And this is really down to personal preference. If you’d like one or the other, you can select that, otherwise just click get started.

You might be wondering, what are we using Code Kit for? Last week we used Arduino. Well if you remember what happened last week, we essentially copied some sample code from the EdgyKids website, uploaded it, saw what it did and then modified it to make it better and more annoying. In doing so, we picked up a few handy coding skills. We learned about delays, we learned about pin numbers on the brainboard. But the tricky part was the code was already written so we didn’t really have full control over what was happening.

Well, Code Kit is different because it allows you to drag and drop colourful blocks to create exactly the code you want. So Code Kit is really cool because it just has a few easy steps. You drag and drop blocks, you click to customise, you copy the code and then you upload it to your board. And I’ll show you how this works once we’ve put together the Button Master and it’s time to get to the coding. So let’s assemble this. Let’s get this show on the road.

On the table here, we have the parts for all the different inventions that we’re going to be building today, but we don’t need all of them because this is for wakey-wakey as well. So I’m going to take away the light dependent resistor, which is the light sensor, and I’m also going to take away this resistor here, and we’re going to be left with the parts we need for the Button Master. I’ll also take away this blue USB cable and get it out of the way because we don’t need it right now.

Now it’s time to connect the buzzer to the brainboard, which you’ll probably remember from last week, that wasn’t too difficult. So let’s take a look. So you’ll remember from last week that all we need to do to connect the buzzer is to line up the pins on the brainboard with the legs of the buzzer and then slide the legs into those pins or those holes on the brainboard. Now the longer leg goes into pin 11 on the brainboard and the shorter leg goes into ground or GND. An easy way, an easy trick to make sure that you’ve got the right holes is to line up the long one with pin number 8 and then to go pin number 9, 10 and 11. Now that you’ve counted you can, woof, don’t slip like I did. Now I’m in 11, I’ve counted and then I can just slide it in like so. I don’t know that a few of you had troubles with the buzzer not making any sound last week and that was just because you had it in maybe one or two slots down on the brain board.

So now we’ve done that part familiar from last week and now let’s move on to connecting the touch sensor. Here’s the touch sensor you can see that it has the target shape and it also has three little legs sticking out the end and you can see on the circuit board they have little labels this one says SIG, that’s SIG, that’s short for signal. When you press the button, a little signal comes out of that and tells the Brain Board it’s been touched. You also have VCC, which is where we’re going to plug in the positive, and then we have ground, GND. And you can, if you remember from last week, we have a ground port, in fact, two of them on the other side of the board we can use, to the buzzer.

So we’ll start off with the signal, the signal leg. I’m going to take my green wire, or whatever colour you’re using to substitute, and I’m going to slide it over the signal. Great. Now I’m going to take the red, because red is generally associated with positive, I’m going to slide it over the VCC, over the VCC leg. And finally, I have the ground, or GND, and I’m going to use the black cable for that.

So now it’s time to plug those in to the Brain Board. I’m going to line up the Brain Board here, and let’s start off with the signal. We connected the green cable to that, so I’m going to connect the green cable over here to pin number nine, which you can see here. I’ve lined it up and I’m going to connect it there. Now if we go to the other side of the board, you can see that we have the ground and we know from last week where those are, so I’m going to put one in there, that’s the black one into the ground. Now you’ll also see a 5V above it as well, so there’s another ground port, there’s another ground port here but if you look up there’s a 5 volts that’s 5v and I’m going to put the red one into that hole.

So now we have our… now we have the the touch sensor and the buzzer properly connected so all that’s left to do is connect the blue USB cable to the brain board and get to coding.

The first step in coding today will be creating an annoying buzzing sound like the one we had last week, so essentially an alarm-like sound. And we knew how to do that last week by copying the code from the website. But this week we’re going to create our own sound from scratch this time.

I think it’s a good idea to take a quick look at what’s happening when we look at this invention, when we code it. So the button master, what’s happening here? we have a button pressed, that’s what happens, that’s what’s triggering this sound, and then we’re going to make a buzzer beep. And if we take a closer peek at what’s going on here, oh, and obviously that’s repeating forever, we’re always checking if the button’s pressed. There’s little things happening there. We’re checking if the button’s pressed, because it may not always be checked, so we may not always have to do a beep.

Then we’re going to turn the buzzer on, wait 150 milliseconds. So remember, that’s the, that delay between turning the buzzer on and off is what gives it that annoying sound. And then we’re going to go back to the start and check if the button’s pressed again. This will go over and over and over again. That’s what’s happening here. So we’re going to replicate this in Code Kit, and I’m going to show you how right now.

If we switch back to Code Kit, we can see there are a number of kind of categories over here on the left hand side. And if you click on one of these, it opens up and a bunch of colorful blocks appear in the sidebar there. We can click and drag on these to bring them into the main rectangle, which is known as the workspace.

So right now, I want to scroll down the input output and I want to go to this set buzzer. I’m going to click and drag this onto the workspace. And you’ll see over here on the right hand side, some codes automatically appeared for us. And this code, we can copy later on and paste it into the Arduino application and upload it to the Brain Board. But for now, let’s just focus on this block.

We can set the pin and we’re going to set the pin to pin 11. And this over here, 440, it says hertz next to it. That’s the frequency, so we can change the pitch of the buzzer to be higher or lower pitched. And I think that’s pretty cool. Now, we don’t have our delay, which we needed before. If you remember back to our little plan we have over here on the side. We want to wait 150 milliseconds after we’ve turned this buzzer on to make the beep.

So, I’m going to go over into this cog icon at the top right, click on it, and I can now, over here, look at the different categories of blocks I’ve enabled. In Code Kit, you can turn off different block categories in the sidebar, but you can also turn on new ones, and I’d like the timing one to be here. So I’m going to click Close. The page is going to quickly reload to show it, and you can see there’s now timing. I’m going to click and drag this on here. I’m going to change it from 1,000 milliseconds to 150 milliseconds. And now we’ve pretty much created all of our code.

Now we only need two more blocks. We need to add the block to turn the buzzer off, and then we need to add a short delay so that when it loops around, we have just a short moment where the buzz is off so we can have just a little bit of peace in our lives. Let’s get back to it.

So I’m going to right click on this top buzzer, and it gives me an option to duplicate it for this top buzzer block. I can then move it down here. Oh, sorry, sorry. We don’t need another one of those. We don’t need the buzzer to be more annoying just at a different pitch. We want to turn the buzzer off. So under input/output, I’m going to scroll down and you can see that we have a stop sound. Good. So now we’ve stopped the sound coming from the buzzer, which is at pin 11. All that’s left to do is add another delay so that once the beeping sounds made, we can have a little moment of peace.

So I’m going to click the timing button and wait 1000 milliseconds. So we’re making a beep, then we’re waiting a second before we assault our ears again. Now I’m going to click the copy code button and you’ll see a message that says code copied down the bottom to tell us that the code is now on our clipboard. You don’t even have to select it. Isn’t that brilliant?

Now I’m going to go to the Arduino application. You can see I have a brand new sketch. I’m going to select all of the code in it, Backspace it to clear it out, then right click and paste in the new code that’s been generated for us. Now, you will need to remember to select the port for the Brain Board again. And you can do this by going to the Tools menu, at the top, selecting Port, and making sure that you have the Arduino Uno option selected. I’m going to click that, and then click the right-facing upload arrow to send the code to the board.

I seem to have the spinning wheel which is never a good sign, that’s okay, we’ll give it just a moment. Okay, it’s asking me to save my sketch and give it a name. I’m going to do this really quickly. This is the Button Master. I’ve named this and now it’s going to be uploading to the board. Great. It’s sending over and in a few seconds we should hear a beeping sound. Beeping sound. Yep, you can hear it. It’s quite annoying. It’s a little bit quieter than last week’s though. Okay, so we have a great buzzer noise. I’m going to just disconnect it for now until we until we need it again.

So we’ve essentially got our buzzer noise, but now we need to make it triggered by a button press. And I’m going to show you how to do this right now. Over in the Code Kit software, I want you to go over to the logic section and grab an if block. And you’ll see that you can hover over the very top of the set buzzer block. And you’ll notice that a short yellow line appears over the top. and that tells you it’s going to snap. You can also see this silhouette, the silhouette of this if block. You can kind of see it over in the, just around, kind of like a C shape. I think the camera’s mirroring me, so it’s a C shape that way, a C shape that way around the other blocks. And that means that the if block is going to wrap around all of them. I’ve dropped it there, done, great.

So now all of this buzzing sound is only going to happen if a certain condition is met, and that is if our button is pressed. So I’m going to click on the input output again, this seems to be our favorite section this week. And I’m going to go down to the one that says state of pin.

So you’ll remember before that I said, if you touch the touch sensor, a little signal will go through that little signal pin and it will go into the brain board. and we connected that signal pin, oh sorry, that signal leg over to pin nine on the Brain Board. So in the Code Kit software, all we have to do is select pin nine. Under state of pin, we’re going to read pin nine. It’s as simple as that. Now we can click on the copy code button. Now that’s on our clipboard. Switch back to the button master in the Arduino software. Select all the code, delete and paste in the new stuff.

Now, I’ve reconnected the board to my computer. Can hear the buzzing sound. I just had an error, but that was because I didn’t plug it in before I get uploaded. Don’t make the same mistakes as me. And you’ll hear it’s uploaded, but now it’s quiet. So I am not touching the touch sensor and you can hear no noise. But the moment I touch it, you can hear that it starts to make a noise again. If I take my finger off it, you’ll see that the noise goes away and I put my finger back on and it’s back again.

Now it’s time to go back to our favorite part of the coding which is making it more annoying. And to do this, we can decrease the delays and we can also increase the frequency of the buzzing. So those are the two things, let’s do them now. Over in Code Kit, you want to decrease this delay over here between from 1000 to 500. You can also increase the frequency, so to maybe something like 600, which is going to make the buzzer sound make a more high-pitched sound. Copy that, switch to Arduino, and then upload it.

The best part about this invention is it doesn’t make any noise while you’re uploading it or while you’re working on. making it more annoying while you have it plugged into power. Okay, it’s uploaded now, let’s take a look. I think we’ve succeeded in our mission of making this more annoying, but of course you can have a play around with this more. If you want to do it now, just hit pause on the live stream, come back to it later, I’m not going anywhere. Or you can just have a play after the workshop.

But now we’re going to be moving onto building another invention, which this time is the Wakey Wakey invention. Wakey Wakey is pretty similar to the button master in that we’re going to be saying that this buzzing noise, this beeping alarm, whatever you want to call it, is only going to happen if a certain condition is met. Last time we were making this noise if the button was pressed, but this time we’re going to make it if light is sensed.

So this is going to work by you putting this in a dark place, this invention in a dark place, and then you wait until there’s light, so this could be in a situation where you’re waiting until it’s morning or waiting until someone opens the cupboard, for example, and then this is going to activate. Of course, we cannot simulate going from night to day, and I cannot turn all the lights off in here, there are too many, so I will instead just cover the invention to show you how it works. But you’ll see when we’re looking at how this invention is getting put together that it’s pretty similar to the last one.

We’re checking the light sensor to detect light instead of checking the button and we’re still turning the buzzer on, waiting 150 milliseconds and then turning it off to make the buzzing sound. So we have a little bit of assembly to do this time for the button, sorry for the Wakey Wakey convention. So let’s do it. Okay, firstly I’ll disconnect it from power because it’s never good to build things while the power is on with electricity and stuff. Next you’ll want to disconnect the wires from the button because we don’t need the button for the moment.

Okay, now you will need the two extra parts, which are the resistor, which is that blue thing with the two legs sticking out the side, and you will also need the light sensor, pardon me, which is this, it kind of looks like a person with two legs and no upper half. That’s pretty much what it looks like. I can’t find a better way to explain it. Yeah, it has pretty skinny legs.

So to connect this, what we want to do is, it’s pretty similar to the buzzer. We’re going to be taking the legs of these devices and we’re going to be sliding them into the slots on the brain board. And to do that, we’ll need to zoom in a little bit closer. Okay, so I’m going to bring this up here. this brain board over and we want the other side actually the other side over here and you’ll see that we have the ones of interest are a you can see that it says a0 we’re also interested in ground and this one over here that was five volts that we used last time.

The first one I want to do is this light sensor. So we’ll take its two legs and we’re going to just pull them apart a little bit like that. I’ll move this over this way so you can see better. That doesn’t seem to be making it any better with the light. Okay I’m going to be connecting this from A0 and also into 5 volts which is over here. Okay, that’s in securely. Now it’s… Okay, now it is in securely. Sorry, I just dropped something.

Now we have the resistor and it has two legs here but I’m going to fold them in to make a kind of U shape. So you can see how I folded those inwards. Now that’s the right shape and I’m going to connect these between the A0 and GND. So you can see that’s A0, the same one we did before and GND is the one just before the 5V. So if I push these over just so you can see what’s going on, we have the 5V there and the GND there in the pinover. So I’m going to push those back into normal position and that is done.

You’ve successfully built your second invention for today. Now all that’s left to do is connect the brain board to power which I will do right now and then we can launch code kit and get to coding it. Okay actually plugging it up of how wasn’t the greatest of my ideas, was it? Okay, now if we go to Code Kit, we can see that under our if statement, we have the state of pin nine. I’m going to delete this and then input output, we can select the light sensor, light sensor, light. That’s exactly what we want. So now, instead of trying to check if we have a button pressed, we’re only going to make the sound if there is light, which I think is pretty cool.

All you have to do now is copy that code, head over to the Arduino application, paste, delete it, paste in the new stuff. Now I will connect the board to my computer this time before trying to upload it, and I will hit Upload now. It’s compiled, it’s uploading, and it’s done uploading. So the lights are a little bit lower now, and I’m going to simulate what happens if you have a bit of light. And I’m going to do this by pointing my phone’s flashlight at the light. (beeping) So as you can see, as there’s light on the sensor, it makes a buzzing noise like we had before.

This wraps up the two inventions we had on today’s program. I hope you’ve really enjoyed them. And this brings us to our Q&A session, where we answer some of the questions you’ve been sending to our email address, the [email protected] address. I’m going to take a look at some of those now and answer them for you.

The first question for today is, what’s the difference between Code Kit on the web and your Code Kit desktop app? Sorry, is one better than the other? That’s a great question. I did mention earlier at the start of the workshop that there are two versions of Code Kit available. There’s one that you can download to your computer and there’s also one that runs on the web and that’s the one we’ve been using today. It’s completely free, well actually both of them are completely free. And the web one requires no installation. The real difference between the two is that if you download the web version, you don’t need an application like Arduino to copy and paste. If you download that Code Kit app, you’ll be able to upload code straight to your brain board from your computer without needing to copy and paste. Instead of a copy button, there’s just an upload button. It goes straight to the board. You don’t have to fiddle around with different applications.

Onto the next question. Why do we have to use a resistor? And I think that’s very, very valid. We know about the button, we know about the buzzer, we know how those things kind of work. But what about the resistor? My favorite resistor, ’cause there’s actually two of them. There’s one, which is the blue one, but my favourite one is this other one. And I think you can see it here. And this is the light sensor, but you may not know it, but it’s actually a resistor. What a resistor does is it reduces the amount of current flowing between, flowing between it within a circuit. And in the case of our light sensor, What that means is that it’s changing the voltage based on how much light there is. So in a fancy way, that’s just a fancy way of saying, we can get a different signal based on how much light there is. If there’s more light, we get a higher signal and if there’s less light, we get a lower signal. And if you take a look at the code, there’s a function here, it says bool is light.

Now I don’t expect you to know too much about what this means. In fact, any of what this means. But if you look here, it says, If analog read A0, so A0 is our light sensor, that’s what it’s talking about there, is greater than 300, then it’s going to return true, which means that, well, the function’s name is light, so if the value of the light sensor is above 300, then it’s light, and that’s what it means. So if it has a high value, lots of light, it will give a bigger signal, a bigger voltage.

Now, let’s move on to the next question. Sorry about the last one, it was a little bit complicated, but resistors are really interesting and they’re also in pretty much everything electronic you have. There’s actually billions of them in your phone along with transistors and other components.

This one is, I like it a lot. What inspired you to invent the Annoyatron? Great question. Read your instruction booklet at the very back it has got a picture of me that’s because I created the Annoyatron. Wow that is an old photo not really that old but my hair has grown a bit since then. I was inspired to create the Annoyatron when when I was 13 actually because I sorry when I was 14 because I loved coding. I learned to code when I was 10 and I found that it was really hard as a kid to find things that were interesting for me to do with coding. I had to learn coding by going to TAFE and getting textbooks and I thought no one has to learn like this. Coding is fun and we should be building pranks not building boring websites. This is what we should be doing. We should be building exciting things to prank our family and that’s really how the Annoyatron is born. Creating something useful and fun for kids to create with coding and hopefully you’re getting a little dose of that today.

And our last question for today before we start to respond to your questions over email is what is your favourite buzzer pitch to be really annoying? It sounds like I’m about to, the answer I’m about to give is probably going to sound like a cop-out but I actually think, I don’t have a favourite, there are different uses for both of them, sorry for both high and low pitches. If you have a high pitch which is when you go up to something like 900 you have a kind of, the buzzer essentially squeals, really high pitch noise, unpleasant, but also if you have a low pitch noise, like a 50, that’s going to be a low pitched grumble, a little gerbil from that buzzer and it’s equally annoying.

Thank you so much for joining us in this second workshop in the EduKits Interactive Coding Experience. It’s been a pleasure presenting for you and building some inventions with you. I hope to see you back next week on Monday and again on Tuesday to build some more inventions and to answer some more of your questions. Until then, have a great day. Can’t wait to see you again.

[Music]

Email us to comment

Our livestream email address is [email protected]

Download the Arduino software

Click the blue button below for instructions. You’ll need the app to follow along today.