OCCUPANCY MONITORING SYSTEM FOR COVID PRECAUTION
Welcome to R2C Technologies!!!
Today we gonna see about implementing a occupancy monitoring system for COVID-19 precaution usingcc3200 launch pad ( an IoT microcontroller). Due to the pandemic situation caused by COVID-19 we have to follow some precaution in order to overcome situation for that we need a continuous monitoring facility everywhere hence I came up with a idea of implementing a occupancy monitoring system using cc3200 launch pad in which we can able to change the no of entries limit based on the occupancy consider a company has 100 employees but due to COVID only 50% occupancy is needed so employees entries above 50 should be restricted for that there needs a continuous monitoring using this blog as reference you can able to make this work in home automation.
PROGRAM DESCRIPTION:
First of all declare a variable 'count' as integer datatype and initialize its value as 0.In void setup the input and output pins that we gonna use are declared .In this program led pins 29(red led),10(green led),9(yellow led) are assigned as output.At initial state all LEDs should be in OFF state hence all LEDs are set to OFF state. .The reason behind this is if you don't declare them in OFF condition all the LEDs will be in ON condition without satisfying the conditions given in the void loop. Since we are using serial monitor for printing the information in order to print enable printing in serial monitor we need to declare serial.begin(115200) here 115200 represents the baud rate or operating frequency of cc3200 launch pad ( an IoT microcontroller) used for hardware implementation. The baud rate of a launch pad varies for each launch pad model hence we have to refer the datasheet before using the respective microcontroller. Using serial monitor we are printing "Occupancy detection system for COVID precaution "with the help of the command 'Serial.println '.In this 'ln' refers to new line (i.e: informations will be printed line by line if we declare by using the command 'Serial.print 'the serial monitor will prints the information continuously word after word so it will be difficult for us to monitor.
In void loop the commands which are programmed to run repeatedly are declared here. At first we need to fetch the datas measured by the IR sensor for that we need analog pin because sensor will reads the physical signal which will be always in analog nature .In cc3200 launch pad pin number 2,4,23,24 and 33 are in analog nature .In this program I gonna use pin number 2 for reading analog input .In general if IR sensor detects any interference the sensor value will be less than 2800 else the sensor value will be at a range of 4500 . Hence we are using ‘ If ’ statement for the command followed by condition sensor value < 2800 .If this condition is true count variable is incremented by declaring 'count++' which means
'count=count+1' so for each detection variable 'count' is incremented by one .Using serial.println print "Number of persons entered" next to that declare count variable without double codes using serial print .With the help of digitalwrite declare the LEDpin number 9 in HIGH give a delay of 50 milliseconds after that declare the led pin to LOW such that if any interference has been detected yellow led will blink for 50 milliseconds .Under this we gonna add 'else if ' for another condition as 'count<50&&count>0' this condition has the AND operator(&&) .Because of this 'else if 'statement will be satisfied only if both the conditions 'count <50' and 'count >0' are true. Under the statement using digitalwrite turn the green led to ON state. Using another 'else if 'statement make a condition 'count>50' under that with the help of digitalwrite turn the red led ON for additional buzzer intimation connect the positive terminal to the pin number 2and negative terminal to ground pin of the launch pad. By enabling serial monitor print "No entry" and" The room has reached 50% of occupancy limit". By doing so if members crossing the ir sensor's path count >50 then the red and buzzer will be turned ON. At last under else statement declare all the LEDs in OFF condition.