-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a179774
Showing
52 changed files
with
18,018 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+149 KB
22AIE114_Project_Group_A12/22AIE114_Project_Photos_A12/blockdiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.3 KB
22AIE114_Project_Group_A12/22AIE114_Project_Photos_A12/public_channel_image1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.1 KB
22AIE114_Project_Group_A12/22AIE114_Project_Photos_A12/public_channel_image2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.5 KB
22AIE114_Project_Group_A12/22AIE114_Project_Photos_A12/telegram_bot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.2 KB
22AIE114_Project_Group_A12/22AIE114_Project_Poster_A12/22AIE114_Project_Poster1_A12.docx
Binary file not shown.
Binary file added
BIN
+124 KB
22AIE114_Project_Group_A12/22AIE114_Project_Poster_A12/22AIE114_Project_Poster2_A12.docx
Binary file not shown.
Binary file added
BIN
+21 MB
22AIE114_Project_Group_A12/22AIE114_Project_Poster_A12/22AIE114_Project_Poster3_A12.docx
Binary file not shown.
Binary file added
BIN
+90.5 KB
22AIE114_Project_Group_A12/22AIE114_Project_Poster_A12/22AIE114_Project_Poster4_A12.docx
Binary file not shown.
Binary file not shown.
76 changes: 76 additions & 0 deletions
76
...Project_Group_A12/22AIE114_Project_codes_A12/Arduino/Arduino and sensors/sketch_aug7b.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#include <Servo.h> | ||
|
||
#define SERVO_PIN 9 | ||
#define TRIG_PIN 2 | ||
#define ECHO_PIN 3 | ||
#define GAS_SENSOR_PIN A0 // Analog input pin for the MQ2 gas sensor | ||
#define LM35_SENSOR_PIN A1 // Analog input pin for the LM35 temperature sensor | ||
|
||
Servo servo; | ||
|
||
void setup() { | ||
pinMode(TRIG_PIN, OUTPUT); | ||
pinMode(ECHO_PIN, INPUT); | ||
pinMode(GAS_SENSOR_PIN, INPUT); // Set the gas sensor pin as input | ||
pinMode(LM35_SENSOR_PIN, INPUT); // Set the LM35 temperature sensor pin as input | ||
servo.attach(SERVO_PIN); | ||
Serial.begin(9600); // Initialize the serial communication | ||
} | ||
|
||
void loop() { | ||
// Call the function to continuously rotate the servo motor | ||
rotateServo(); | ||
|
||
// Call the function to measure and display the distance on the serial plotter | ||
measureDistanceAndPlot(); | ||
|
||
// Call the function to measure and display the gas sensor reading on the serial plotter | ||
measureGasSensorAndPlot(); | ||
|
||
// Call the function to measure and display the LM35 temperature sensor reading on the serial plotter | ||
measureTemperatureAndPlot(); | ||
} | ||
|
||
void rotateServo() { | ||
for (int angle = 0; angle <= 45; angle++) { | ||
servo.write(angle); | ||
delay(30); // Adjust the speed of rotation if needed | ||
} | ||
for (int angle = 45; angle >= 0; angle--) { | ||
servo.write(angle); | ||
delay(30); // Adjust the speed of rotation if needed | ||
} | ||
} | ||
|
||
void measureDistanceAndPlot() { | ||
digitalWrite(TRIG_PIN, LOW); | ||
delayMicroseconds(2); | ||
digitalWrite(TRIG_PIN, HIGH); | ||
delayMicroseconds(10); | ||
digitalWrite(TRIG_PIN, LOW); | ||
|
||
long duration = pulseIn(ECHO_PIN, HIGH); | ||
int distance = duration * 0.034 / 2; // Convert the duration to centimeters (Speed of sound in air is approximately 34 cm/ms) | ||
|
||
Serial.print("Distance: "); | ||
Serial.print(distance); // Send the distance value to the serial plotter | ||
Serial.print(" cm \t"); | ||
} | ||
|
||
void measureGasSensorAndPlot() { | ||
int gasSensorValue = analogRead(GAS_SENSOR_PIN); // Read the analog value from the gas sensor | ||
|
||
Serial.print("Gas Sensor Value: "); | ||
Serial.print(gasSensorValue); // Send the gas sensor value to the serial plotter | ||
Serial.print("\t"); | ||
} | ||
|
||
void measureTemperatureAndPlot() { | ||
int lm35SensorValue = analogRead(LM35_SENSOR_PIN); // Read the analog value from the LM35 temperature sensor | ||
float voltage = lm35SensorValue * (5.0 / 1023.0); // Convert the analog value to voltage | ||
float temperatureC = (voltage - 0.5) * 100.0; // Calculate temperature in Celsius | ||
|
||
Serial.print("Temperature: "); | ||
Serial.print(temperatureC); // Send the temperature value to the serial plotter | ||
Serial.println(" °C"); | ||
} |
69 changes: 69 additions & 0 deletions
69
22AIE114_Project_Group_A12/22AIE114_Project_codes_A12/Arduino/Wifi_ESP32cam/sketch_aug9b.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include <Wire.h> | ||
#include <SoftwareSerial.h> | ||
#include <ArduinoJson.h> | ||
#include <ESP8266WiFi.h> | ||
#include <WiFiClientSecure.h> | ||
#include <UniversalTelegramBot.h> | ||
// D6 = Rx & D5 = Tx | ||
SoftwareSerial nodemcu(D6, D5); | ||
//intiliazing wifi module to send the telegrm messages | ||
const char* ssid = "Avishek"; // Enter your WIFI SSID | ||
const char* password = "eeeproject"; // Enter your WIFI Password | ||
#define BOTtoken "6598907365:AAHzMOd_MuAUUKnAHqd9JSt8djXO8mOuMw4" // Enter the bottoken you got from botfather | ||
#define CHAT_ID "211246197" // Enter your chatID you got from chatid bot | ||
X509List cert(TELEGRAM_CERTIFICATE_ROOT); | ||
WiFiClientSecure client; | ||
UniversalTelegramBot bot(BOTtoken, client); | ||
//end of telegram messsnage intialization | ||
void setup() { | ||
// Initialize Serial port | ||
Serial.begin(9600); | ||
nodemcu.begin(9600); | ||
//intialize lcd port | ||
while (!Serial) continue; | ||
// Serial.begin(115200); | ||
configTime(0, 0, "pool.ntp.org"); | ||
client.setTrustAnchors(&cert); | ||
|
||
WiFi.mode(WIFI_STA); | ||
WiFi.begin(ssid, password); | ||
int a = 0; | ||
while (WiFi.status() != WL_CONNECTED) { | ||
Serial.print("."); | ||
delay(500); | ||
a++; | ||
} | ||
Serial.println(""); | ||
Serial.println("WiFi connected"); | ||
Serial.print("IP address: "); | ||
Serial.println(WiFi.localIP()); | ||
bot.sendMessage(CHAT_ID, "Wifi Connected!", ""); | ||
bot.sendMessage(CHAT_ID, "System has Started!!", ""); | ||
} | ||
void loop() { | ||
StaticJsonDocument<1000> jsonBuffer; | ||
DeserializationError error = deserializeJson(jsonBuffer, nodemcu); | ||
if (error) { | ||
Serial.println("Error parsing JSON"); | ||
jsonBuffer.clear(); | ||
return; | ||
} | ||
// Check if the received data is an object | ||
if (!jsonBuffer.is<JsonObject>()) { | ||
Serial.println("Invalid JSON Object"); | ||
jsonBuffer.clear(); | ||
return; | ||
} | ||
JsonObject data = jsonBuffer.as<JsonObject>(); | ||
Serial.println("-----------------------------------------"); | ||
//jsonBuffer.clear(); | ||
Serial.println("Json object Recieved.."); | ||
float distance=data["distance"]; | ||
String a =String (distance); | ||
Serial.print("Recieved Status :"); | ||
Serial.println("fire"); | ||
Serial.print("Direction ::"); | ||
Serial.print("status"); | ||
bot.sendMessage(CHAT_ID,a ,""); | ||
jsonBuffer.clear(); | ||
} |
99 changes: 99 additions & 0 deletions
99
22AIE114_Project_Group_A12/22AIE114_Project_codes_A12/Arduino/Wifi_ESP32cam/sketch_aug9c.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#include <Servo.h> | ||
#include <ArduinoJson.h> | ||
|
||
Servo myservo; | ||
|
||
#define SERVO_PIN 11 | ||
#define TRIG_PIN 2 | ||
#define ECHO_PIN 3 | ||
#define GAS_SENSOR_PIN A0 // Analog input pin for the MQ2 gas sensor | ||
#define LM35_SENSOR_PIN A1 // Analog input pin for the LM35 temperature sensor | ||
|
||
int pos = 0; | ||
boolean fire = false; | ||
int sign = 0; | ||
|
||
void setup() { | ||
pinMode(TRIG_PIN, OUTPUT); | ||
pinMode(ECHO_PIN, INPUT); | ||
pinMode(GAS_SENSOR_PIN, INPUT); | ||
pinMode(LM35_SENSOR_PIN, INPUT); | ||
servo.attach(SERVO_PIN); | ||
Serial.begin(9600); // Initialize the serial communication with the PC | ||
Serial1.begin(9600); // Initialize the serial communication with ESP8266 | ||
delay(1000); | ||
Serial.println("Program started"); | ||
} | ||
|
||
void loop() { | ||
// Call the function to continuously rotate the servo motor | ||
rotateServo(); | ||
|
||
// Read sensor data | ||
int distance = measureDistance(); | ||
int gasSensorValue = analogRead(GAS_SENSOR_PIN); | ||
float temperatureC = measureTemperature(); | ||
|
||
// Send sensor data to ESP8266 | ||
transferData(distance, gasSensorValue, temperatureC); | ||
|
||
// Call the function to measure and display the distance on the serial plotter | ||
measureDistanceAndPlot(); | ||
|
||
// Call the function to measure and display the gas sensor reading on the serial plotter | ||
measureGasSensorAndPlot(); | ||
|
||
// Call the function to measure and display the LM35 temperature sensor reading on the serial plotter | ||
measureTemperatureAndPlot(); | ||
|
||
delay(1000); // Adjust delay as needed | ||
} | ||
|
||
void rotateServo() { | ||
for (int angle = 0; angle <= 90; angle++) { | ||
myservo.write(angle); | ||
delay(15); // Adjust the speed of rotation if needed | ||
} | ||
for (int angle = 90; angle >= 0; angle--) { | ||
myservo.write(angle); | ||
delay(15); // Adjust the speed of rotation if needed | ||
} | ||
} | ||
|
||
int measureDistance() { | ||
// Measure and return distance | ||
// ... | ||
digitalWrite(TRIG_PIN, LOW); | ||
delayMicroseconds(2); | ||
digitalWrite(TRIG_PIN, HIGH); | ||
delayMicroseconds(10); | ||
digitalWrite(TRIG_PIN, LOW); | ||
|
||
long duration = pulseIn(ECHO_PIN, HIGH); | ||
int distance = duration * 0.034 / 2; // Convert the duration to centimeters (Speed of sound in air is approximately 34 cm/ms) | ||
|
||
Serial.print("Distance: "); | ||
Serial.print(distance); // Send the distance value to the serial plotter | ||
Serial.print(" cm \t"); | ||
|
||
} | ||
|
||
float measureTemperature() { | ||
// Measure and return temperature | ||
// ... | ||
} | ||
|
||
void transferData(int distance, int gasSensorValue, float temperatureC) { | ||
StaticJsonDocument<200> jsonBuffer; | ||
JsonObject data = jsonBuffer.to<JsonObject>(); | ||
data["distance"] = distance; | ||
data["gasValue"] = gasSensorValue; | ||
data["temperature"] = temperatureC; | ||
|
||
Serial1.print("Data:"); // Prefix to identify the data | ||
serializeJson(data, Serial1); // Send JSON data to ESP8266 | ||
Serial1.println(); // End the data transmission | ||
jsonBuffer.clear(); | ||
} | ||
|
||
// The rest of your existing code for measuring and plotting sensor values goes here... |
93 changes: 93 additions & 0 deletions
93
22AIE114_Project_Group_A12/22AIE114_Project_codes_A12/Arduino/Wifi_ESP32cam/sketch_aug9d.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#include <Wire.h> | ||
#include <SoftwareSerial.h> | ||
#include <ArduinoJson.h> | ||
#include <ESP8266WiFi.h> | ||
#include <WiFiClientSecure.h> | ||
#include <UniversalTelegramBot.h> | ||
|
||
// D6 = Rx & D5 = Tx | ||
SoftwareSerial nodemcu(D6, D5); | ||
|
||
const char* ssid = "Avishek"; | ||
const char* password = "eeeproject"; | ||
#define BOTtoken "6598907365:AAHzMOd_MuAUUKnAHqd9JSt8djXO8mOuMw4" | ||
#define CHAT_ID "211246197" | ||
|
||
X509List cert(TELEGRAM_CERTIFICATE_ROOT); | ||
WiFiClientSecure client; | ||
UniversalTelegramBot bot(BOTtoken, client); | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
nodemcu.begin(9600); | ||
|
||
while (!Serial) continue; | ||
|
||
configTime(0, 0, "pool.ntp.org"); | ||
client.setTrustAnchors(&cert); | ||
|
||
WiFi.mode(WIFI_STA); | ||
WiFi.begin(ssid, password); | ||
|
||
while (WiFi.status() != WL_CONNECTED) { | ||
Serial.print("."); | ||
delay(500); | ||
} | ||
|
||
Serial.println(""); | ||
Serial.println("WiFi connected"); | ||
Serial.print("IP address: "); | ||
Serial.println(WiFi.localIP()); | ||
|
||
bot.sendMessage(CHAT_ID, "Wifi Connected!", ""); | ||
bot.sendMessage(CHAT_ID, "System has Started!!", ""); | ||
} | ||
|
||
int animalCount = 0; | ||
String animalType; | ||
|
||
void loop() { | ||
StaticJsonDocument<1000> jsonBuffer; | ||
DeserializationError error = deserializeJson(jsonBuffer, nodemcu); | ||
|
||
if (error) { | ||
Serial.println("Error parsing JSON"); | ||
jsonBuffer.clear(); | ||
return; | ||
} | ||
|
||
if (!jsonBuffer.is<JsonObject>()) { | ||
Serial.println("Invalid JSON Object"); | ||
jsonBuffer.clear(); | ||
return; | ||
} | ||
|
||
JsonObject data = jsonBuffer.as<JsonObject>(); | ||
Serial.println("-----------------------------------------"); | ||
Serial.println("Json object Received.."); | ||
int count = data["count"]; | ||
String type = data["type"]; | ||
|
||
if (count > 0) { | ||
Serial.print("Received Animal Count: "); | ||
Serial.println(count); | ||
Serial.print("Animal Type: "); | ||
Serial.println(type); | ||
|
||
animalCount = count; | ||
animalType = type; | ||
|
||
String message = "Wildlife Detected!\n"; | ||
String countMessage = "Number of Animals Detected: " + String(animalCount) + "\n"; | ||
String typeMessage = "Animal Type: " + animalType + "\n"; | ||
String finalMessage = message + countMessage + typeMessage; | ||
|
||
bot.sendMessage(CHAT_ID, finalMessage, ""); | ||
} else { | ||
Serial.println("No wildlife detected."); | ||
animalCount = 0; | ||
animalType = ""; | ||
} | ||
|
||
jsonBuffer.clear(); | ||
} |
11 changes: 11 additions & 0 deletions
11
22AIE114_Project_Group_A12/22AIE114_Project_codes_A12/YOLO(Python)/chat id capturer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import telebot | ||
|
||
# Replace 'YOUR_API_TOKEN' with your actual Telegram Bot API token | ||
API_TOKEN = '6598907365:AAHzMOd_MuAUUKnAHqd9JSt8djXO8mOuMw4' | ||
bot = telebot.TeleBot(API_TOKEN) | ||
|
||
@bot.message_handler(func=lambda message: True) | ||
def print_chat_id(message): | ||
print("Chat ID:", message.chat.id) | ||
|
||
bot.polling() |
Oops, something went wrong.