svg+xml;charset=utf

01.

Parts & wiring

The alarm and flashing light is sure to cause a frenzy of chaos amongst your friends and family!

Everyone loves arcade games. In this project, you’ll be building and programming one that will have your family and friends frustrated for hours. Someone too good at it? You can tweak a few lines of code and make the Impossible Game even more impossible.

How does the game work? An RGB (colour-changing) LED will cycle through three different colours at a very fast pace. To win the game, you need to press the touch sensor when the LED is displaying the colour red. Be warned: it’s not as easy as it sounds.

What you’ll need

As always, we’ll be using the Brain Board and a USB cable to connect it to your computer. You will also need a Colour LED – this is the one with the clear top and four ‘legs’, a Touch Sensor and 7 Wires.

svg+xml;charset=utf

Brain Board

svg+xml;charset=utf

Colour LED

svg+xml;charset=utf

Touch Sensor

svg+xml;charset=utf

Assorted Wires

How to connect the parts

To connect your buzzer, slide its pins into the Brain Board as shown – the positive leg should go in PIN 11 and the negative leg should go in GND. For the RGB LED, use the diagram below to connect the pins correctly to the board.

When wiring up your RGB LED, you can use different coloured wires to those in the diagram below. The project will still operate the same.

Hover over the PLUS signs for extra tips

Impossible Game
Don’t forget to plug the board into your computer with the included USB cable.
Apart from the ‘negative’ pin, all the other pins are labelled with their wires of their colour.
The longest leg of the LED is the ‘negative’ pin and needs to be connected to GND.

Have you installed the coding software?

You’ll need to download the Arduino software to be able to code your invention. But don’t worry – click here for instructions.

The Impossible Game 2

Here’s what your invention should look like once it’s been assembled.

We decided to use slightly different colours of wires in ours, but this is what yours should roughly look like.

02.

Our sample code

We’ll be using this to program our invention

int led1 = 9;
int led2 = 10;
int led3 = 11;
int touchSensor = 3;

int lightPosition = led1;
int pause = 100;
bool btnPressed = false;
long lastMove = millis();

void setup() {
  // put your setup code here, to run once:
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(touchSensor, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  if(millis() - lastMove >= pause) {
    lastMove = millis();
    move();
  }
  if(digitalRead(touchSensor)==HIGH) {
    if(lightPosition == led3 && btnPressed == false) {
      for (int x = led1; x <= led3;x++) { analogWrite(x, 50); }
      while(true) {
      }
    } else {
      btnPressed = true;
    }
  } else {
    btnPressed = false;
  }
}

void move() {
  for (int x = led1; x <= led3;x++) { digitalWrite(x, LOW); }
  if(lightPosition < led3) {
    lightPosition++;
  } else {
    lightPosition = led1;
  }
  analogWrite(lightPosition, 50);
}

03.

Let’s start coding

Like with previous projects, you’ll need to add and upload the sample code to your Brain Board to get it to work. Forgotten how to do this? Click on the titles below to expand the instructions for each step of the process.

Forgotten how to do these steps? Click on the titles to expand.

Connecting & setting up the Brain Board

1. Connect to your computer

The Amazing Annoyatron kit includes a mini computer that you can send code (instructions) to, called an ‘EduKits UNO’ board. We might also call it an ‘Arduino’ board because this is the program that we program it with. Start by connecting this board to your computer using the supplied USB cable. This will give the board power and will allow it to ‘talk’ to your computer. If the cable is connected correctly, you will see small lights flashing on the board.

Always select your Arduino board before uploading a program

2. Select your board

Every time you open the Arduino software, make sure that you select the option that says ‘Arduino/Genuino Uno’ from the ‘Tools’ menu.

Creating and saving a new 'code' document

Like in other programs you may have used like Microsoft Word, we need to create a new document to work in whenever we start something new. First launch the Arduino software that you downloaded earlier (if you didn’t, learn how to here) and select File > New in the menu at the top of the window.

Creating and saving a new code document in the Arduino softwareYou’ll notice that a new window will have popped up. It already contains some code, but we need to delete this because you will be pasting in some sample code that EduKits has written already. Select all the code using your cursor and then hit the ‘delete’ key on your keyboard to clear the existing code.

Next, select File > Save and give your project a name to save it to your account. This makes saving your work easier for later on.

Now you’re ready to upload the sample code!

Adding and uploading the sample code

Delete the existing code, then copy and past the code from our website. You can then upload the program to your board.

1. Add the sample code

We’re going to start off with some sample code, just so that you can see exactly what the project does. You can find this by scrolling down the page to section ’02’. Copy and paste the code from here into the blank program in the Arduino software.

2. Upload the program

Now that you’ve got your code, you can send it to your Arduino board. Find the button with a right arrow on it and click it to upload. If you haven’t already saved your document, a window will then pop up prompting you to do so. Type in a name like ‘Ticking Clock’ and then hit okay.

The program will ‘think’ for a moment, and then you will see lights flashing on the board very quickly for a few seconds before turning off. This means that the program has now been uploaded.

04.

Make it more annoying

Chaotic coding

We’ll guide you through changing the code to make the project more annoying.

3D Printed Case

Design your own 3D printed case for this project or use one of ours.

Connect to a battery

Learn how to connect your project to a 9V battery (not included).

See it in action

Get some cool ideas on how you can use this project.

Change the speed of the colour-changing cycle

For once, this change isn’t all that exciting. Since the volume of the alarm is already maxed out, the only way the volume can be changed is by bringing it down. But still, if the beeping is a little too loud, then this might be helpful. Line 14 is where the buzzer’s volume is set. Let’s take a look.

analogWrite(buzzer, 255);

The volume here is set with a value anywhere between 0 and 255, where 0 is completely off and 255 is maximum volume. Try a few different values to see what they do to the program.

Change how long each beep goes for

In line 5, you can see that we have set ‘beepLength’ to equal ‘500’. This is what’s called a variable, but more on that later. Changing this number will alter the length and space between each beep.

int beepLength = 500;

The beepLength is used in the program to control the amount of time that the beep stays on for and also the time that it is off for. This is done with a delay on lines 17 and 21 of the code.

delay(beepLength);

You always have to use a number for a delay to work properly, but because beepLength was given a number (500) earlier on in the code, that is how many milliseconds the delay will go for.

What is cool is that when we change beepLength in line 5 of the code to something else, like 750, the delay time on lines 17 and 21 will change to 750 milliseconds with it.

How do I make this thing stop?!?

Click here to find out how to clear the program and make that super-annoying sound finally stop.

svg+xml;charset=utf

Connect your project to a battery

Once you’ve finished building and programming your Annoyatron project, you can connect it to a battery and take it with you. Make sure that you have disconnected the board from the computer using the blue USB cable and instead connect the included battery clip. You will also need a 9V battery (not included in the kit) to connect to the other end of the cable.

Make sure that the Brain Board is never connected to both the computer and the 9V battery at the same time. This could cause damage to both the board or your computer.

3D print a case for the Annoyatron

Pimp your Annoyatron with this new case that you can 3D print in any colour! Feeling adventurous? Open the STL files in your favourite CAD program and really make them your own.

This case holds the included UNO R3 board and has slots for a buzzer, wires, power and USB.

Download now
Design and make your own 3D printed case for The Amazing Annoyatron
svg+xml;charset=utf

See the Annoyatron in Action

Let’s have some fun! Here are some cool tips, tricks and ideas for how you can use this project.
svg+xml;charset=utf

Help someone get a good night’s sleep

What about putting your invention near someone’s pillow? They’ll get a real surprise when they try to get to sleep.

This will really tick them off

Digital clocks don’t tick, do they? This one’s sure to have most people confused. Just make sure that you hide your Annoyatron better than we did.

svg+xml;charset=utf

Aaaaargh!?! Where is that noise coming from?

Try hiding your Annoyatron in a drawer full of paperwork! This ticking sound is especially annoying when you’re trying to get some work done.

It’s a gift from above. Or maybe not.

We used some blue-tack and a ladder (make sure you have a parent around if you use one) to stick our Annoyatron behind one of the lights in the roof. It’s well hidden and will have people very confused.

svg+xml;charset=utf

Share your creations with us on Instagram!

We love to see what people are making with the Annoyatron. Snap a pic and share it on Instagram with the hashtag #Amazing Annoyatron!

How do I actually make this thing stop?

1

Create a new document in Arduino

Open the Arduino software and select File > New in the menu or use the keyboard shortcut Ctrl + N to create a new document.
2

Upload the program to your board

Make sure that the correct board is selected in the tools menu and then click the upload button to send the 'blank' program to the board, overwriting the current one.
svg+xml;charset=utf