← Previous Invention

Broken Night Light

Next Invention →

Alien Signals

svg+xml;charset=utf

Project #4

Definitely Not Music

You know what music is, right? Well, we can guarantee that this is NOT it. We don't want to spoil the surprise, but this one's really, really annoying.

What you’ll need

Important safety warning

This project will create a loud, annoying, high-pitched sound. We strongly advise the use of hearing protection (earmuffs or earplugs) when working in close proximity to this project.
svg+xml;charset=utf

Brain Board

svg+xml;charset=utf

Buzzer

Step 1

Let’s build this!

Ticking Clock Diagram
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.

Connections

Buzzer

The +LEG is the longer leg.

+ LEG11
- LEGGND

Step 2

Code some chaos!

Don’t forget to select your port, like ususal

Copy and paste the sample code

int buzzer = 11;

void setup() {
  // put your setup code here, to run once:
  pinMode(buzzer, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(buzzer, random(2));
  delay(1);
}

Upload the code and test it out

Step 3

Modify the Madness!

Fiddle with the noise

The code for this invention is short, but that’s a good thing. All the code does is randomly sets the buzzer to either off or on every 1 millisecond.

That’s what causes the racket you heard after you uploaded the code – it’s known as ‘white noise’.

Change the delay in line 11 to alter the sound of the noise. You can’t create a delay smaller than 1 millisecond, so you’ll have to try larger values.

delay(10);