this week aimed to do two output component and controlled by mobile application.. so I made A buzzer with Motor if you push on A buzzer ring tone like car horn if 1 motor will rotate...I was very interested with this project because it is facilitate lots of things in our life you can control with any thing motor, lamb, lcd any thing you want to control you can do this...
software:
Arduino
Arduino bluecontrol
components:
buzzer
Arduino uno
dc motor
H-bridge
bluetooth module
jumbers
adapter 9V
first step I searched about two out put and didn't find suitable wiring.. I wanted to do a wheel chair in graduation project this wheel can controlled by mobile application such you push on button the wheel starting to go.. you can also push on button to give ring for people to take care like car horn ..
so first step i get wiring of motor from data of week 6 and wired motor on 9,8,7 pens of Arduino board and wire a buzzer with this on 4 pen of Arduino board and get bluetooth module and wired it on 0,1 pens of Arduino board
I set the code on Arduino and upload to Arduino and controlled from app..
firstly I defined the buzzer is on pen 4 and enable pen of motor 9 and transSpeed 9600 off 0 on 1 and appdata=0
and begin in void set up and defined pens as it is output so in void loop tell to arduino if appdata >0 go to the input and read... if appdata =A OR a set the buzzer on if appdata=B or b set the buzzer off,, if appdata=1 set the motor on,, if appdata=2 set the motor off..
then I go to cheek wiring so it's wired as:
1- H-bridge first output connect to the motor and enable to pen9 and inputs 7,8 it has 2 power 1=5V for IC to open and 2=9v for motor and ground
2-buzzer on pen 4
3- Bluetooth module 4 pens 1=5v,2=GRD ,, TXD,RXD=0,1
to control with system from mobile application first you must open Bluetooth from mobile settings and connect with HC-05
And open application and connect with module HC-05 and go setting of app and from command buttons configuration configure data to send and set Button A as A, Button B as B,, Button C as c... Button D AS 1.... Button E as 2...Button F as 3
then upload the code on Arduino board and controlled
the code :
//pin 9 and 6 target, to use the pwm signal
#define Bazzer 4
#define MOTOR 9
#define TransSpeed 9600
#define OFF 0
#define ON 1
char AppData = 0;
void setup()
{
Serial.begin(TransSpeed);
pinMode(Bazzer, OUTPUT);
pinMode(MOTOR, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
}
void loop()
{
if(Serial.available() > 0)
{
AppData = Serial.read();
Serial.print(AppData);
Serial.print("\n");
if (AppData == 'A' || AppData == 'a')
digitalWrite(Bazzer, ON);
if (AppData == 'B' || AppData == 'b')
digitalWrite(Bazzer, OFF);
if (AppData == '1')
{
analogWrite(MOTOR,180);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
}
if (AppData == '2')
{
analogWrite(MOTOR,0);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
}
}
}
wiring on tinker cad :
put the enable pen on 9 and input on 7,8 and put the wires of motors on outputs on pens above of IC and wire power 1 to 5V Arduino and power 2 to 9V of battery
the puzzer set on pen 4 and ground
I forget my kit in lab so borrowed the components from my friend..
when I got lost of connection wiring so make this on sara's lab so we can't complete the wiring also and program closed...
I was very interested with this project because it is facilitate lots of things in our life you can control with any thing motor, lamb, lcd any thing you want to control you can do this...
firstly I connected H-bridge with 9 volt only then H-bridge still closed so when wire 5V port with Arduino so it open exactly .
I wanted to make a simulation on fritzing but I can't download it my lab top couldn't Bear so I did wiring on tinker cad
Title of Media
Title of Media
this week help me to how I'll use bluetooth module to control on my project
Title of Media
Title of Media
https://drive.google.com/file/d/1l-4-7ZJtfHo-jZ15PihRFHtwxE9WrSCY/view?usp=sharing