Getting started with your Annoyatron
The first thing you’re going to notice is this yellow instruction manual. And you’ll already use it to go to a web page with instructions for this invention. Just make sure you read the safety details at the front of the manual and also download the Arduino software as this is going to be really important for the later steps. Don’t worry if your box doesn’t look like this. We’ve got another similar box design here that has exactly the same parts and will produce exactly the same inventions. But for this tutorial, we’re going to use this box here.
Assembling your Annoyatron
For this prank, you’ll only need three parts. First, this brainboard. You will also need this buzzer. And finally, a blue USB cable, which also comes in the box to connect the brainboard to your computer to upload code and power the invention. We need to slide the black buzzer into the holes on this brain board. They are known as pins. Now the long leg should go to the pin that says 11, and the short leg should go to the pin that says GND or ground. Let’s slide them here like this. Should go in really easily. Now it’s time to connect that blue USB cable to your computer. So, plug one side into the board and the other into your laptop or desktop computer, in the same way. Oh god, these things are real tricksters, aren’t they?
Powering and Coding Your Annoyatron
Now, you should immediately see a yellow, it’s not yellow. You should immediately see some LEDs turn on, and this will tell you that the board is indeed on, which is very helpful. So now it’s time to start our invention with coding. Let’s open the Arduino application, which we’re going to use to send instructions or code to control this joke. On Windows, press the Windows key and type the word Arduino, A-R-D-U-I-N-O, and it should come up in the search results. On a Mac, you can press Command + Space and search for Arduino in Spotlight Search to open the application. It will take a few seconds and you will see the loading screen, but then after that, you will see a new code document.
Writing your own code
To determine how each joke is going to work, we need to use something called code, which is basically a language for computers. Our brainboard is a computer and it runs all the circuitry for every electronic joke. So for this ticking clock, our brainboard has to tell our buzzer what noise to make and how. And we use coding to do that. Don’t worry, as difficult as coding may seem, it’s actually quite easy and I’ll show you how to do it right away. Once the Arduino application is loaded, a new document will pop up. It’s going to look a little confusing, but we’re not going to worry about that yet. In the menu at the top of your page, we’re going to choose Tools, Port, and Arduino/Genuino Uno. Then we’re going to make sure under the same Tools menu, but under Boards, the option again says Arduino/Genuino Uno. This is a really important step that you will have to do every time you plug the board into your computer. This is making sure it knows which port the board is connected to and your code will be able to be uploaded.
Wreaking havoc with your Annoyatron
Now that we’ve got that technical work done, it’s time for the fun part, actually writing the code. So in your web browser, make sure you are on the EduKits Ticking Clock project page. Now scroll down to the part of the page where it says code some chaos. Under the first step, you should see a box on the right, with some sample code. We’re going to copy and paste this into our empty code document. So select all the text in the box, right click and copy it. Now we are going back to our document. Now, as you can see, we had numbers in the box on the website, but we don’t have any numbers in our document yet. This is a problem because we can’t see what parts of our code are there. So let’s go into Arduino, preferences and select this checkbox here, show line numbers. If you’re on Windows, it will be under File Preferences instead of Arduino Preferences. Now we’re going to select everything in this existing code document and delete it before right-clicking and pasting the code we copied from the internet. Now if we upload this code now it will do nothing. We have to add some additional instructions. These are just the basics.
Increasing annoyance
So let’s go back. The second step will tell you what you need to do next. It says, look for setup and loop, and there are some pictures to show you. Ok, let’s go and find setup and loop. As you can see here, this section is called void setup. Now, what does that mean? Well, you can see the opening curly brace here and here and the closing curly brace, and everything inside of that is going to be part of what’s called the setup. And setup is a bit of code that runs at startup. Now you can go and watch the loop. Again, an opening and closing curly brace indicates where this occurs. And everything inside the loop is going to play continuously because we want our tick-tick sound to play forever because I mean, it wouldn’t be that annoying if it was only ticked once. We are going to put our code in this section. But what code do we need? Well, let’s go back to the website and see what the next step says. Well, right here, it’s given us some additional code that we can copy and paste. So let’s select that code, right-click and copy, switch back and put your code here, wherever it is.
Upload and test
Now it says, Upload to Brainboard. And we can do that by pressing the upload button right here. You should see a Save As box pop up. And this will ensure that we don’t waste any of our work on the project. Type a name and then press Save. While it is uploading, you will see some flashing lights on the Arduino board and then you will hear a ticking sound like this. It’s not all that annoying now, is it? But don’t worry. There’s something in store for you. At the end of each project, there is a section called “Make it more annoying” and it will show you how to make it more annoying. Let’s scroll down to this section. To make it more annoying you can do different activities and you can find their links here in the left sidebar. There is an option to change the tick sound for this invention but you can also change the time between each tick.
Customizing Annoyatron
So let’s change the sound of each tick first. So it says here, take a look at line 14 in the code, which is a delay. A delay is a short interval in the code between the instruction that comes before it and the instruction that comes after it. So for this delay the instruction before it is turning the buzzer on and the instruction after it is turning the buzzer off. So if there is a long time between the buzzer going on and going off, the noise will be longer and louder. So let’s go and do it. On line 12, you can see the number here, we need to change the delay from one to 10. Let’s go and do it. So line 14, we’re changing it from one to 10. Let’s hit the upload button and see what it does. As you can see, it’s pretty annoying now, but what if we change it to 100? Now hold your horses. Just to let you know, it can be very fast and very annoying. Make sure you have some earmuffs handy, great noise-canceling earbuds. Let’s hit upload and see what it does.
Stopping the Annoyatron
Something else you may want to know is how to stop these inventions because they can be quite annoying and quite loud. Well, we can do this by creating a new document like this and pressing Upload, which will overwrite the existing program with a blank program. As you can see, it is silent. So finally there is some peace now.
Advanced customization
Okay, here, go ahead and change the second delay because there’s another one. But this time it’s all the way down after the buzzer goes off. The code runs from top to bottom. So in this loop, the buzzer went on, we waited a bit, and then the buzzer went off. Now what this bottom delay is doing is the amount of time between the buzzer turning off and the buzzer turning on again. So this is the time between each tick, and it’s set to 1000 milliseconds, which is equal to one second. So if we change this number to something like 5000, there will be one beep every five seconds. Let’s upload it and see how it looks. So it’s not all that annoying.