Homemade buzzers

Packet databases and other quizbowl sites, apps, or software should be discussed here.
Post Reply
amekyras
Kimahri
Posts: 2
Joined: Sat Dec 03, 2022 4:57 pm

Homemade buzzers

Post by amekyras »

Has anyone attempted to make their own set of quiz buzzers? Admittedly it's more of a project to do over the Christmas break than out of dire need, but if anyone's done something similar before and could advise on which connectors might be best/the circuit architecture they used, I'd be very grateful.
Aisling Skeet (she/her)
Psych @ Durham (UK) 2022-26
hexadecillion
Lulu
Posts: 9
Joined: Tue Jan 18, 2022 7:03 pm

Re: Homemade buzzers

Post by hexadecillion »

I have a friend who recently built a set of wireless buzzers. Here's what he told me:

- 3.5mm headphone jacks were used to connect plunger buzzers to the signal senders/receivers
- he used an ESP32 for wireless transmission, but an ATmega, ATtiny, or an ESP8266 will also work
- use transistors to control lights

I'm not a hardware guy, so most of these words go over my head.
Kevin Peng
Winston Churchill HS '24
User avatar
DragonTownEpic
Kimahri
Posts: 2
Joined: Tue Aug 22, 2023 8:54 pm
Location: San Diego, CA

Re: Homemade buzzers

Post by DragonTownEpic »

Hi! I made a (kind of scuffed) set of buzzers over the summer. I'd be more than happy to send over any information you need!
Alex Xu
Canyon Crest Academy '24
:grin:
User avatar
DragonTownEpic
Kimahri
Posts: 2
Joined: Tue Aug 22, 2023 8:54 pm
Location: San Diego, CA

Re: Homemade buzzers

Post by DragonTownEpic »

Figured I'd post the basic stuff in here:
For a microcontroller I used an Arduino Nano Every because it was cheap and small. https://store.arduino.cc/products/arduino-nano-every
Each buzzer was connected to the Arduino through a six conductor cable, with each individual conductor going to one button and all five buzzers on a side sharing a common ground. https://www.amazon.com/gp/product/B0BVL ... UTF8&psc=1
Here are some diagrams showing what I mean:
Image
Image

To connect either side of buzzers to the central box, I used a six conductor aviation plug https://www.pchcables.com/gx16-6.html

For lights, I actually used Addressable RGB Light Strips. You can control however many LEDs you need with only one data input! This is especially important if you're using the Nano Every, since it doesn't have all that many pins.

For actual buzzers/boxes, I modeled everything in Fusion 360 and 3D printed them. You can get a free education license for Fusion 360 and it is fantastic. Here are the STL files https://drive.google.com/drive/folders/ ... sp=sharing , though the center console box thingy is probably too small. If you want the f3d or gcode files, I can send those too.

Here's a photo album of the building process, including a video showcasing it: https://photos.app.goo.gl/5GNG9dWN8Xre3WHw9

And this is the code for the Arduino. It's probably the most scuffed part of this whole build, but it worked:

Code: Select all

#include <FastLED.h>
#include "pitches.h" 



#define A1  4
#define A2  2
#define A3  3
#define A4  5
#define A5  6

#define B1  9
#define B2  7
#define B3  8
#define B4  10
#define B5  11

#define A_DATA  14
#define B_DATA  16
#define NUM_LEDS  21

CRGB leds_A[NUM_LEDS];
CRGB leds_B[NUM_LEDS];


#define CLEAR_PIN 15
#define BUZZER_PIN  19

int startupMelody[] = {
  NOTE_E5, NOTE_D5, NOTE_FS4, NOTE_GS4, 
  NOTE_CS5, NOTE_B4, NOTE_D4, NOTE_E4, 
  NOTE_B4, NOTE_A4, NOTE_CS4, NOTE_E4,
  NOTE_A4
};

int startupDurations[] = {
  8, 8, 4, 4,
  8, 8, 4, 4,
  8, 8, 4, 4,
  2
};

int AMelody[] = {
  NOTE_D4, NOTE_E4, NOTE_D4, NOTE_E4, NOTE_D4
};

int BMelody[] = {
  NOTE_G4, NOTE_A5, NOTE_G4, NOTE_A5, NOTE_G4
};

int buzzDurations [] = {
  16, 16, 16, 16, 16
};

void AJingle(){
  int size = sizeof(buzzDurations) / sizeof(int);
  for (int note = 0; note < size; note++) {
    //to calculate the note duration, take one second divided by the note type.
    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
    int duration = 1000 / buzzDurations[note];
    tone(BUZZER_PIN, AMelody[note], duration);

    //to distinguish the notes, set a minimum time between them.
    //the note's duration + 30% seems to work well:
    int pauseBetweenNotes = duration * 1.30;
    delay(pauseBetweenNotes);
    
    //stop the tone playing:
    noTone(BUZZER_PIN);
  }
}

void BJingle(){
  int size = sizeof(buzzDurations) / sizeof(int);
  for (int note = 0; note < size; note++) {
    //to calculate the note duration, take one second divided by the note type.
    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
    int duration = 1000 / buzzDurations[note];
    tone(BUZZER_PIN, BMelody[note], duration);

    //to distinguish the notes, set a minimum time between them.
    //the note's duration + 30% seems to work well:
    int pauseBetweenNotes = duration * 1.30;
    delay(pauseBetweenNotes);
    
    //stop the tone playing:
    noTone(BUZZER_PIN);
  }
}

void setup() {
  // put your setup code here, to run once:
  FastLED.addLeds<WS2812, A_DATA, GRB>(leds_A, NUM_LEDS);
  FastLED.addLeds<WS2812, B_DATA, GRB>(leds_B, NUM_LEDS);

  int size = sizeof(startupDurations) / sizeof(int);
  for (int note = 0; note < size; note++) {
    //to calculate the note duration, take one second divided by the note type.
    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
    int duration = 1000 / startupDurations[note];
    tone(BUZZER_PIN, startupMelody[note], duration);

    //to distinguish the notes, set a minimum time between them.
    //the note's duration + 30% seems to work well:
    int pauseBetweenNotes = duration * 1.30;
    delay(pauseBetweenNotes);
    
    //stop the tone playing:
    noTone(BUZZER_PIN);
  }
  // Use the built in pullup resistors because yay those exist
  Serial.begin(9600);
  pinMode(A1,INPUT_PULLUP);
  pinMode(A2,INPUT_PULLUP);
  pinMode(A3,INPUT_PULLUP);
  pinMode(A4,INPUT_PULLUP);
  pinMode(A5,INPUT_PULLUP);

  pinMode(B1,INPUT_PULLUP);
  pinMode(B2,INPUT_PULLUP);
  pinMode(B3,INPUT_PULLUP);
  pinMode(B4,INPUT_PULLUP);
  pinMode(B5,INPUT_PULLUP);

  pinMode(CLEAR_PIN,INPUT_PULLUP);
}

void loop() {
  // delay(500);
  for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
  }

  // Serial.println(digitalRead(CLEAR_PIN));

  // put your main code here, to run repeatedly:
  int random = rand() % 2;
  // Serial.println(random);
  if(random == 0){
    // A team gets advantage
    int A1Val = digitalRead(A1);
    int B1Val = digitalRead(B1);
    int A2Val = digitalRead(A2);
    int B2Val = digitalRead(B2);
    int A3Val = digitalRead(A3);
    int B3Val = digitalRead(B3);
    int A4Val = digitalRead(A4);
    int B4Val = digitalRead(B4);
    int A5Val = digitalRead(A5);
    int B5Val = digitalRead(B5);
    // Serial.println("These are the stakes");
    // Serial.println(B1Val);
    // Serial.println(B2Val);
    // Serial.println(B3Val);
    // Serial.println(B4Val);
    // Serial.println(B5Val);
    // Serial.println("\n\n\n\n");
    if(A1Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[1] = CRGB(64, 0, 0);
      leds_A[2] = CRGB(64, 0, 0);
      leds_A[3] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B1Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[1] = CRGB(0, 64, 0);
      leds_B[2] = CRGB(0, 64, 0);
      leds_B[3] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A2Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[5] = CRGB(64, 0, 0);
      leds_A[6] = CRGB(64, 0, 0);
      leds_A[7] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B2Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[5] = CRGB(0, 64, 0);
      leds_B[6] = CRGB(0, 64, 0);
      leds_B[7] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A3Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[9] = CRGB(64, 0, 0);
      leds_A[10] = CRGB(64, 0, 0);
      leds_A[11] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B3Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[9] = CRGB(0, 64, 0);
      leds_B[10] = CRGB(0, 64, 0);
      leds_B[11] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A4Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[13] = CRGB(64, 0, 0);
      leds_A[14] = CRGB(64, 0, 0);
      leds_A[15] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B4Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[13] = CRGB(0, 64, 0);
      leds_B[14] = CRGB(0, 64, 0);
      leds_B[15] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A5Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[17] = CRGB(64, 0, 0);
      leds_A[18] = CRGB(64, 0, 0);
      leds_A[19] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B5Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[17] = CRGB(0, 64, 0);
      leds_B[18] = CRGB(0, 64, 0);
      leds_B[19] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }   
    }
  }else{
    // B team gets advantage
    int A1Val = digitalRead(A1);
    int B1Val = digitalRead(B1);
    int A2Val = digitalRead(A2);
    int B2Val = digitalRead(B2);
    int A3Val = digitalRead(A3);
    int B3Val = digitalRead(B3);
    int A4Val = digitalRead(A4);
    int B4Val = digitalRead(B4);
    int A5Val = digitalRead(A5);
    int B5Val = digitalRead(B5);
    // Serial.println("These are the stakes");
    // Serial.println(B1Val);
    // Serial.println(B2Val);
    // Serial.println(B3Val);
    // Serial.println(B4Val);
    // Serial.println(B5Val);
    // Serial.println("\n\n\n\n");
    if(B1Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[1] = CRGB(0, 64, 0);
      leds_B[2] = CRGB(0, 64, 0);
      leds_B[3] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A1Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[1] = CRGB(64, 0, 0);
      leds_A[2] = CRGB(64, 0, 0);
      leds_A[3] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B2Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[5] = CRGB(0, 64, 0);
      leds_B[6] = CRGB(0, 64, 0);
      leds_B[7] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A2Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[5] = CRGB(64, 0, 0);
      leds_A[6] = CRGB(64, 0, 0);
      leds_A[7] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B3Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[9] = CRGB(0, 64, 0);
      leds_B[10] = CRGB(0, 64, 0);
      leds_B[11] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A3Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[9] = CRGB(64, 0, 0);
      leds_A[10] = CRGB(64, 0, 0);
      leds_A[11] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B4Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[13] = CRGB(0, 64, 0);
      leds_B[14] = CRGB(0, 64, 0);
      leds_B[15] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A4Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[13] = CRGB(64, 0, 0);
      leds_A[14] = CRGB(64, 0, 0);
      leds_A[15] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(B5Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_B[17] = CRGB(0, 64, 0);
      leds_B[18] = CRGB(0, 64, 0);
      leds_B[19] = CRGB(0, 64, 0);
      FastLED.show();

      // Little jingle
      BJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }
    }else if(A5Val == LOW){
      // Indicator light
      for(int i = 0; i < NUM_LEDS; i++){
        if(i % 4 == 0){
          continue;
        }
        leds_A[i] = CRGB(64, 64, 64);
        leds_B[i] = CRGB(64, 64, 64);
      }
      leds_A[17] = CRGB(64, 0, 0);
      leds_A[18] = CRGB(64, 0, 0);
      leds_A[19] = CRGB(64, 0, 0);
      FastLED.show();

      // Little jingle
      AJingle();

      while(digitalRead(CLEAR_PIN) == HIGH){
        // Do nothing
      }   
    }
  }
  FastLED.show();
}
It plays the Nokia ringtone on startup, which was initially a debugging tool but I kept it in because frankly it's hilarious every time I hear it.

Speaking of scuffed, this whole thing is BATTERY POWERED. I would highly recommend not doing this and instead picking up a power adapter and using that instead. I have to change out the battery like every 30 minutes (not even an exaggeration) and it SUCKS!

Lastly, I have some spare parts I could send to you, though that might pose some difficulties...
Alex Xu
Canyon Crest Academy '24
:grin:
amekyras
Kimahri
Posts: 2
Joined: Sat Dec 03, 2022 4:57 pm

Re: Homemade buzzers

Post by amekyras »

Thank you so much for the details (and especially the STLs)! Looks like I've got a fair amount of work ahead of me but I'm very excited :)
Aisling Skeet (she/her)
Psych @ Durham (UK) 2022-26
Post Reply