NEED COMPLETE RASPBERRY PI Use the Raspberry Pi, sensors, and accessories to bui
ID: 3833913 • Letter: N
Question
NEED COMPLETE RASPBERRY PI Use the Raspberry Pi, sensors, and accessories to build a fire alarm. The coding and schematics can be found on-line. Please submit coding and pictures of the completed alarm for grading.
Explanation / Answer
#include #include LiquidCrystal lcd(12, 11, 5, 4, 3, 2); SoftwareSerial mySerial(9, 10); int sensor=A1; float temp_read,Temp_alert_val,Temp_shut_val; int sms_count=0,Fire_Set; void setup() { pinMode(sensor,INPUT); mySerial.begin(9600); Serial.begin(9600); lcd.begin(16,2); delay(500); } void loop() { CheckFire(); CheckShutDown(); } void CheckFire() { lcd.setCursor(0,0); lcd.print("Fire Scan - ON"); Temp_alert_val=CheckTemp(); if(Temp_alert_val>45) { SetAlert(); // Function to send SMS Alerts } } float CheckTemp() { temp_read=analogRead(sensor); // reads the sensor output (Vout of LM35) temp_read=temp_read*5; // converts the sensor reading to temperature temp_read=temp_read/10; // adds the decimal point return temp_read; // returns temperature value in degree celsius } void SetAlert() { while(sms_countRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.