Introduction: Setting Up the Circuit

Picture of Setting Up the Circuit

The following information is a single lesson in a larger project. Find more great projects here.

Return to Previous Lesson: Introduction

Lesson Overview:

Now we'll build our simple circuit!

Step 1: Connecting Power and Piezo

Picture of Connecting Power and Piezo

Start by wiring up your breadboard with power and ground as in the previous projects.

Wiring up the piezo is simple as well: connect one end of the piezo to ground and the other end to pin 8 on your Arduino.

  1. Connect the 5V and GND pins on the Arduino to the 5 volt and ground rails on the breadboard.
  2. Place the piezo buzzer in row E on the breadboard, near the right side. Connect one terminal to the ground rail and the other terminal to digital pin 8.
  3. Continue to the next step.
  4. Stuck? HINT: Remember, we are using the tone() function instead of PWM. So, we don't need to use a PWM digital pin with ~ mark for this project!

Step 2: Placing the Buttons

Picture of Placing the Buttons

Place your switches on the breadboard as shown in the circuit. This arrangement of resistors and buttons feeding into an analog input is called a resistor ladder. Each of the resistor-button combinations acts as a voltage divider.

  1. Place 4 buttons on the breadboard, across the center gap. You should leave 1 socket in between each button. After placing each button in the simulator, you can give them labels Button 1 - Button 4 using the drop down menu.
  2. Connect Button 1 (on the left) directly to the 5V rail through its left terminal.
  3. Connect the left terminals of the second, third and fourth switches to the 5V rail through resistors. You will use a 220-ohm, 10-kilohm and 1-megohm resistor, in that order.
  4. Connect all the buttons’ right terminals together with wires.
  5. Connect the right terminal of any button to analog pin A0. It might be easiest to make this connection from Button 1.
  6. Finally, connect the right terminal of any button to ground using a 10 k-ohm resistor. It might be easiest to do this with the last button (as shown in the picture)
  7. Continue to the next step to learn how to write the code for your Keyboard Instrument!

Next Lesson:Writing the Code


About This Instructable




More by circuits:IntroductionArduino Project 15: Hacking ButtonsArduino Project 14: Tweak the Arduino Logo
Add instructable to: