Potentiometer x2, Piezo Buzzer x1, Wire, LED x2, Arduino Uno, 220 Ohm resistor x2
The PIR sensor in fritzing is not representative of the sensor we used. The sensor used for this can be found at Adafruit.
How the game works:
The red LED represents the status of the motion sensor, when it is lit, the sensor is armed and ready. The green LED indicates when the sensor has been triggered. One potentiometer controls the “pace” while the other controls “wait” to make the game a little more challenging. The buzzer will tick, and when the buzzer makes the go noise, you have to waive your hand frantically in front of the sensor before you run out of time. If you succeed in triggering the sensor, then it buzzes a satisfying tune. Conversely, if you lose then it triggers a sad tune. The motion sensor waits about 14 seconds before the next cycle of the game starts.
The rearm function has one minor drawback, mostly due to the inconsistencies in the motion sensor, and that the wait time is hardcoded to 14 seconds, even though the wait time could be higher or lower than that.
For all the fun things you can do with the PIR sensor from Adafruit, it has one major drawback. There is a delay, often inconsistent, every time the sensor is triggered. While it can be adjusted sightly, it ultimately comes down to cheap hardware not doing the job right.
here is the code: