SHHH! (Premier’s Coding Challenge)

SHHH! (Premier’s Coding Challenge)

A big issue in our school today is loud classes. Loud classes lead to students not being able to concentrate enough meaning they are not learning as well as they could be. A solution that our group has come up with is a project that will potentially lower the voices of students during class time. Our project is called “SHHH”. It is a traffic light hooked up with a buzzer to alert students when they need to lower their voices during class.

Each stage of light has a different pitch of noise to notify what level of noise they are on. This is helpful for when classes are too loud. The teacher may also use it to alert students that it is her/his time to speak.

Step 1

Step 1

STEP 1

Plug in the thinkershield and connect all the alligator clips as seen in the pictures.

Step 2

Step 2

STEP 2
Open Arduino and write this code

 /* This is the code to be completed
 for the ThinkerShield Pitch Changer Activity
 Written by Thinkspace www.maas.museum/thinkspace
 Ver 1.2
 */

// ThinkerShield has a buzzer connected to digital pin 3.

//define pins
 int potPin = A5;
 int buzzerPin = 3;

// Create variables to hold data we read.
 int potValue = 0;
 int freq = 0;

void setup()
 {
 // Turn the serial port on.
 Serial.begin(115200);

// Initialize the buzzer.
 pinMode(buzzerPin, OUTPUT);
 }

void loop()
 {
 // Read the input pin.
 potValue = analogRead(potPin);

// Map the potValue for PWM.
 freq = map(potValue, 0, 1023, 30, 5000);

Serial.println(freq);

// Write the value to the buzzer.
 tone(buzzerPin, freq, 20);

}

Step 3

Step 3

STEP 3

Upload the program. Press the D7 button and the lights should go off in the order of green, yellow then red along with a buzzing noise. After a low hum can be heard, if this annoys you just press the reset button to stop it.

Add a comment