Posts

Showing posts from April, 2017

ARDUINO WITH I2C LCD DISPLAY USING PCF8574A

Image
fig:1,  Proteus Simulation /*   This is an Example for the  LCD I2C  Library originally added 18 Apr 2017  by HARIKRISHNAN  library modified 12 Jul 2017  */ // include the library code: #include <Wire.h> #include <FaBoLCD_PCF8574.h> // initialize the library FaBoLCD_PCF8574 lcd(0x3f); void setup() {   // set up the LCD's number of columns and rows:   lcd.begin(16, 2);   // Print a message to the LCD.   lcd.print("hello, AM HARIKRISHNAN!"); } void loop() {   // set the cursor to column 0, line 1   // (note: line 1 is the second row, since counting begins with 0):   lcd.setCursor(0, 1);   // print the number of seconds since reset:   lcd.print(millis() / 1000); }                                                                                                            Harikrishnan K                                                                                                             ( BE, EEE )

ARDUINO UNO AND LM35

#include <LiquidCrystal.h> LiquidCrystal lcd(7, 6, 5, 4, 3, 2); int val; int tempPin = 1; void setup() { Serial.begin(9600); lcd.begin(16, 2); pinMode(12, OUTPUT); } void loop() { val = analogRead(tempPin); float mv = ( val/1024.0)*5000; float cel = mv/10; Serial.print("TEMPRATURE = "); Serial.print(cel); Serial.print("°C"); Serial.println(); delay(1000); lcd.setCursor(4, 1); lcd.print(cel); lcd.setCursor(9, 1); lcd.print((char)223); lcd.print("C"); if(cel >= 38) {   digitalWrite(12, HIGH); } else {   pinMode(12, LOW); } }

Send SMS to two different number when any fault is detected

Image
                    fig1:GSM Module   PROGRAM /* Send SMS to two different number when any fault is detected   pin 5 used to detect fault commenly any sensor   pin 7 to turn ON the whole system   pin12 turn OFF the power to the machine usually a relay created 2017  by Alwin Thomas  modified 9 Apr 2017  by Arun Prabhakaran P */ const int SENSORPIN = 5; const int RELAY = 12; const int KEY = 7; int s = 0; void SendSMS() {   Serial.print("AT+CMGF=1");   Serial.write(0x0D);   delay(2000);   Serial.print("AT+CMGS=");   Serial.write(0x22);   Serial.print("9048316362");   Serial.write(0x22);   Serial.write(0x0D);   delay(2000);   Serial.print(" WARNING! ");   Serial.print("POLLUTION DETECTED");   Serial.write(0x1A);   delay(3000);  /* Sending Message 2 */   Serial.print("AT+CMGF=1");   Serial.write(0x0D);   delay(2000);   Serial.print("AT+CMGS=");   Serial.write(0x22);   Serial.pr

SEND SMS USING ARDUINO AND GSM

Image
                                                                                                             fig1; proteus simulation               PROGRAM Send message when a button is pressed const int SENSORPIN = 2;  void SendMessage() {   Serial.print("AT+CMGF=1");   Serial.write(0x0D);   delay(2000);   Serial.print("AT+CMGS=");   Serial.write(0x22);   Serial.print("974668xxxx");   Serial.write(0x22);   Serial.write(0x0D);   delay(2000);   Serial.print(" POLLUTION DETECTED ");   Serial.write(0x1A);   delay(3000); } int  SENSORSTATE = 0; void setup() {   Serial.begin(9600);    // Setting the baud rate of Serial Monitor (Arduino)   delay(100); pinMode(SENSORSTATE, INPUT); } void loop() {   SENSORSTATE = digitalRead(SENSORPIN);   if (SENSORSTATE == HIGH) { while(digitalRead(SENSORPIN)== HIGH);          SendMessage(); } } PROGRAM Send message to two different NO, when a button is pressed