venoc
Created May 12, 2020 © LGPL

CDPSS(Covid Detecting and Protecting Security System)

This project made for two aim * DETECTING COVID * PROTECTING OTHERS

AdvancedFull instructions provided12 days65
CDPSS(Covid Detecting and Protecting Security System)

Things used in this project

Hardware components

Zuino XS PsyFi32
×1
Zio Qwiic Surface Temperature Infrared Sensor (MLX9061)
×1
Zio Qwiic OLED Display 128X32
×1
Qwiic connector X 2
×1
USB Cable Assembly, USB Type A Plug to Micro USB Type B Plug
USB Cable Assembly, USB Type A Plug to Micro USB Type B Plug
×1
ultra sonic sensor
×1
Arduino UNO
Arduino UNO
arduino nano is can also use
×1
jumber wire
×1
gsm module
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Custom parts and enclosures

MLX90614_Arduino_Library

unifed sensor driver library

SSD1306 library

Schematics

f8csn4vj0sed576_large_VEBwpNxgXs.jpg

13_BaJ8gJKQNH.jpg

12_bUV22rzujh.jpg

14_BlOmgX1ADj.jpg

Code

ultra sonic gsm code

C/C++
#include<SoftwareSerial.h>

#define trigPin 9

#define echoPin 10

#define piezoPin 8

SoftwareSerial mySerial(2, 3);

int normalDistance;

boolean triggered = false;

long duration, distance;

void setup()

{

mySerial.begin(9600);

Serial.begin (9600);

delay(100);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(piezoPin, OUTPUT);

digitalWrite(piezoPin, HIGH);

long duration, distance;

while (millis() < 5000)

{

digitalWrite(piezoPin, HIGH);

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

normalDistance = distance;

Serial.print("Distance: ");

Serial.println(distance);

digitalWrite(piezoPin, LOW);

} }

void loop()

{

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

Serial.print("Distance: ");

Serial.println(distance);

if (distance < normalDistance-5)

{

triggered = true;

}

else

{

triggered = false;

}

if (triggered)

{

tone(piezoPin, 635);

delay(500);

tone(piezoPin, 912);

delay(250);

mySerial.println("AT+CMGF=1");

//Sets the GSM Module in Text Mode

delay(1000);

// Delay of 1000 milli seconds or 1 second mySerial.println("AT+CMGS=\"+91xxxxxxxxx\"\r");

// Replace x with mobile number

delay(1000);

mySerial.println("I am SMS from GSM Module");

// The SMS text you want to send delay(100);

mySerial.println((char)26);

// ASCII code of CTRL+Z

delay(1000);

} }

temperature_sensor_code_wit_ blynk

C/C++
#include <Wire.h> // I2C 
#include <WiFi.h> 
#include <WiFiClient.h>
#include <SparkFunMLX90614.h> // SparkFunMLX90614 Arduino library
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <BlynkSimpleEsp32.h> 

const char* ssid     = "Your SSID";
const char* password = "password";
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "Auth Token";

IRTherm therm; // Create an IRTherm object to interact with throughout

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


#define BLYNK_PRINT Serial
BlynkTimer timer;// This function sends Arduino's up time every second to the Virtual Pins


void setup() 
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, password);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  therm.begin(); // Initialize thermal IR sensor
  therm.setUnit(TEMP_F); // Set the library's units to Farenheit
  // Alternatively, TEMP_F can be replaced with TEMP_C for Celsius orTEMP_K for Kelvin.
  timer.setInterval(1000L, sendSensor);
}

void loop() {
 // Call therm.read() to read object and ambient temperatures from the sensor.
  if (therm.read()) // On success, read() will return 1, on fail 0.
  {
    printTobject();
    printTobjecTval();
    unit1();
    printTambient();
    printTambienTval();
    unit2();
    delay(500);
  }
   display.display();
   Blynk.run();
   timer.run();
}
//Display data to OLED
void printTobject() 
{
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(5,0);
  display.println("Object: ");
}

void printTobjecTval() 
{
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(60,0);
  display.println(therm.object());
}

void unit1() 
{
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(100,0);
  display.println("F");
}

void printTambient() 
{
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(5,20);
  display.println("Ambient:");
}

void printTambienTval() 
{
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(60,20);
  display.println(therm.ambient());
}
void unit2() 
{
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(100,20);
  display.println("F");
}
//Display data to Blynk
void sendSensor()
{
  Blynk.virtualWrite(V0,therm.object());
  Blynk.virtualWrite(V1, therm.ambient());
  }

Credits

venoc

venoc

5 projects • 2 followers

Comments