I was wondering if anyone could help me with the project i'm doing (newbie).
I am trying to make a notification to my phone when i press the doorbell. I am using Bluetooth Module (HC-05). If someone could provide me with the source code for it to SEND notification from my ARDUINO UNO to my PHONE VIA BLUETOOTH.
If needed to use App, i can use app inventor to get the notification, or someother way.
/*
Bluetooth Module Details:
JY-MCU Arduino Bluetooth Wireless Serial Port Module
Default password: 1234
Baud rate: 38400
Dimensions: 1.73 in x 0.63 in x 0.28 in (4.4 cm x 1.6 cm x 0.7 cm)
PINOUT
PIN DESCRIPTION
1 KEY
2 VCC
3 GND
4 TXD
5 RXD
Adruino Code:
*/
/***********************
* Bluetooth switch arduino
***********************/
int state = 0;
int DoorBell = 0; // Door Bell state
int incomingByte;
void setup() {
//set pin 12 to output mode
pinMode(12, OUTPUT);
pinMode(2, INPUT); // DoorBell input
Serial.begin(9600);
}
void loop() {
// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// depending on the incoming byte do the needful action
if (incomingByte == '1') {
digitalWrite(12, HIGH);
delay(500);
Serial.println("ON");
state=1;
}
else if (incomingByte =='2') {
digitalWrite(12, LOW);
delay(500);
Serial.println("OFF");
state = 0;
}
}
if(state)
Serial.println("ON");
else
Serial.println("OFF");
// read the state of the DoorBell value:
DoorBell = digitalRead(2);
if(DoorBell)
Serial.println("Door Bell Press");
else
Serial.println("DoorBell not Press");
delay(250);
}
Is not going to get you the help you need.
You can edit the subject of this thread and I suggest you do to something like.
"Newbie needs help bluetooth doorbell to mobie phone URGENT"
That way you will get the attention of bluetooth users and save a lot of others the time to see what you need but they can't help.
Bluetooth Module Details:
JY-MCU Arduino Bluetooth Wireless Serial Port Module
Default password: 1234
Baud rate: 38400
Dimensions: 1.73 in x 0.63 in x 0.28 in (4.4 cm x 1.6 cm x 0.7 cm)
PINOUT
PIN DESCRIPTION
1 KEY
2 VCC
3 GND
4 TXD
5 RXD
Adruino Code:
*/
/***********************
Bluetooth switch arduino
***********************/
int state = 0;
int DoorBell = 0; // Door Bell state
int incomingByte;
void setup() {
//set pin 12 to output mode
pinMode(12, OUTPUT);
pinMode(2, INPUT); // DoorBell input
Serial.begin(9600);
}
void loop() {
// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// depending on the incoming byte do the needful action
if (incomingByte == '1') {
digitalWrite(12, HIGH);
delay(500);
Serial.println("ON");
state=1;
}
else if (incomingByte =='2') {
digitalWrite(12, LOW);
delay(500);
Serial.println("OFF");
state = 0;
}
}
if(state)
Serial.println("ON");
else
Serial.println("OFF");
// read the state of the DoorBell value:
DoorBell = digitalRead(2);
if(DoorBell)
Serial.println("Door Bell Press");
else
Serial.println("DoorBell not Press");
delay(250);
}
Thank you very much, BillHo, Can i ask the " Serial.println("ON");" will appear where?
Is not going to get you the help you need.
You can edit the subject of this thread and I suggest you do to something like.
"Newbie needs help bluetooth doorbell to mobie phone URGENT"
That way you will get the attention of bluetooth users and save a lot of others the time to see what you need but they can't help.
Tom..Goodluck....
Thank you very much, TomGeorge, for your reply. I will.