Skip to content

hellanoob/mic-pong

Repository files navigation

mic-pong

This controller uses a KY-037 sound sensor connected to an Arduino Nano 33 IoT. The KY-037 provides an analog output that increases with vocal intensity. The Arduino reads this signal through pin A0. Because the raw values jump around, the code averages fifty readings to reduce the noise. This smoothed value is used to decide what movement should be sent to the Pong game.

Two threshold ranges define the controller behavior. Higher values come from loud vocal projection and move the paddle up. Lower vocal intensity sits in a lower range and moves the paddle down. Anything below both thresholds counts as neutral. The sensor behavior determined these ranges during testing and they are matched directly to the game. The microphone’s original switch is rewired to control power between the USB type C input and the Arduino, which keeps the build simple.

The Arduino sends the movement values through Bluetooth Low Energy. The browser Pong game receives these values as up, down or neutral and moves the paddle in real time. The final controller contains only the parts required for this behavior which are the power line, the switch and the single analog line from the sound sensor.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors