SlideShare a Scribd company logo
1 of 10
Download to read offline
//SENDER // It is a helmet that contains a sensor for gases, vital signs in the body, GPS , and a
temperature that transmits data via Lora connecting to arduino nano.
//RECEIVER// arduino nano contains Lora to receive data from sender.
I'm having trouble locating. The location does not appear correctly
also the ID it does not appear correctly it should be W001 but it shown sometimes W262, W81
This is the code below for sender and receiver.
// SENDER
//lora
#include
#include
#define ss 10
#define rst 9
#define dio0 8
//hart
#include
SoftwareSerial a(6,7); //rx-tx
float BPM,SpO2;
//gps
#include "TinyGPS++.h"
#include "SoftwareSerial.h"
SoftwareSerial gpsSerial(2, 3); //arduino 2=GpsTX, 3=GpsRX
TinyGPSPlus gps; //This is the GPS object that will pretty much do all the grunt work
with the NMEA data
float Latitude = 01, Longitude = 01;
float Latitude1;
float Longitude1;
float Latitude2;
float Longitude2;
//temp
#include
#include
#define DHTPIN A4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
float temp;
float pro;
float O2;
byte sos;
int ID=1;
int SOS = A3;
byte localAddress = 0xBB;
byte destination = 0xFF;
int E = 0;
int o2 = A1;
int buzzer = 5;
int Vibrationpin = A0;
unsigned long send_delay = 0;
String saved_Latitude = "", saved_Longitude = "";
#include
void setup() {
Serial.begin(9600);
gpsSerial.begin(9600);
a.begin(115200);
delay(100);
Serial.println("BPM Sender");
pinMode(buzzer, OUTPUT);
pinMode(sos, INPUT_PULLUP);
Serial.println("LoRa Sender");
LoRa.setPins(ss, rst, dio0);
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1)
;
}
Serial.println("LoRa Initializing OK!");
dht.begin();
digitalWrite(buzzer, 1);
delay(250);
digitalWrite(buzzer, 0);
delay(250);
digitalWrite(buzzer, 1);
delay(250);
digitalWrite(buzzer, 0);
delay(250);
}
void loop() {
read_from_a();
temp = dht.readTemperature();
while (gpsSerial.available()) //While there are characters to come from the GPS
{
gps.encode(gpsSerial.read()); //This feeds the serial NMEA data into the library one char at a
time
}
if (gps.location.isUpdated()) //This will pretty much be fired all the time anyway but will at
least reduce it to only after a package of NMEA data comes in
{
//Get the latest info from the gps object which it derived from the data sent by the GPS unit
Latitude = gps.location.lat();
Longitude = gps.location.lng();
/*
Serial.print("Latitude: ");
Serial.print(Latitude);
Serial.print(" Longitude: ");
Serial.println(Longitude);
*/
write_to_memory_lat(String(Latitude, 6));
write_to_memory_lon(String(Longitude, 6));
} else {
//saved_Latitude = read_from_memory_lat();
//saved_Longitude=read_from_memory_lon();
Latitude = read_from_memory_lat();
Longitude = read_from_memory_lon();
Serial.print("saved_Latitude: ");
Serial.print(Latitude, 6);
Serial.print(" saved_Longitude: ");
Serial.println(Longitude, 6);
}
//////////////////////////////////////////////////////////////////////////
if (millis() - send_delay > 2000) {
// send packet
if (isnan(temp)) {
Serial.println(F("Failed to read from DHT sensor!"));
return;
}
//temp=33;
pro = 48;
int MQ=analogRead(A7);
MQ= map(MQ,0,900,100,0);
O2 =MQ;
if ((digitalRead(SOS) == LOW) && (E < 5)) {
E++; Serial.println("SOS.................!");
digitalWrite(buzzer, 1);
delay(200);
digitalWrite(buzzer, 0);
} else {
E = 0;
delay(1500);
{
sos = 0;
}
}
if (E >= 5) {
sos = 5;
digitalWrite(buzzer, 1);
delay(2000);
digitalWrite(buzzer, 0);
}
Serial.println("ID:W00" + String(ID));
Serial.println("E: " + String(E));
Serial.println("sos: " + String(sos));
Serial.println("O2: " + String(MQ));
Serial.print("temp:"); Serial.println(temp);
if (MQ < 60) {
digitalWrite(buzzer, 1);
delay(150);
digitalWrite(buzzer, 0);
}
float f_rounded = ((int)(Latitude * 10) / 10);
Latitude1 = 100 * (Latitude - f_rounded);
float f_rounded2 = ((int)(Latitude1 * 10) / 10);
Latitude2 = 100 * (Latitude1 - f_rounded2);
f_rounded = ((int)(Longitude * 10) / 10);
Longitude1 = 100 * (Longitude - f_rounded);
f_rounded2 = ((int)(Longitude1 * 10) / 10);
Longitude2 = 100 * (Longitude1 - f_rounded2);
// Serial.println(f_rounded);
// Serial.println(Longitude1);
// Serial.println(Longitude2);
String outgoing = String(Latitude,6) + String(Longitude,6) + String(Latitude1) +
String(Longitude1) + String(Latitude2) + String(Longitude2) + String(temp) + String(pro) +
String(O2) + String(sos)+ String(BPM)+ String(SpO2)+ String(ID);
LoRa.beginPacket();
LoRa.write(destination);
LoRa.write(localAddress);
LoRa.write(outgoing.length());
LoRa.write(Latitude);
LoRa.write(Longitude);
LoRa.write(Latitude1);
LoRa.write(Longitude1);
LoRa.write(Latitude2);
LoRa.write(Longitude2);
LoRa.write(temp);
LoRa.write(pro);
LoRa.write(O2);
LoRa.write(sos);
LoRa.write(BPM);
LoRa.write(SpO2);
LoRa.write(ID);
LoRa.endPacket();
send_delay = millis();
}
}
float read_from_memory_lat() {
float x,y,z;
x = EEPROM.read(1); x*=10;
x += EEPROM.read(2);
y = EEPROM.read(3); y*=10;
y += EEPROM.read(4); y*=10;
y += EEPROM.read(5);y*=10;
y += EEPROM.read(6);y*=10;
y += EEPROM.read(7);y*=10;
y += EEPROM.read(8);
y=y/1000000;
z=x+y;
return z;
}
float read_from_memory_lon() {
float x,y,z;
x = EEPROM.read(11); x*=10;
x += EEPROM.read(12);
y = EEPROM.read(13); y*=10;
y += EEPROM.read(14); y*=10;
y += EEPROM.read(15);y*=10;
y += EEPROM.read(16);y*=10;
y += EEPROM.read(17);y*=10;
y += EEPROM.read(18);
y=y/1000000;
z=x+y;
return z;
}
void write_to_memory_lat(String num) {
//xx,xxxxxx
EEPROM.write(1, (num[0] - '0'));
EEPROM.write(2, (num[1] - '0'));
EEPROM.write(3, (num[3] - '0'));
EEPROM.write(4, (num[4] - '0'));
EEPROM.write(5, (num[5] - '0'));
EEPROM.write(6, (num[6] - '0'));
EEPROM.write(7, (num[7] - '0'));
EEPROM.write(8, (num[8] - '0'));
}
void write_to_memory_lon(String num) {
//xx,xxxxxx
EEPROM.write(11, (num[0] - '0'));
EEPROM.write(12, (num[1] - '0'));
EEPROM.write(13, (num[3] - '0'));
EEPROM.write(14, (num[4] - '0'));
EEPROM.write(15, (num[5] - '0'));
EEPROM.write(16, (num[6] - '0'));
EEPROM.write(17, (num[7] - '0'));
EEPROM.write(18, (num[8] - '0'));
}
void read_from_a(){
if(a.available()>0){
String sss=a.readStringUntil('n');
int count=0;
String data="";
for(int i=0;i
#include
#define ss 10
#define rst 9
#define dio0 8
byte localAddress = 0xFF;
float recipient;
String incoming;
byte sender;
byte incomingLength;
float Latitude;
float Longitude;
float Latitude1;
float Longitude1;
float Latitude2;
float Longitude2;
float temp;
float pro;
float O2;
byte sos;
String ID;
float BPM;
float SpO2;
int buzzer = 2;
void setup() {
Serial.begin(9600);
Serial.println("LoRa Receiver");
pinMode(buzzer, OUTPUT);
//Blynk.begin(auth, ssid, pass);
LoRa.setPins(ss, rst, dio0);
// Blynk.virtualWrite(V0, "clr");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
digitalWrite(buzzer, 1); delay(200);
digitalWrite(buzzer, 0); delay(200);
digitalWrite(buzzer, 1); delay(200);
digitalWrite(buzzer, 0); delay(200);
}
void loop() {
int packetSize = LoRa.parsePacket();
if (packetSize == 0) return;
recipient = LoRa.read();
sender = LoRa.read();
incomingLength = LoRa.read();
Latitude = LoRa.read();
Longitude = LoRa.read();
Latitude1 = LoRa.read();
Longitude1 = LoRa.read();
Latitude2 = LoRa.read();
Longitude2 = LoRa.read();
temp = LoRa.read();
pro = LoRa.read();
O2 = LoRa.read();
sos = LoRa.read();
BPM = LoRa.read();
SpO2 = LoRa.read();
ID = LoRa.read();
incoming = String(Latitude) + String(Longitude) + String(Latitude1) + String(Longitude1) +
String(Latitude2) + String(Longitude2) + String(temp) + String(pro) + String(O2) + String(sos)+
String(BPM)+ String(SpO2)+String(ID);
Latitude = Latitude + Latitude1 / 100 + Latitude2 / 10000;
Longitude = Longitude + Longitude1 / 100 + Longitude2 / 10000;
Serial.println("********************************************");
Serial.print("https://www.google.com/maps/place/");// The SMS text you want to send
Serial.print(String(Latitude,6)); // The SMS text you want to send
Serial.print(",");// The SMS text you want to send
Serial.println(String(Longitude, 6)); // The SMS text you want to send
Serial.println("ID:W00" + String(ID));
Serial.println("temp: " + String(temp));
Serial.println("pro: " + String(pro));
Serial.println("O2: " + String(O2));
Serial.println("sos: " + String(sos));
Serial.println("BPM: " + String(BPM));
Serial.println("SpO2: " + String(SpO2));
if (sos == 5) {
Serial.println("Emergency"); digitalWrite(buzzer, 1); delay(550);
digitalWrite(buzzer, 1); delay(250);
digitalWrite(buzzer, 0); delay(550);
digitalWrite(buzzer, 1); delay(250);
digitalWrite(buzzer, 0); delay(550);
digitalWrite(buzzer, 1); delay(250);
digitalWrite(buzzer, 0); delay(550);
}
if (O2 < 60) {
Serial.println("O2 gas"); digitalWrite(buzzer, 1); delay(550);
digitalWrite(buzzer, 1); delay(250);
digitalWrite(buzzer, 0); delay(550);
digitalWrite(buzzer, 1); delay(250);
digitalWrite(buzzer, 0); delay(550);
digitalWrite(buzzer, 1); delay(250);
digitalWrite(buzzer, 0); delay(550);
}
}

More Related Content

Similar to SENDER It is a helmet that contains a sensor for gases, vital s.pdf

Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Prof Ansari
 
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdfalltiusind
 
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docxkatherncarlyle
 
Cs423 raw sockets_bw
Cs423 raw sockets_bwCs423 raw sockets_bw
Cs423 raw sockets_bwjktjpc
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual Vivek Kumar Sinha
 
How do I draw the Labview code for pneumatic cylinder(air pistion). .pdf
How do I draw the Labview code for pneumatic cylinder(air pistion). .pdfHow do I draw the Labview code for pneumatic cylinder(air pistion). .pdf
How do I draw the Labview code for pneumatic cylinder(air pistion). .pdffootstatus
 
Unit 6
Unit 6Unit 6
Unit 6siddr
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfSIGMATAX1
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you runSunilAcharya37
 
Geo distance search with my sql presentation
Geo distance search with my sql presentationGeo distance search with my sql presentation
Geo distance search with my sql presentationGSMboy
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxSANTIAGO PABLO ALBERTO
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321Teddy Hsiung
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docxAdamq0DJonese
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controllerSyed Ghufran Hassan
 

Similar to SENDER It is a helmet that contains a sensor for gases, vital s.pdf (20)

Aodv routing protocol code in ns2
Aodv routing protocol code in ns2Aodv routing protocol code in ns2
Aodv routing protocol code in ns2
 
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
#include IRremote.hint RECV_PIN = 19;const int timer = 600.docx
 
Cs423 raw sockets_bw
Cs423 raw sockets_bwCs423 raw sockets_bw
Cs423 raw sockets_bw
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual
 
How do I draw the Labview code for pneumatic cylinder(air pistion). .pdf
How do I draw the Labview code for pneumatic cylinder(air pistion). .pdfHow do I draw the Labview code for pneumatic cylinder(air pistion). .pdf
How do I draw the Labview code for pneumatic cylinder(air pistion). .pdf
 
Jamming attack in wireless network
Jamming attack in wireless networkJamming attack in wireless network
Jamming attack in wireless network
 
Npc13
Npc13Npc13
Npc13
 
Unit 6
Unit 6Unit 6
Unit 6
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdf
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you run
 
Sample document
Sample documentSample document
Sample document
 
Geo distance search with my sql presentation
Geo distance search with my sql presentationGeo distance search with my sql presentation
Geo distance search with my sql presentation
 
StewartPlatform_cpp
StewartPlatform_cppStewartPlatform_cpp
StewartPlatform_cpp
 
Gps c
Gps cGps c
Gps c
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
ExperiencesSharingOnEmbeddedSystemDevelopment_20160321
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
 
Npc14
Npc14Npc14
Npc14
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 

More from alertshoeshingkimand

Ships provide maritime transport services but emit polluting gases s.pdf
Ships provide maritime transport services but emit polluting gases s.pdfShips provide maritime transport services but emit polluting gases s.pdf
Ships provide maritime transport services but emit polluting gases s.pdfalertshoeshingkimand
 
Short essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdfShort essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdfalertshoeshingkimand
 
Share your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdfShare your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdfalertshoeshingkimand
 
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdfSeth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdfalertshoeshingkimand
 
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdfse�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdfalertshoeshingkimand
 
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdfSessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdfalertshoeshingkimand
 
Set residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdfSet residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdfalertshoeshingkimand
 
Service Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdfService Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdfalertshoeshingkimand
 
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdfsend SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdfalertshoeshingkimand
 
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdfSeptember 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdfalertshoeshingkimand
 
Self-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdfSelf-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdfalertshoeshingkimand
 
Select one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdfSelect one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdfalertshoeshingkimand
 
Select one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdfSelect one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdfalertshoeshingkimand
 
Select all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdfSelect all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdfalertshoeshingkimand
 
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdfSeleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdfalertshoeshingkimand
 
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdfSeleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdfalertshoeshingkimand
 
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdfSeleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdfalertshoeshingkimand
 
Security analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdfSecurity analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdfalertshoeshingkimand
 
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdfSe realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdfalertshoeshingkimand
 
Sean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdfSean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdfalertshoeshingkimand
 

More from alertshoeshingkimand (20)

Ships provide maritime transport services but emit polluting gases s.pdf
Ships provide maritime transport services but emit polluting gases s.pdfShips provide maritime transport services but emit polluting gases s.pdf
Ships provide maritime transport services but emit polluting gases s.pdf
 
Short essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdfShort essayThe next step in effective argumentation is the ability.pdf
Short essayThe next step in effective argumentation is the ability.pdf
 
Share your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdfShare your results from taking Organizational Culture Assessment Ins.pdf
Share your results from taking Organizational Culture Assessment Ins.pdf
 
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdfSeth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
Seth named his wife, Monique, who is age 57, as the sole beneficiary.pdf
 
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdfse�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
se�or. y se�ora Una vez que ambos tienen 62 a�os, presentan una decl.pdf
 
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdfSessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
Sessizlik, Damgalanma ve Akl Hastal Madeline Halpert ve Eva Rosenfel.pdf
 
Set residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdfSet residents strategy to always defect and invaders strategy to t.pdf
Set residents strategy to always defect and invaders strategy to t.pdf
 
Service Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdfService Values1. I build strong relationships and create Ritz-Carl.pdf
Service Values1. I build strong relationships and create Ritz-Carl.pdf
 
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdfsend SERIALWISE with headings In F2021, the charity trained 19,591.pdf
send SERIALWISE with headings In F2021, the charity trained 19,591.pdf
 
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdfSeptember 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
September 21, 2022Russia�s war against Ukraine is causing tremendo.pdf
 
Self-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdfSelf-awareness involves being aware of different aspects of the self.pdf
Self-awareness involves being aware of different aspects of the self.pdf
 
Select one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdfSelect one theory from the following categories Sociological Syste.pdf
Select one theory from the following categories Sociological Syste.pdf
 
Select one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdfSelect one of the scenarios below and address the following Describ.pdf
Select one of the scenarios below and address the following Describ.pdf
 
Select all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdfSelect all correct statements related to the contribution of scienti.pdf
Select all correct statements related to the contribution of scienti.pdf
 
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdfSeleccione todas las afirmaciones que se aplican al proceso de pre.pdf
Seleccione todas las afirmaciones que se aplican al proceso de pre.pdf
 
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdfSeleccione un tema de liderazgo relevante y de actualidad de los med.pdf
Seleccione un tema de liderazgo relevante y de actualidad de los med.pdf
 
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdfSeleccione el orden correcto para los siguientes eventos clave en la.pdf
Seleccione el orden correcto para los siguientes eventos clave en la.pdf
 
Security analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdfSecurity analysis Perform security analysis on your proposed ransom.pdf
Security analysis Perform security analysis on your proposed ransom.pdf
 
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdfSe realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
Se realiz� un estudio que muestra que el politetrafluoroetileno (PFO.pdf
 
Sean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdfSean Bedan a senior employee and was fired after he reported how a f.pdf
Sean Bedan a senior employee and was fired after he reported how a f.pdf
 

Recently uploaded

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 

SENDER It is a helmet that contains a sensor for gases, vital s.pdf

  • 1. //SENDER // It is a helmet that contains a sensor for gases, vital signs in the body, GPS , and a temperature that transmits data via Lora connecting to arduino nano. //RECEIVER// arduino nano contains Lora to receive data from sender. I'm having trouble locating. The location does not appear correctly also the ID it does not appear correctly it should be W001 but it shown sometimes W262, W81 This is the code below for sender and receiver. // SENDER //lora #include #include #define ss 10 #define rst 9 #define dio0 8 //hart #include SoftwareSerial a(6,7); //rx-tx float BPM,SpO2; //gps #include "TinyGPS++.h" #include "SoftwareSerial.h" SoftwareSerial gpsSerial(2, 3); //arduino 2=GpsTX, 3=GpsRX TinyGPSPlus gps; //This is the GPS object that will pretty much do all the grunt work with the NMEA data float Latitude = 01, Longitude = 01; float Latitude1; float Longitude1; float Latitude2; float Longitude2; //temp #include #include #define DHTPIN A4 #define DHTTYPE DHT11
  • 2. DHT dht(DHTPIN, DHTTYPE); float temp; float pro; float O2; byte sos; int ID=1; int SOS = A3; byte localAddress = 0xBB; byte destination = 0xFF; int E = 0; int o2 = A1; int buzzer = 5; int Vibrationpin = A0; unsigned long send_delay = 0; String saved_Latitude = "", saved_Longitude = ""; #include void setup() { Serial.begin(9600); gpsSerial.begin(9600); a.begin(115200); delay(100); Serial.println("BPM Sender"); pinMode(buzzer, OUTPUT); pinMode(sos, INPUT_PULLUP); Serial.println("LoRa Sender"); LoRa.setPins(ss, rst, dio0); if (!LoRa.begin(433E6)) { Serial.println("Starting LoRa failed!"); while (1) ; } Serial.println("LoRa Initializing OK!"); dht.begin(); digitalWrite(buzzer, 1);
  • 3. delay(250); digitalWrite(buzzer, 0); delay(250); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(250); } void loop() { read_from_a(); temp = dht.readTemperature(); while (gpsSerial.available()) //While there are characters to come from the GPS { gps.encode(gpsSerial.read()); //This feeds the serial NMEA data into the library one char at a time } if (gps.location.isUpdated()) //This will pretty much be fired all the time anyway but will at least reduce it to only after a package of NMEA data comes in { //Get the latest info from the gps object which it derived from the data sent by the GPS unit Latitude = gps.location.lat(); Longitude = gps.location.lng(); /* Serial.print("Latitude: "); Serial.print(Latitude); Serial.print(" Longitude: "); Serial.println(Longitude); */ write_to_memory_lat(String(Latitude, 6)); write_to_memory_lon(String(Longitude, 6)); } else { //saved_Latitude = read_from_memory_lat(); //saved_Longitude=read_from_memory_lon(); Latitude = read_from_memory_lat(); Longitude = read_from_memory_lon(); Serial.print("saved_Latitude: ");
  • 4. Serial.print(Latitude, 6); Serial.print(" saved_Longitude: "); Serial.println(Longitude, 6); } ////////////////////////////////////////////////////////////////////////// if (millis() - send_delay > 2000) { // send packet if (isnan(temp)) { Serial.println(F("Failed to read from DHT sensor!")); return; } //temp=33; pro = 48; int MQ=analogRead(A7); MQ= map(MQ,0,900,100,0); O2 =MQ; if ((digitalRead(SOS) == LOW) && (E < 5)) { E++; Serial.println("SOS.................!"); digitalWrite(buzzer, 1); delay(200); digitalWrite(buzzer, 0); } else { E = 0; delay(1500); { sos = 0; } } if (E >= 5) { sos = 5; digitalWrite(buzzer, 1); delay(2000); digitalWrite(buzzer, 0);
  • 5. } Serial.println("ID:W00" + String(ID)); Serial.println("E: " + String(E)); Serial.println("sos: " + String(sos)); Serial.println("O2: " + String(MQ)); Serial.print("temp:"); Serial.println(temp); if (MQ < 60) { digitalWrite(buzzer, 1); delay(150); digitalWrite(buzzer, 0); } float f_rounded = ((int)(Latitude * 10) / 10); Latitude1 = 100 * (Latitude - f_rounded); float f_rounded2 = ((int)(Latitude1 * 10) / 10); Latitude2 = 100 * (Latitude1 - f_rounded2); f_rounded = ((int)(Longitude * 10) / 10); Longitude1 = 100 * (Longitude - f_rounded); f_rounded2 = ((int)(Longitude1 * 10) / 10); Longitude2 = 100 * (Longitude1 - f_rounded2); // Serial.println(f_rounded); // Serial.println(Longitude1); // Serial.println(Longitude2); String outgoing = String(Latitude,6) + String(Longitude,6) + String(Latitude1) + String(Longitude1) + String(Latitude2) + String(Longitude2) + String(temp) + String(pro) + String(O2) + String(sos)+ String(BPM)+ String(SpO2)+ String(ID); LoRa.beginPacket(); LoRa.write(destination); LoRa.write(localAddress); LoRa.write(outgoing.length()); LoRa.write(Latitude); LoRa.write(Longitude); LoRa.write(Latitude1); LoRa.write(Longitude1);
  • 6. LoRa.write(Latitude2); LoRa.write(Longitude2); LoRa.write(temp); LoRa.write(pro); LoRa.write(O2); LoRa.write(sos); LoRa.write(BPM); LoRa.write(SpO2); LoRa.write(ID); LoRa.endPacket(); send_delay = millis(); } } float read_from_memory_lat() { float x,y,z; x = EEPROM.read(1); x*=10; x += EEPROM.read(2); y = EEPROM.read(3); y*=10; y += EEPROM.read(4); y*=10; y += EEPROM.read(5);y*=10; y += EEPROM.read(6);y*=10; y += EEPROM.read(7);y*=10; y += EEPROM.read(8); y=y/1000000; z=x+y; return z; } float read_from_memory_lon() { float x,y,z; x = EEPROM.read(11); x*=10; x += EEPROM.read(12); y = EEPROM.read(13); y*=10; y += EEPROM.read(14); y*=10; y += EEPROM.read(15);y*=10;
  • 7. y += EEPROM.read(16);y*=10; y += EEPROM.read(17);y*=10; y += EEPROM.read(18); y=y/1000000; z=x+y; return z; } void write_to_memory_lat(String num) { //xx,xxxxxx EEPROM.write(1, (num[0] - '0')); EEPROM.write(2, (num[1] - '0')); EEPROM.write(3, (num[3] - '0')); EEPROM.write(4, (num[4] - '0')); EEPROM.write(5, (num[5] - '0')); EEPROM.write(6, (num[6] - '0')); EEPROM.write(7, (num[7] - '0')); EEPROM.write(8, (num[8] - '0')); } void write_to_memory_lon(String num) { //xx,xxxxxx EEPROM.write(11, (num[0] - '0')); EEPROM.write(12, (num[1] - '0')); EEPROM.write(13, (num[3] - '0')); EEPROM.write(14, (num[4] - '0')); EEPROM.write(15, (num[5] - '0')); EEPROM.write(16, (num[6] - '0')); EEPROM.write(17, (num[7] - '0')); EEPROM.write(18, (num[8] - '0')); } void read_from_a(){ if(a.available()>0){ String sss=a.readStringUntil('n'); int count=0; String data=""; for(int i=0;i #include
  • 8. #define ss 10 #define rst 9 #define dio0 8 byte localAddress = 0xFF; float recipient; String incoming; byte sender; byte incomingLength; float Latitude; float Longitude; float Latitude1; float Longitude1; float Latitude2; float Longitude2; float temp; float pro; float O2; byte sos; String ID; float BPM; float SpO2; int buzzer = 2; void setup() { Serial.begin(9600); Serial.println("LoRa Receiver"); pinMode(buzzer, OUTPUT); //Blynk.begin(auth, ssid, pass); LoRa.setPins(ss, rst, dio0); // Blynk.virtualWrite(V0, "clr"); if (!LoRa.begin(433E6)) { Serial.println("Starting LoRa failed!"); while (1); } digitalWrite(buzzer, 1); delay(200); digitalWrite(buzzer, 0); delay(200);
  • 9. digitalWrite(buzzer, 1); delay(200); digitalWrite(buzzer, 0); delay(200); } void loop() { int packetSize = LoRa.parsePacket(); if (packetSize == 0) return; recipient = LoRa.read(); sender = LoRa.read(); incomingLength = LoRa.read(); Latitude = LoRa.read(); Longitude = LoRa.read(); Latitude1 = LoRa.read(); Longitude1 = LoRa.read(); Latitude2 = LoRa.read(); Longitude2 = LoRa.read(); temp = LoRa.read(); pro = LoRa.read(); O2 = LoRa.read(); sos = LoRa.read(); BPM = LoRa.read(); SpO2 = LoRa.read(); ID = LoRa.read(); incoming = String(Latitude) + String(Longitude) + String(Latitude1) + String(Longitude1) + String(Latitude2) + String(Longitude2) + String(temp) + String(pro) + String(O2) + String(sos)+ String(BPM)+ String(SpO2)+String(ID); Latitude = Latitude + Latitude1 / 100 + Latitude2 / 10000; Longitude = Longitude + Longitude1 / 100 + Longitude2 / 10000; Serial.println("********************************************"); Serial.print("https://www.google.com/maps/place/");// The SMS text you want to send Serial.print(String(Latitude,6)); // The SMS text you want to send Serial.print(",");// The SMS text you want to send Serial.println(String(Longitude, 6)); // The SMS text you want to send Serial.println("ID:W00" + String(ID)); Serial.println("temp: " + String(temp)); Serial.println("pro: " + String(pro)); Serial.println("O2: " + String(O2));
  • 10. Serial.println("sos: " + String(sos)); Serial.println("BPM: " + String(BPM)); Serial.println("SpO2: " + String(SpO2)); if (sos == 5) { Serial.println("Emergency"); digitalWrite(buzzer, 1); delay(550); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(550); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(550); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(550); } if (O2 < 60) { Serial.println("O2 gas"); digitalWrite(buzzer, 1); delay(550); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(550); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(550); digitalWrite(buzzer, 1); delay(250); digitalWrite(buzzer, 0); delay(550); } }