Intro + Supplies for Buzzer Soundboard
by wadew in Circuits > Arduino
151 Views, 0 Favorites, 0 Comments
Intro + Supplies for Buzzer Soundboard
This project you will be able to use a remote to make different sounds from the buzzer
download Arduino from:
Supplies
Supplies include:
Arduino Uno X1 Breadboard X1 Buzzer X1 IR sensor X1 Remote X1 Quick connect wires X9
Setting Up the Remote With IR Sensor
first your gonna have top set up and test your remote with a little code that I got for toptechboy.com and dont forget to download the IR sensor library from Arduino
https://toptechboy.com/arduino-tutorial-64-underst...
code sample:
#include //Make sure to install the library
int IRpin=9; IRrecv IR(IRpin); decode_results cmd; String myCom; void setup() { Serial.begin(9600); IR.enableIRIn(); }
void loop() { while (IR.decode(&cmd)==0){ } Serial.println(cmd.value,HEX); delay(1500); IR.resume();
if (cmd.value==0xFF6897){ myCom="zero"; Serial.println(myCom); } if (cmd.value==0xFFA25D){ myCom="pwr"; Serial.println(myCom); }
}
Tinkercad
before going to hard wiring test it in Tnkercad to test out the bugs or even add or remove code
The Code for Tinkercad:
#include
const int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int buzzer1=2;
void setup(){
Serial.begin(9600);
irrecv.enableIRIn();
irrecv.blink13(true);
pinMode(buzzer1,OUTPUT);
}
void loop(){ if (irrecv.decode(&results)){
Serial.println(results.value, 0);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16593103)
{
digitalWrite(buzzer1,HIGH);
delay(0);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 100);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16582903)
{
digitalWrite(buzzer1,HIGH);
delay(100);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 200);
irrecv.resume();
Serial.println(results.value);
} if (results.value==16615543)
{
digitalWrite(buzzer1,HIGH);
delay(200);
digitalWrite(buzzer1,LOW); delay(100);
} if (irrecv.decode(&results)){
Serial.println(results.value, 300);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16599223)
{
digitalWrite(buzzer1,HIGH);
delay(300);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 400);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16591063)
{
digitalWrite(buzzer1,HIGH);
delay(400);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 500);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16623703)
{
digitalWrite(buzzer1,HIGH);
delay(500);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 600);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16607383)
{
digitalWrite(buzzer1,HIGH);
delay(600);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 700);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16586983)
{
digitalWrite(buzzer1,HIGH);
delay(700);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 800);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16619623)
{
digitalWrite(buzzer1,HIGH);
delay(800);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 900);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16603303)
{
digitalWrite(buzzer1,HIGH);
delay(900);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 400);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16597183)
{
digitalWrite(buzzer1,HIGH); digitalWrite(buzzer1,LOW); } if (irrecv.decode(&results)){
Serial.println(results.value, 0);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16609423)
{
digitalWrite(buzzer1,HIGH); digitalWrite(buzzer1,LOW); delay(200); digitalWrite(buzzer1,HIGH); delay(100); digitalWrite(buzzer1,LOW); } if (irrecv.decode(&results)){
Serial.println(results.value, 1000);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16625743)
{
digitalWrite(buzzer1,HIGH);
delay(0);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(100);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(200);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(300);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(400);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(500);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(600);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(700);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(800);
digitalWrite(buzzer1,LOW);
delay(100); digitalWrite(buzzer1,HIGH);
delay(900);
digitalWrite(buzzer1,LOW);
delay(100); } if (irrecv.decode(&results)){
Serial.println(results.value, 400);
irrecv.resume();
Serial.println(results.value);
}
if (results.value==16621663)
{
digitalWrite(buzzer1,LOW);
}
}
Hard Wiring
hard wiring is latterly just taking the Tinkercad wiring and making not artificial.
use the picture above to show you how to wire it
Code for Arduino
#include
const int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
int buzzer1 = 2;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
irrecv.blink13(true);
pinMode(buzzer1, OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, 0);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF6897)
{
digitalWrite(buzzer1, HIGH);
delay(0);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 100);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF30CF)
{
digitalWrite(buzzer1, HIGH);
delay(100);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 200);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF18E7)
{
digitalWrite(buzzer1, HIGH);
delay(200);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 300);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF7A85)
{
digitalWrite(buzzer1, HIGH);
delay(300);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 400);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF10EF)
{
digitalWrite(buzzer1, HIGH);
delay(400);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 500);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF38C7)
{
digitalWrite(buzzer1, HIGH);
delay(500);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 600);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF5AA5)
{
digitalWrite(buzzer1, HIGH);
delay(600);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 700);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF42BD)
{
digitalWrite(buzzer1, HIGH);
delay(700);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 800);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF4AB5)
{
digitalWrite(buzzer1, HIGH);
delay(800);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 900);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFF52AD)
{
digitalWrite(buzzer1, HIGH);
delay(900);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 400);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFFA25D)
{
digitalWrite(buzzer1, HIGH);
digitalWrite(buzzer1, LOW);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 0);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFFB04F)
{
digitalWrite(buzzer1, HIGH);
digitalWrite(buzzer1, LOW);
delay(200);
digitalWrite(buzzer1, HIGH);
delay(100);
digitalWrite(buzzer1, LOW);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 1000);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFFE01F)
{
digitalWrite(buzzer1, HIGH);
delay(0);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(100);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(200);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(300);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(400);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(500);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(600);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(700);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(800);
digitalWrite(buzzer1, LOW);
delay(100);
digitalWrite(buzzer1, HIGH);
delay(900);
digitalWrite(buzzer1, LOW);
delay(100);
}
if (irrecv.decode(&results)) {
Serial.println(results.value, 400);
irrecv.resume();
Serial.println(results.value);
}
if (results.value == 0XFFA857)
{
digitalWrite(buzzer1, LOW);
}
}
The End
this what your Finally project should look and sound.