← Previous Invention

Press the Button 5000 Times

Next Invention →

Wakey Wakey

svg+xml;charset=utf

Project #11

Curiosity Killer

n this project, you are going to be building a button that gives almost no satisfaction when pressed. It just beeps. And if you want it to beep again, you have to take your finger off and put it back on again.

The Kit

The Amazing Annoyatron

Build this invention, and many more, with The Amazing Annoyatron!

What you’ll need

svg+xml;charset=utf

Brain Board

svg+xml;charset=utf

Buzzer

svg+xml;charset=utf

Touch Sensor

svg+xml;charset=utf

3 x Wires

Step 1

Let’s build this!

Curiosity Killer
This is the positive leg of the buzzer. It will have a ‘+’ sign on top of it and will also be longer than the other leg.
Don’t forget to plug the board into your computer with the included USB cable.
The touch sensor is like a button, except that you only have to touch it lightly.

Connections

Buzzer

The +LEG is the longer leg.

+ LEG11
- LEGGND

Touch Sensor

Use wires to join these.

SIG~3
VCC5V
GNDGND

Step 2

Code some chaos!

Don’t forget to select your port, like ususal

Copy and paste the sample code

int touchSensor = 3;
int buzzer = 11;
int beepLength = 50;

void setup() {
  pinMode(buzzer, OUTPUT);
  pinMode(touchSensor, INPUT);
}

void loop() {
  if(digitalRead(touchSensor)==HIGH)       //Read Touch sensor signal
   { 
    digitalWrite(buzzer, HIGH);
    delay(beepLength);
    digitalWrite(buzzer, LOW);
    delay(beepLength);
    while(digitalRead(touchSensor)==HIGH){
    }
   }
  else
   {
    digitalWrite(buzzer, LOW);    // if Touch sensor is LOW, then turn off the led
   }
}

Upload the code and test it out