Hello!
To start, me and my groupmates decided to make a intruder alarm using a PIR sensor for our College project. We haven't started anything yet, as we want to confirm if our project can be possibly made.
So everything is based form a googled diagram and instructions:
(courtesy of circuitstoday.com)

and the arduino code:
#include<SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);
int sensor=7; //The output of PIR sensor connected to pin 7
int push_switch=6; // push button switch connected to pin 6
int buzzer=8; // buzzer connected at pin 8
int sensor_value; //variable to hold read sensor value
int sms_count=0;
void setup()
{
pinMode(sensor,INPUT); // configuring pin 7 as Input
pinMode(push_switch,INPUT); // configuring pin 6 as Input
pinMode(buzzer,OUTPUT); // configuring pin 8 as OUTPUT
mySerial.begin(9600);
}
void loop()
{
Check_Burglar();// subroutine to check sensor status and activation of outputs
Check_Reset(); // subroutine to check if alarm reset switch pressed or not
}
void Check_Burglar()
{
sensor_value=digitalRead(sensor); // Reading sensor value from pin 7
if(sensor_value==HIGH) // Checking if PIR sensor sends a HIGH signal to Arduino
{
digitalWrite(buzzer,HIGH); // Activating the buzzer
while(sms_count<3) //Number of SMS Alerts to be sent limited at 3
{
SendTextMessage(); // Function to send AT Commands to GSM module
}
}}
void Check_Reset()
{
if(digitalRead(push_switch==HIGH))// Checking if pushbutton was pressed
{
digitalWrite(buzzer,LOW); // turning OFF the buzzer
sms_count=0; // Reactivating the SMS Alert Facility
}}
void SendTextMessage()
{
mySerial.println("AT+CMGF=1"); //To send SMS in Text Mode
delay(1000);
mySerial.println("AT+CMGS=\"+919495xxxxxx\"\r"); // change to the phone number you using
delay(1000);
mySerial.println("Gas Leaking!");//the content of the message
delay(200);
mySerial.println((char)26);//the stopping character
delay(1000);
sms_count++;
}
Since our project requires a GUI we have made a rough sketch of what will it look like.

So my question is by using Windows form, will we be able to change some parts of the code of the arduino?
For examples:
1.) Clicking the on/off button will turn on/off the system.
2.) If we put the cellphone number in the cellphone number textbox. the "mySerial.println("AT+CMGS="+919495xxxxxx"\r")" of the code will change the number the where the arduino will send its alert.
3.) If you click Call button, instead of text it will call your phone number. Which changes the "void SendTextMessage()" code.
Will all that be possible in the Gui? If yes, give me some insights of how to make the code since we have a little knowledge in visual C. and If no, Do you have any suggestions to how can we make alternatives of the said functions of the GUI.
Thanks in advance ![]()
PS: Sorry for the bad english ![]()