For our final project, we wanted to incorporate some of the skills we’ve learned in previous labs to create a unique and interactive device. Using pulse width modulation from Lab 4, we incorporated our AVR XMEGA-A3BU XPLAINED with a 4-input number pad, four 10K ohm resistors, a piezo buzzer and jumper wires to create a musical touch pad that plays different songs based on which button is pressed. After getting a general understanding of the keypad schematic, we connected the common connection to VCC on the J2 header of the A3BU. The other 4 buttons were connected to 4 of the ADC pins on the J2 header. We connected the piezo buzzer to the SDA and GND pins on the J1 header. After researching the frequency limits of our piezo buzzer, we were able to assign certain frequency values to specific pitches and program the A3BU to play 4 different songs: Twinkle Twinkle Little Star (button 1), Mary Had a Little Lab (button 2), Jingle Bells (button 3), and Ode to Joy (button 4).
General A3BU Setup