Components and supplies
HC-05 Bluetooth Module
Arduino Nano R3
Breadboard (generic)
Buzzer
Jumper wires (generic)
Project description
Code
Paste the code in your arduino app.
arduino
1/*Bluetooth buzzer 2 * Created on 2 febraury,2021 3 * by zayed alam 4 5 * Hi guys, 6 * I am gonna show you how to control sounds using android app.It 7 is a very simple 8 * and fun project.This works like this:Go to the google play 9 store.Search for" 10 * Smart Bluetooth" and there will be a bluetooth logo.Install 11 it.Then turn on 12 * your bluetooth,Then click on "Search".After sometime after 13 searching,you will 14 * find "HC-05" and that is our bluetooth module.click on 15 it.Then it will ask to 16 * Select a theme by holding on the any of the two options.Then 17 after it has 18 * conected,on the top right corner,there will be a settings sign.Click 19 on it. 20 * Then a drop down box shows.Then click on terminal.Then if you type 21 'a',you 22 * will hear a sound by the buzzer.That means it is working.You will 23 figure 24 * something on my code like"if(data=='e'){"That means if you type 25 'e' key, 26 * it will create a sound from the buzzer.You can also edit the keys 27 or create 28 * a new condition like if we type this key,it will make this sound. 29 30 * 31 * That's all of that.For more stffs like schematics and what are the materials 32 33 * you have to gather,go to:https://create.arduino.cc/projecthub/zayedalam/control-sound-using-bluetooth-a670ee 34 35 */ 36 37char data = '5'; //Variable for storing received data 38const int buzzer=2;//Buzzers 39 pin 40 41void setup() { 42 // put your setup code here, to run once: 43 Serial.begin(9600); 44 //Sets the baud for serial data transmission 45 pinMode(buzzer,OUTPUT);//defining 46 the buzzer 47 48} 49 50void loop() { 51 // put your main 52 code here, to run repeatedly: 53 if(Serial.available() > 0) // Send data only 54 when you receive data: 55 { 56 data = Serial.read(); 57 58 if(data=='a'){//If 59 you will type 'a', 60 tone(buzzer,1000);//make a sound 61 delay(20); 62 63 noTone(buzzer); 64 65 } 66 if (data=='b'){//If you 67 will type 'b', 68 tone(buzzer,100);//Make a sound 69 delay(20); 70 71 noTone(buzzer); 72 } 73if(data=='c'){//if you will type c 74 tone(buzzer,90);//Make 75 a sound 76 delay(20); 77 noTone(buzzer); 78} 79if (data=='d'){ 80 tone(buzzer,345); 81 82 delay(20); 83 noTone(buzzer); 84} 85if(data=='e'){ 86 tone(buzzer,10); 87 88 delay(20); 89 noTone(buzzer); 90} 91 } 92} 93 94
Paste the code in your arduino app.
arduino
1/*Bluetooth buzzer 2 * Created on 2 febraury,2021 3 * by zayed alam 4 * Hi guys, 5 * I am gonna show you how to control sounds using android app.It is a very simple 6 * and fun project.This works like this:Go to the google play store.Search for" 7 * Smart Bluetooth" and there will be a bluetooth logo.Install it.Then turn on 8 * your bluetooth,Then click on "Search".After sometime after searching,you will 9 * find "HC-05" and that is our bluetooth module.click on it.Then it will ask to 10 * Select a theme by holding on the any of the two options.Then after it has 11 * conected,on the top right corner,there will be a settings sign.Click on it. 12 * Then a drop down box shows.Then click on terminal.Then if you type 'a',you 13 * will hear a sound by the buzzer.That means it is working.You will figure 14 * something on my code like"if(data=='e'){"That means if you type 'e' key, 15 * it will create a sound from the buzzer.You can also edit the keys or create 16 * a new condition like if we type this key,it will make this sound. 17 * 18 * That's all of that.For more stffs like schematics and what are the materials 19 * you have to gather,go to:https://create.arduino.cc/projecthub/zayedalam/control-sound-using-bluetooth-a670ee 20 */ 21 22char data = '5'; //Variable for storing received data 23const int buzzer=2;//Buzzers pin 24 25void setup() { 26 // put your setup code here, to run once: 27 Serial.begin(9600); //Sets the baud for serial data transmission 28 pinMode(buzzer,OUTPUT);//defining the buzzer 29 30} 31 32void loop() { 33 // put your main code here, to run repeatedly: 34 if(Serial.available() > 0) // Send data only when you receive data: 35 { 36 data = Serial.read(); 37 38 if(data=='a'){//If you will type 'a', 39 tone(buzzer,1000);//make a sound 40 delay(20); 41 noTone(buzzer); 42 43 } 44 if (data=='b'){//If you will type 'b', 45 tone(buzzer,100);//Make a sound 46 delay(20); 47 noTone(buzzer); 48 } 49if(data=='c'){//if you will type c 50 tone(buzzer,90);//Make a sound 51 delay(20); 52 noTone(buzzer); 53} 54if (data=='d'){ 55 tone(buzzer,345); 56 delay(20); 57 noTone(buzzer); 58} 59if(data=='e'){ 60 tone(buzzer,10); 61 delay(20); 62 noTone(buzzer); 63} 64 } 65} 66 67
Downloadable files
Here is the schematics(I didnt use fritzing so you have to down load it sorry)
Here is the schematics(I didnt use fritzing so you have to down load it sorry)
Comments
Only logged in users can leave comments
zayedalam
1 Followers
•6 Projects
0
0