Christmas Music Escape Room Arduino Puzzle

by Makeademic in Circuits > Arduino

415 Views, 0 Favorites, 0 Comments

Christmas Music Escape Room Arduino Puzzle

Christmas Mashup Escape Room Puzzle.png

For this holiday escape room puzzle, you will have the player flip a switch to listen to a song and research to find the answer to the question: "Which two celebrity artists collaborate on this holiday mashup song in the film Pitch Perfect 2?" You will need the following things to get started:

Supplies

  • 1- Arduino Uno
  • 1- USB cable
  • 1- mini breadboard
  • 1- slideswitch
  • 1- piezo
  • 1- RGB LED
  • 4- 1k ohm resistors
  • 9- jumper cables

Arduino Code

winterwonderlandsantaclaus.png
note-values-sheet-music.png
image5.png

For this project, you will use the attached code, which checks for a switch and plays music on the piezo and lights up the RGB LED in a repeating sequence of flashing red, white, and green. The code is fully commented.

To create the melody and tone duration arrays in the code, you have to convert the values on the sheet music, reading both the placement on the staffs as notes on a scale from C2 to C6 and reading the shape of the notes from whole notes to 16th notes, and then using commas to separate the values. (NOTE: Rests are given a melody value of 0).

Hardware Setup

Copy of Arduino RGB LED Piezo Music Sync.png
  1. Connect a slideswitch to J1-3 on the breadboard (Terminal 1>J1, Common>J2, Terminal 2>J3).
  2. Use a wire to connect G1 on breadboard to GND on Arduino to ground Terminal 1.
  3. Use a wire to connect I2 on breadboard to digital pin 2 on Arduino to digitalRead the common slideswitch terminal.
  4. Connect a 1k ohm resistor from F3 to D3 on the breadboard and use a wire to connect from A3 on the breadboard to 5V on the Arduino to provide power to the switch.
  5. Connect a piezo to J6 and J11 on the breadboard (positive to J6, negative to J11).
  6. Use a wire to connect F6 on the breadboard to digital pin 3 on the Arduino to send a tone function.
  7. Use a wire to connect F11 on the breadboard to GND on the Arduino to ground the piezo.
  8. Connect a common cathode RGB LED to J14-17 on the breadboard (Red>J14, Cathode>J15, Blue>J16, Green>J17).
  9. Connect a 1k ohm resistor from F14 to D14 on the breadboard and use a wire to connect from A14 on the breadboard to digital pin 11 on the Arduino to provide signal to the Red lead of the RGB LED.
  10. Use a wire to connect F15 on the breadboard to GND on the Arduino to ground the RGB LED.
  11. Connect a 1k ohm resistor from F16 to D16 on the breadboard and use a wire to connect from A16 on the breadboard to digital pin 9 on the Arduino to provide signal to the Blue lead of the RGB LED.
  12. Connect a 1k ohm resistor from F17 to D17 on the breadboard and use a wire to connect from A17 on the breadboard to digital pin 10 on the Arduino to provide signal to the Green lead of the RGB LED.

How to Play

In order for the player to play the puzzle, they will need to click the switch to hear the clue.

"Which two celebrity artists collaborate on this holiday mashup song in the film Pitch Perfect 2?"

Use the Tinkercad Circuits simulation below to test it out!

Link to Remix This Tinkercad Circuits Project: https://www.tinkercad.com/things/5eEoproeFVG