Wednesday, 5 October 2016

DEPARTMENT MANAGEMENT SYSTEM USING ARDUINO UNO.

DEPARTMENT MANAGEMENT SYSTEM                      USING ARDUINO UNO.


My latest Arduino DIY project is DEPARTMENT MANAGEMENT SYSTEM USING ARDUINO UNO.


The objective of this mini-project is to build a department management system .The management system includes a timetable, digital clock with temperature and a power saving module. This management system can be used in institutions such as Schools, Colleges, Universities, and Offices etc. It is even possible to store multiple timetables and switch between them. All of is achieved by integrating SENSORS and LCD to the ARDUINO MODULE. The proposed prototype system consists of a medium sized 20x8 LCD display, a 7 SEGMENT display, an LM35, a PIR sensor and an Array of Switches to switch between the days. All the device components are being powered by a 9V DC Supply adapter. In addition a DIGITAL THERMOMETER is also added to the digital timetable using LM35 module. A 4 digit 7 segment display shows the time. A PIR sensor connected with the Arduino checks for human presence and automatically saves power.



HARDWARE EXPLANATION;



ARDUINO UNO R3


PASSIVE INFRARED SENSOR (PIR)

HD44780 LCD DISPLAY

TEMPERATURE SENSOR LM 35

SWITCHES

LEDs

RESISTOR

CAPACITOR

Connection Diagram;


































MORE IMAGES;














POWER SUPPLY DESIGN







FINAL MODEL



use;Arduino uno


Arduino ide; http://www.arduino.org/downloads


Arduino coding handled by :- PRANAV S NAIR (pranavsnair93@gmail.com)

Project helping courtesy:- Felix philip <felixphilip86@gmail.com>


Code



#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(1,2,3,4,5,6);

const int buttonPin1 = 7;
const int buttonPin2 = 8;
const int buttonPin3 = 9;
const int buttonPin4 = 10;
const int buttonPin5 = 11;
const int buttonPin6 = 12;
const int inPin = A0;
int motion = 13;
int motionLed = 0;
unsigned long pervMillis=0;
const long interval=5000;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
int buttonState5 = 0;
int buttonState6 = 0;
void setup() {
lcd.begin(20,4);
// initialize the LED pin as an output:
// initialize the pushbutton pin as an input:
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
pinMode(buttonPin4, INPUT);
pinMode(buttonPin5, INPUT);
pinMode(buttonPin6, INPUT);
pinMode(motion, INPUT);
pinMode(motionLed, OUTPUT);
}
void loop() {
pgmbegin:
lcd.clear();
lcd.setCursor(4,1);
lcd.print("Enter a Day!");
lcd.setCursor(0,2);
lcd.print("--------------------");
int value = analogRead(inPin); // read the value from the sensor
lcd.setCursor(0,3);
lcd.print("Temperature:");
float millivolts = (value / 1024.0) * 5000;
float celsius = millivolts / 10;
lcd.setCursor(13,3);
lcd.print(celsius);
lcd.print("C");
delay(100);
unsigned long currenMillis= millis();
long sensor = digitalRead(motion);
if(sensor==HIGH)
{
digitalWrite(motionLed,HIGH);
if(currenMillis-pervMillis>=interval)
{ pervMillis=currenMillis;
digitalWrite (motionLed, LOW );}
else
{ digitalWrite(motionLed,HIGH);}
}
else
{
digitalWrite (motionLed, LOW);
}
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH)
{ digitalWrite (motionLed, HIGH);
monday: for(int i=0;i<=200;i++)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("MONDAY");
lcd.setCursor(0,1);
lcd.print("-");
lcd.setCursor(0,2);
lcd.print("-");
lcd.setCursor(0,3);
lcd.print("-");
delay(200);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH){ goto pgmbegin;}
if(buttonState2 == HIGH){ goto tuesday;}
if (buttonState3 == HIGH){ goto wednesday;}
if (buttonState4 == HIGH){ goto thursday;}
if (buttonState5 == HIGH){ goto friday;}
if(buttonState6 == HIGH){ goto saturday;}
}
}
if (buttonState2 == HIGH)
{ digitalWrite (motionLed, HIGH);
tuesday: for(int i=0;i<=200;i++)
{ lcd.clear();
lcd.setCursor(0,0);
lcd.print("TUESDAY");
lcd.setCursor(0,1);
lcd.print("-");
lcd.setCursor(0,2);
lcd.print("-");
lcd.setCursor(0,3);
lcd.print("-");
delay(200);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH){ goto monday;}
if (buttonState2 == HIGH){ goto pgmbegin;}
if (buttonState3 == HIGH){ goto wednesday;}
if (buttonState4 == HIGH){ goto thursday;}
if (buttonState5 == HIGH){ goto friday;}
if(buttonState6 == HIGH){ goto saturday;}
}
}
if (buttonState3 == HIGH)
{ digitalWrite (motionLed, HIGH);
wednesday: for(int i=0;i<=200;i++)
{ lcd.clear();
lcd.setCursor(0,0);
lcd.print("WEDNESDAY");
lcd.setCursor(0,1);
lcd.print("-");
lcd.setCursor(0,2);
lcd.print("-");
lcd.setCursor(0,3);
lcd.print("-");
delay(200);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH){ goto monday;}
if(buttonState2 == HIGH){ goto tuesday;}
if (buttonState3 == HIGH){ goto pgmbegin;}
if (buttonState4 == HIGH){ goto thursday;}
if (buttonState5 == HIGH){ goto friday;}
if(buttonState6 == HIGH){ goto saturday;}
}
}
if (buttonState4 == HIGH)
{ digitalWrite (motionLed, HIGH);
thursday: for(int i=0;i<=200;i++)
{ lcd.clear();
lcd.setCursor(0,0);
lcd.print("THURSDAY");
lcd.setCursor(0,1);
lcd.print("-");
lcd.setCursor(0,2);
lcd.print("-");
lcd.setCursor(0,3);
lcd.print("-");
delay(200);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH){ goto monday;}
if(buttonState2 == HIGH){ goto tuesday;}
if (buttonState3 == HIGH){ goto wednesday;}
if (buttonState4 == HIGH){ goto pgmbegin;}
if (buttonState5 == HIGH){ goto friday;}
if(buttonState6 == HIGH){ goto saturday;}
}
}
if (buttonState5 == HIGH)
{ digitalWrite (motionLed, HIGH);
friday: for(int i=0;i<=200;i++)
{ lcd.clear();
lcd.setCursor(0,0);
lcd.print("FRIDAY");
lcd.setCursor(0,1);
lcd.print("-");
lcd.setCursor(0,2);
lcd.print("-");
lcd.setCursor(0,3);
lcd.print("-");
delay(200);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH){ goto monday;}
if(buttonState2 == HIGH){ goto tuesday;}
if (buttonState3 == HIGH){ goto wednesday;}
if (buttonState4 == HIGH){ goto thursday;}
if (buttonState5 == HIGH){ goto pgmbegin;}
if(buttonState6 == HIGH){ goto saturday;}
}
}
if (buttonState6 == HIGH)
{ digitalWrite (motionLed, HIGH);
saturday: for(int i=0;i<=200;i++)
{ lcd.clear();
lcd.setCursor(6,0);
lcd.print("saturday");
lcd.setCursor(0,1);
lcd.print("-");
lcd.setCursor(4,2);
lcd.print("-");
lcd.setCursor(6,3);
lcd.print("-");
delay(200);
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
buttonState4 = digitalRead(buttonPin4);
buttonState5 = digitalRead(buttonPin5);
buttonState6 = digitalRead(buttonPin6);
if (buttonState1 == HIGH){ goto monday;}
if(buttonState2 == HIGH){ goto tuesday;}
if (buttonState3 == HIGH){ goto wednesday;}
if (buttonState4 == HIGH){ goto thursday;}
if (buttonState5 == HIGH){ goto friday;}
if(buttonState6 == HIGH){ goto pgmbegin;}
}
}
else
{
goto pgmbegin;}
}

No comments:

Post a Comment