top of page
IMG_20170503_173438.jpg

Post

How to build a sound effect maker with an Arduino board - STEM electronics activity



Introduction


Hello makers!! Welcome back to our website! For newcomers: this is Makersgeneration - Your first choice for Technology activities for kids.


As usual, we bring you another exciting topic today. We will learn how to make a sound effect generator using Arduino, a buzzer, and a few other components you can find in your electronic kit for home. At the end of this tutorial, you should be able to learn how to make a homemade speaker. Feeling eager to get started like I am? keep reading!!


Before we dive straight in, let's look at the workings of this project:



How the sound generator works:


This simple project uses an Arduino board to generate sound of different frequencies which will be played out through the buzzer. It will also consist of a potentiometer which is used to vary the different sound frequencies playing at a time: so you have a variety of sounds to play with.


This project uses the tone() function built into the Arduino IDE to handle the sound generation in the code, thereby keeping our code simple but functional.



Requirements


  • Arduino Nano or Uno

  • Compatible USB cable

  • Breadboard

  • Buzzer

  • 5 Male-Male jumper wires




Building the circuit

Arduino

Potentiometer

Buzzer

5V pin

Last pin


GND pin

First pin

(—) pin

Analog (A0) pin

Middle pin


Pin (D8)


(+) pin


Circuit diagram.



Actual circuit.



Code



const int buzzerPin = 8;
const int potPin = A0;  // pin that the sensor is attached to

void setup() {
  Serial.begin(9600);
  pinMode(buzzerPin, OUTPUT);

}

void loop() {
  // read the sensor:
  unsigned int potValue = analogRead(sensorPin);

  // apply the calibration to the sensor reading
  potValue = map(potValue, 0, 1023, 100, 2000);

  tone(buzzerPin, potValue);

  Serial.println(potValue);

  delay(200);
}


Video demo



Enjoy your music!!




Congratulations!! you made it to the end.


If you enjoyed working on this project and you'd like to see more fun science projects for third graders, check below for our offering:



Online after-school focused on STEM


You and your children are looking for nice activities to have fun and learn new things and skills. Come join us for online classes such as:


  • Python coding for kids and teens

  • Coding for elementary school students

  • Make video games

  • Electronics

  • Digital modeling (Create cars, rockets, rings, etc) for 3D printing and much more with the following link: Online after-schools 



Other cute things to make and hand-crafts for kids (tutorials)



If you are looking for more cool Arduino and STEM project ideas to do with your kids, take a look at these other activities:




Newsletter, follow, subscribe, and like the social media


If you like online STEM activities, consider subscribing to the newsletter and social media for updates, and don't miss any STEM events. Don't forget to subscribe to the newsletter at the bottom of our website ''www.makersgeneration.net'' for more events, tutorials, and freebies.



Subscribe to the Facebook group if you have yet registered. Content and tutorials are shared daily: Create and build STEM projects for kids 



We can be reached at: contact@makersgeneration.net if any questions.



See you very soon.

Comments