Autonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav

Siv qhov GSM relay no, koj tuaj yeem tig rau txhua qhov kev ntsuas ntawm 220 V thiab lub zog tsis pub ntau tshaj 2 kW, nyob rau hauv txhua lub ces kaum ntawm lub ntiaj teb uas muaj lub xov tooj ntawm tes.

Autonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav
Cov cuab yeej no yog tswj los ntawm arduino nano ntawm gsm module SIM800L. Daim duab ua haujlwm nrog cov npe ntawm cov khoom muaj nyob hauv qab no. Nws tuaj yeem ua haujlwm los ntawm cov roj teeb built-in lossis los ntawm 220 V network. Los ntawm cov roj teeb, lub zog tso zis ntau tshaj 2 W.

Autonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav
Luv luv txog lub tswvyim.

Muaj 4 blocks hauv cov cuab yeej no:

  • inverter chav tsev
  • controller thiab roj teeb unit
  • uninterruptible power supply unit
  • Tswj thaiv.

Lub inverter chav tsev yog ib txwm 500t tsheb inverter. Nws tseem yuav ua hauj lwm nrog tsawg zog, tab sis lub siab tshaj plaws tso zis hwj chim kuj yuav txo nyob rau hauv kev faib ua feem rau lub zog ntawm lub inverter.

Cov maub los thiab roj teeb chav tsev yog ib tus neeg tsav tsheb pheej yig BMS S3 tsim los txuas 3 lithium-ion roj teeb. Cov roj teeb yog cov tam sim no siab. Lawv tuaj yeem xa tawm tam sim no ntawm 35 amperes. Yog tias koj muaj lub zog tsawg dua, ces koj tuaj yeem yuav cov roj teeb uas pheej yig dua nrog qhov qis tshaj tam sim no.

Lub tshuab hluav taws xob tsis cuam tshuam yog tsim los ntawm transistor VT3, VD4, R4, R5, R3. Lub cathode ntawm zener diode VD4 txuas ncaj qha mus rau lub hwj huam mov thiab thaum siv fais fab, lub transistor VT3 qhib. Tom qab nws qhib, lub peev xwm tsis zoo tuaj txog ntawm tag nrho cov relay inputs thiab cov relays hloov mus rau hauv Circuit Court fais fab mov hom los ntawm lub hwj chim mov. Ib qho tseem ceeb ntawm cov kev sib txuas ua ke uas tau npaj txhij: qee qhov ua haujlwm thaum muaj peev xwm zoo los ntawm cov tswv yim, thiab qee qhov yog qhov tsis zoo. Yog tias koj muaj thawj qhov kev xaiv, ces koj yuav tsum tau txav R3 mus rau hauv qhov sib txawv ntawm qhov sib txawv ntawm transistor VT3 thiab txuas lub relay input rau lub emitter ntawm tib lub transistor.

Chav tswj tau sib sau ua ke ntawm SIM800 module thiab arduino nano.

Autonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav

Qhov no yog qhov sib dhos Circuit Court zoo liAutonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav

Qhov no yog qhov zoo li thaum ntim khoomAutonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav

Autonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav

Autonomous GSM relay nrog inverter ua los ntawm cov khoom npaj tiav

Txhawm rau kom lub cuab yeej pib txais SMS los ntawm koj lub xov tooj, koj yuav tsum sau koj tus lej xov tooj rau hauv koj lub xov tooj hloov pauv. Nws tseem tuaj yeem txuas lub LCD zaub rau Arduino, piv txwv li wh1601 lossis wh0802, tab sis koj yuav tsum tsis txhob hais tag nrho cov kab nrog inscription lcd.

code

char your_phone = "+79148389933";

#include <SoftwareSerial.h>                                          // ΠŸΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π°Π΅ΠΌ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΡƒ SoftwareSerial для общСния с ΠΌΠΎΠ΄ΡƒΠ»Π΅ΠΌ ΠΏΠΎ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠΉ шинС UART
SoftwareSerial softSerial(8,9);                                      // Π‘ΠΎΠ·Π΄Π°Ρ‘ΠΌ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ softSerial указывая Π²Ρ‹Π²ΠΎΠ΄Ρ‹ RX, TX (ΠΌΠΎΠΆΠ½ΠΎ ΡƒΠΊΠ°Π·Ρ‹Π²Π°Ρ‚ΡŒ Π»ΡŽΠ±Ρ‹Π΅ Π²Ρ‹Π²ΠΎΠ΄Ρ‹ Arduino UNO)
// include the library code:
//#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
//const int rs = 12, en = 11, d4 = 5, d5 = 6, d6 = 7, d7 = 10;
//LiquidCrystal lcd(rs, en, d4, d5, d6, d7);                                                               // Π’ Π΄Π°Π½Π½ΠΎΠΌ случаС Π²Ρ‹Π²ΠΎΠ΄ TX модуля ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ΡΡ ΠΊ Π²Ρ‹Π²ΠΎΠ΄Ρƒ 2 Arduino, Π° Π²Ρ‹Π²ΠΎΠ΄ RX модуля ΠΊ Π²Ρ‹Π²ΠΎΠ΄Ρƒ 3 Arduino.
//  Π˜Π½ΠΈΡ†ΠΈΠΈΡ€ΡƒΠ΅ΠΌ Ρ€Π°Π±ΠΎΡ‚Ρƒ шин UART с ΡƒΠΊΠ°Π·Π°Π½ΠΈΠ΅ΠΌ скоростСй ΠΎΠ±Π΅ΠΈΡ… шин:      //
String buf2,buf3;
int g=0;

    String cmd1;
void setup(){                                                        //
init_port();
      // lcd.begin(16, 2);
  // Print a message to the LCD.
  //lcd.clear();
  //  lcd.setCursor(0, 0);
 /// lcd.print("VKL");
 // lcd.setCursor(0, 1);
 /// lcd.print("ZHDITE");

        /// init_port();// Π˜Π½ΠΈΡ†ΠΈΠΈΡ€ΡƒΠ΅ΠΌ ΠΏΠ΅Ρ€Π΅Π΄Π°Ρ‡Ρƒ Π΄Π°Π½Π½Ρ‹Ρ… ΠΏΠΎ Π°ΠΏΠΏΠ°Ρ€Π°Ρ‚Π½ΠΎΠΉ  шинС UART Π½Π° скорости  9600 (ΠΌΠ΅ΠΆΠ΄Ρƒ Arduino ΠΈ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€ΠΎΠΌ)
    softSerial.begin(9600);                                         // Π˜Π½ΠΈΡ†ΠΈΠΈΡ€ΡƒΠ΅ΠΌ ΠΏΠ΅Ρ€Π΅Π΄Π°Ρ‡Ρƒ Π΄Π°Π½Π½Ρ‹Ρ… ΠΏΠΎ ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠΉ шинС UART Π½Π° скорости 38400 (ΠΌΠ΅ΠΆΠ΄Ρƒ ΠΌΠΎΠ΄ΡƒΠ»Π΅ΠΌ ΠΈ Arduino)
        Serial.begin(9600);   
        delay(30000);

  //  cmd1 ="AT+CMGF=1rn";
  softSerial.print("AT+CMGF=1rn"); 
  ///  print_lcd(cmd1);
delay(1000);
       dellAllSMS();  
//  cmd1 ="AT+CMGDA="DEL ALL"rn";
    // print_lcd(cmd1);
//cmd1="AT+CPAS";
  ///   print_lcd(cmd1);
}                                                                    //
      
   
      char c;  
      int m=0;
      int i=0;//
      int n=0;
//  ВыполняСм Ρ€Π΅Ρ‚Ρ€Π°Π½ΡΠ»ΡΡ†ΠΈΡŽ:                                          // Всё Ρ‡Ρ‚ΠΎ ΠΏΡ€ΠΈΡˆΠ»ΠΎ с модуля - отправляСм ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Ρƒ, Π° всё Ρ‡Ρ‚ΠΎ ΠΏΡ€ΠΈΡˆΠ»ΠΎ с ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Π° - отправляСм ΠΌΠΎΠ΄ΡƒΠ»ΡŽ

void dellAllSMS(){
  /* This deletes all sms in memory  
  
  */

  softSerial.print("AT+CMGDA="DEL ALL"rn"); // set sms to text mode

delay(3000);
}
void pin_on_setb()
{
 digitalWrite(2,1);
  digitalWrite(13,1);
}
void pin_off_setb()
{
 digitalWrite(2,0);
  digitalWrite(13,0);
}
void pin_on_inv()
{
 digitalWrite(3,1);
  //  digitalWrite(13,1);
}
void pin_off_inv()
{
 digitalWrite(3,0);
   // digitalWrite(13,0);
}
void init_port()
{
pinMode(2,1);
pinMode(3,1);
    pinMode(13,1);
}
String readData(){
   // this function just reads the raw data
   uint16_t timeout=0;
   while (!softSerial.available() && timeout<10000)
   {
     delay(10);
     timeout++;
   }
   if(softSerial.available())
   {
     String output = softSerial.readString();
     //if(DEBUG)
    ///   Serial.println(output);
     return output;
   }
 }
String buf, bufferIndex; 
int tempIndex=0;
int messageIndex;
int prev=0;
int power=0;
void loop(){                                                         //
   /* if(softSerial.available()){    Serial.write(softSerial.read());} // ΠŸΠ΅Ρ€Π΅Π΄Π°Ρ‘ΠΌ Π΄Π°Π½Π½Ρ‹Π΅ ΠΈΠ· ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠΉ ΡˆΠΈΠ½Ρ‹ UART Π² Π°ΠΏΠΏΠ°Ρ€Π°Ρ‚Π½ΡƒΡŽ  (ΠΎΡ‚ модуля     Ρ‡Π΅Ρ€Π΅Π· Arduino ΠΊ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Ρƒ)
    if(    Serial.available()){softSerial.write(    Serial.read());} // ΠŸΠ΅Ρ€Π΅Π΄Π°Ρ‘ΠΌ Π΄Π°Π½Π½Ρ‹Π΅ ΠΈΠ· Π°ΠΏΠΏΠ°Ρ€Π°Ρ‚Π½ΠΎΠΉ  ΡˆΠΈΠ½Ρ‹ UART Π² ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΡƒΡŽ (ΠΎΡ‚ ΠΊΠΎΠΌΠΏΡŒΡŽΡ‚Π΅Ρ€Π° Ρ‡Π΅Ρ€Π΅Π· Arduino ΠΊ ΠΌΠΎΠ΄ΡƒΠ»ΡŽ    )*/

         //   lcd.clear();
     //  lcd.setCursor(0, 0);
     //  lcd.print("Nagruzka");
            //  lcd.setCursor(0, 1);
           //   if (power==1)
          //    {
         //              lcd.print("VKL");
     //         }
         //     else {lcd.print("VIKL");}
      softSerial.print(F("AT+CMGL="ALL",0"));
  softSerial.print("r");
  buf = readData();
 // Serial.println(buf);
tempIndex = buf.lastIndexOf("+CMGL: ");
tempIndex = tempIndex + 6;
    bufferIndex = buf.substring(tempIndex);
    bufferIndex = bufferIndex.substring(1,(bufferIndex.indexOf(",")));
    messageIndex = bufferIndex.toInt();
    ///Serial.println(messageIndex);
    if(prev!=messageIndex)
    {
      tempIndex = buf.lastIndexOf(your_phone);
     //  lcd.clear();
     //  lcd.setCursor(0, 0);
     //  lcd.print("SMS READ");

     if((digitalRead(4))&&(tempIndex!=-1))
     {
      pin_on_inv();
      delay(2000);
      pin_off_inv();
     // i=1;
   //  power=1;
     }
     else 
     {
     pin_on_setb();
           delay(2000);
     pin_off_setb();
  //   i=1;
 //         power=1;
     }
        //    send_sms(number3);

     
    prev++;
    
    }
if(messageIndex>=2)
{
 dellAllSMS();
// lcd.clear();
     //   lcd.setCursor(0, 0);
     //  lcd.print("SMS READ");
     //   lcd.setCursor(0, 1);
// lcd.print("SMS DEL");
 //  cmd1 ="AT+CMGDA="DEL ALL"rn";
   //  print_lcd(cmd1);
prev=0;
}
delay(10000);

}

Cov ntaub ntawv STL rau luam lub thawv tuaj yeem pom S, SΡ“S,.

Video ntawm kev ua haujlwm:



Tau qhov twg los: www.hab.com

Ntxiv ib saib