Unit 7: Programming (Electronic Music)

Lesson 1: What is Electrical Engineering?U07_L01_03-H1-Circuit_Diagram

Circuit Background:

You can build an electronic system to play simple melodies using these components:

  • Arduino microcontroller
  • Breadboard and wires
  • 10kΩpotentiometer
  • Piezoelectric speaker
  • USB cable (standard A to B)
  • Computer with USB port and Arduino-compatible software

Below are brief descriptions of some of the more common electrical components and symbols found in electrical diagrams, or schematics.

Component / Description / Symbol
/ Piezoelectric Buzzer:
These buzzers use a special crystal that expands and contracts to create sound. /
/ Potentiometer:
A variable resistor that resists the flow of electricity, and prevent too much current from flowing to the speaker. This will serve as a volume knob. /
/ Breadboard:
A breadboard is used to make electrical connections between sockets or pins. It makes constructing circuits simple. /
/ Jumper Wires:
Wires are used to make electrical connections. / Connected (dot = “node”)
Not Connected

or

Below is an example of a speaker system that is depicted in a schematic.This diagram shows one way to connect differentcomponentstogetherwith wires to make sounds.Note that the speaker may or may not havepolarity; or in other words, it may have a positive and a negative pin. If your speaker is labeled with a positive and/or negative mark, make sure to place it in the correct orientation in the circuit. Also the USB cable connects to a computer, not shown in this diagram.

Building the circuit:

Using the given components, your team can start building the physical circuit that is represented by the electrical schematic above. For every physical connection that is made between two components (e.g. pin 12 of the Arduino to a potentiometer via the breadboard), highlight the corresponding connection depicted in the schematic.

If you build your circuit correctly, you should make a closed circuit, which is necessary for electricity to make its way through every component.

Recommended Steps:

Step 1:Place speaker on the breadboard, and connect the rows across the ditch with wires from a wire kit. After this is done, push speaker against the bread board so that its pins are firmly in the sockets.

Step 2: Connect the potentiometer to the speaker. Notice that the potentiometer has three leads, but we will only have to connect two leads. One lead will not be connected to anything.

  • Per the schematic, one of the outer leads of the potentiometer will be connected to one side of the speaker.
  • The middlelead of the potentiometer will eventually connect to pin 12 of the Arduino.
  • See the schematic and the close-up photo on the next page for an example layout. Make sure the leads are place firmly in the sockets by pressing down on the component.

Step 3: Connect the Arduino Microcontroller to the breadboard. Per the schematic, notice that

  • The center lead of the potentiometer is connected to pin 12 on the Arduino. Make this connection between the microcontroller and the breadboard using a jumper wire.
  • The other side of the speaker needs to be connected to a GND pin on the Arduino. Also make this connection between the microcontroller and the breadboard using a jumper wire.

Final Circuit:

After it is built, it may look something like this photo. Note that connections exist underneath the speaker; the size of the speaker makes those connections difficult to photograph. Note theArduino connects to a computer via a USB cable, which is not shown here.

To verify your circuit, continue to the next lesson and program your system to beep.Remember that the potentiometer will serve as a volume knob.

How does it work?

To help explain what this system does, a simple functional model of the system is shown below, not including the computer.

The USB port receives 5V of power from the computer.It also both receives and sends electrical signals between the Arduino system and the computer.

The Arduino microcontroller then transmits this electrical energy in pulses to the resistor, through wires and the breadboard.

The resistor resists flow of electrons.It converts some of the electrical energy to heat, which is released into the air.This decreases the voltage of energy flowing into the piezoelectric speaker.That helps protect the speaker, and it also will decrease the speaker volume.

The speaker converts the remaining electrical energy to mechanical energy.As the electrons flow through the piezoelectric material in pulses, the speaker expands and contracts in pulses, too.This also makes the air around it expand and contract in waves.Our ears hear these waves as sound.

The remaining electrical energy is essentially used up after going through the speaker.The electrons flow back to the Arduino and back into the computer.

Reference: “Getting Started with Arduino”.Arduino SA. 2014.

Copyright 2016-17, The Board of Regents of the University of Texas System. All Rights Reserved.

Requests to reproduce any part of this material may be made to Engineer Your World. Page 1 of 7