GPRS SM5100B for Ardunio Mega

This Project show how to send GPRs packet Using SM5100B  Module with Ardunio Mega you need 1- Ardunio Mega 2- GSM SM5100B 3- IP  address of server we're connecting to 4- name of the host at this IP address if you don't have IP & Host  you can use  it's  free . Referunce :

Topic by IYAD.J   |  last reply

Timer,Temprature & Humidity Based Relay Switching with Arduino Mega.? Answered

I am making a Climate Controler for my Green House. Please help me about Arduino code for Four Relay operation. relay1 will be high when Temp will rise higher then Temprature value defined and will low when reach under defined value. relay2 will be high when Humidity will rise higher then Humidity value defined and will low when reach under defined value  relay3 will be high for 10 Minutes in every 120 Minutes. relay4 will be high for 10 Minutes in every 120 Minutes.  I am Using DHT11 sensor with Mega2560 Board. Currently using this code. Its working for Temp & Humidty based Relay operation only. Need to add two relay with Timer based operation. System needs to check Humidity and Temprature value in every 10 minutes. Please Help.  I am very new for Arduino and making this for my personal use. #include #include #include /*-----( Declare objects )-----*/ // set the LCD address to 0x27 for a 20 chars 4 line display // Set the pins on the I2C chip used for LCD connections: //                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol LiquidCrystal lcd(20, 19, 18, 17, 16, 15); // Set the LCD I2C address dht11 DHT11; /*-----( Declare Constants, Pin Numbers )-----*/ #define DHT11PIN 22 #define RELAY1  6                        #define RELAY2  7                        #define RELAY3  4                        #define RELAY4  5 #define TempTarget 30 #define HUMTarget 50 void setup()   /*----( SETUP: RUNS ONCE )----*/ {   Serial.begin(9600); //(Remove all 'Serial' commands if not needed)   lcd.begin(20,2);         // initialize the lcd for 20 chars 4 lines, turn on backlight     // Print a message to the LCD.   //lcd.setCursor(0, 1);   lcd.print("SHOURYA's GARDEN");   // Initialise the Arduino data pins for OUTPUT   pinMode(RELAY1, OUTPUT);         pinMode(RELAY2, OUTPUT);   pinMode(RELAY3, OUTPUT);   pinMode(RELAY4, OUTPUT);   }/*--(end setup )---*/ void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/ {   int chk =;   Serial.print   ("GARDEN DATA SENSING ");   switch (chk)   {     case 0: Serial.println(" OK"); break;     case -1: Serial.println("Checksum error"); break;     case -2: Serial.println("Time out error"); break;     default: Serial.println("Unknown error"); break;   }   lcd.setCursor(0, 1);   lcd.print("TempC=");   lcd.print((float)DHT11.temperature, 0);   Serial.print("Temperature (oC): ");   Serial.println((float)DHT11.temperature, 2);   //lcd.print(" F=");   //lcd.print(Fahrenheit(DHT11.temperature), 0);   //Serial.print("Temperature (oF): ");   //Serial.println(Fahrenheit(DHT11.temperature), 2);     lcd.print(" Hum=");   lcd.print((float)DHT11.humidity, 0);   lcd.print("%");   Serial.print("Humid(%): ");   Serial.println((float)DHT11.humidity, 2);    //Serial.print("Temperature (K): ");   //Serial.println(Kelvin(DHT11.temperature), 2);   //Serial.print("Dew Point (oC): ");   //Serial.println(dewPoint(DHT11.temperature, DHT11.humidity));   //Serial.print("Dew PointFast (oC): ");   //Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));        if (DHT11.temperature > TempTarget)       { Serial.println("Turning on Exaust Fan"); //lcd.print("Turning on Exaust Fan"); digitalWrite (RELAY1, HIGH); delay(1000);     }      if (DHT11.temperature < TempTarget)     { Serial.println("Turning Off Exaust Fan"); //lcd.print("Turning off Exaust Fan"); digitalWrite (RELAY1, LOW); delay(1000);     }       if (DHT11.humidity < HUMTarget)     { Serial.println("Turning on HUMIDIFIER"); //lcd.print("Turning on HUMIDIFIER"); digitalWrite (RELAY2, HIGH); delay(1000);     }      if (DHT11.humidity > HUMTarget)     { Serial.println("Turning Off HUMIDIFIER"); //lcd.print("Turning off HUMIDIFIER"); digitalWrite (RELAY2, LOW); delay(1000);     }       digitalWrite(RELAY3,HIGH);           // Turns ON Relays 3    digitalWrite(RELAY4,HIGH);           // Turns ON Relays 4    delay(10*1000);     digitalWrite(RELAY3,LOW);          // Turns Relay Off    digitalWrite(RELAY4,LOW);          // Turns Relay Off   }/* --(end main loop )-- */ /*-----( Declare User-written Functions )-----*/ // //Celsius to Fahrenheit conversion double Fahrenheit(double celsius) {         return 1.8 * celsius + 32; } //Celsius to Kelvin conversion double Kelvin(double celsius) {         return celsius + 273.15; } // dewPoint function NOAA // reference: double dewPoint(double celsius, double humidity) {         double A0= 373.15/(273.15 + celsius);         double SUM = -7.90298 * (A0-1);         SUM += 5.02808 * log10(A0);         SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;         SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;         SUM += log10(1013.246);         double VP = pow(10, SUM-3) * humidity;         double T = log(VP/0.61078);   // temp var         return (241.88 * T) / (17.558-T); } // delta max = 0.6544 wrt dewPoint() // 5x faster than dewPoint() // reference: double dewPointFast(double celsius, double humidity) {         double a = 17.271;         double b = 237.7;         double temp = (a * celsius) / (b + celsius) + log(humidity/100);         double Td = (b * temp) / (a - temp);         return Td; } /* ( THE END ) */

Question by achauhan13   |  last reply

firgelli L12 -I with adafruit motor shield v2 + arduino mega 2560...not sure how to run it!!

Hello, I am trying to turn on and control a Firgelli L12 -I actuator using a Adafruit Motor Shield connected on top of a Ardunio Mega 2560. I connect the red/black/white set of wires from the actuator to the set of pins labeled as servo (there are two sets of three pins labeled as servo 1 and servo 2). There are no examples I could find for Servo control using Adafruit on top an Arduino!! Could someone please elaborate on this a bit, so I can find the right connections from firgelli to the Shield, How would I connect it if I do not have the Shield, and then what code should I use? Many Thanks, Karim.

Topic by behzadjk   |  last reply