Andrew BerryJack DuffSpivey
Published

Buzz Wire Game

This is the classic Buzz Wire game where you try and get the loop through the course without touching, powered by the Wia Dot One.

IntermediateFull instructions provided30 minutes1,949

Things used in this project

Hardware components

Wia Dot One
Wia Dot One
×1
Wia Grove Module
Wia Grove Module
×1
Seeed Studio Grove Buzzer
×1
Coat Hanger
×1

Software apps and online services

Wia
Wia

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long
Tape, Electrical
Tape, Electrical
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Cutter / Stripper, 5.25 " Overall Length
Wire Cutter / Stripper, 5.25 " Overall Length

Story

Read more

Custom parts and enclosures

Buzz Wire Game Course Stand

This is the main base portion of the stand for the buzz wire game. This portion can be specific to what type of course you make so if you would like to use this make sure your course will fit its dimensions.

Buzz Wire Game Wire Locker Course

This is what lockes down one end of the course to keep it from coming out of the main case

Buzz Wire Game Insulator

This is what insulates the end of the wire so you can rest the handle down on one end and it wont keep touching the hot (course) wire.

Code

Buzz Wire Game Code

C/C++
This is the code to be deployed to your Dot One for the Buzz Wire Game
#include <WiFi.h>
#include <Wia.h>

const int inputWirePin = 19;
const int outputWirePin = 18;
const int buzzerPin = 26;
int previousTime1 = 0;
int previousTime2 = 0;
int timeElapsed1 = 0;
int timeElapsed2 = 0;
bool stop;

Wia wiaClient = Wia(); // this is necessary for the Dot One to funtion properly

void setup()
{
  WiFi.begin(); // this connects the Dot One to the wifi
 	delay(2500);
  // this pin is the wire that detects if they have touched
  pinMode(inputWirePin,INPUT_PULLDOWN);
  // this pin is the hot wire meaning it has voltage and will supply current when the two wires touch
  pinMode(outputWirePin,OUTPUT);
  // this pin controls the buzzer
  pinMode(buzzerPin, OUTPUT);
}

void loop()
{
  stop = false;
  digitalWrite(outputWirePin, HIGH); // set the hotwire to high
  if(digitalRead(inputWirePin) == HIGH) // check if the wires have touched
  {
    // this loop allows you to start a run
    previousTime2 = millis();
    while(digitalRead(inputWirePin) == HIGH)// this is responsible for the start run
    {
      delay(1);
      if(millis()-previousTime2 > 4000) // checks that the wires have been connected for 4000ms
      {
        delay(2000); // delay to give time for the user to start
        previousTime2 -= 2000; // deduct the delay form their time
        stop = true; 
        break; // break out of the while loop
      }
    }
    timeElapsed2 = millis()-previousTime2; // calculate the time elapsed 
    if(timeElapsed2 >= 4000)
    {
      for(int i = 0; i < 5; i++)
      {
        digitalWrite(buzzerPin, HIGH);
    		delay(100);
    		digitalWrite(buzzerPin, LOW);
        delay(100);
      }
    }
    if(stop) // this indicates if the run should be started or if the user made a mistake
    {
      wiaClient.createEvent("Start run");
    }
    else
    {
      timeElapsed1 = millis() - previousTime1; // calculate run time
      previousTime1 = millis();
      wiaClient.createEvent("End run", timeElapsed1); // print run time 
      digitalWrite(buzzerPin, HIGH); // buzz when the user touched
      delay(100);
      digitalWrite(buzzerPin, LOW);
      delay(3000);
    }
  }
}

Credits

Andrew Berry

Andrew Berry

25 projects • 11 followers
Jack Duff

Jack Duff

32 projects • 8 followers
Man of the people. Champion of the downtrodden. Marketing magic @ Wia. Becoming a maker by learning, building, and exploring
Spivey

Spivey

82 projects • 59 followers
Tourist in a Tutu || US Born || Melbourne/Mexico/California Raised || New Yorker at ❤️ || SF to Dublin to be COO of Wia the best IoT startup

Comments