Arduino UNO R3 + SIM900 + USB lighter for phone triggering

Source: Internet
Author: User

Source of demand

1. My son finished the year 6 years old, like to play fireworks, but the courage is small, so I am responsible for ignition, from the year before 26 to the beginning of eight, every night to give his son point firecrackers ah point firecrackers.

2. The new year to open the door gun and opened the gun, Lunar New Year early morning also to help mom point firecrackers, said the whole string of small firecrackers also fried too fast, every time did not run a few steps on the open, brother also bad heart ah.

Design:

According to demand, we need a long-distance ignition of the lighter, on the Taobao on a circle, found a USB lighter, renew the appliance, plus a SIM900 arduino expansion board, come back simple succession, it is.

Code:

#include <SoftwareSerial.h>#include<String.h>softwareserial GPRS (7,8); String CurrentLine="";//string to hold the text from serverString triggerno="13616761237"; String Mobile=""; Boolean Readingno=false;LongLasttriggertime=0; Boolean fireing=false;intLed=4;voidSetup () {Gprs.begin (19200);//The GPRS baud rateSerial.begin (19200);//The GPRS baud ratePinmode (9, OUTPUT);  Pinmode (Led,output);  Digitalwrite (Led,low); Delay ( -); Powerupordown ();}voidLoop () {if(fireing) {if(Millis ()-Lasttriggertime >= A* +) {serial.println ("Stop fire!");    Digitalwrite (Led,low); Fireing=false; }Else{     return; }  }       while(Gprs.available ()) {CharInchar=Gprs.read (); CurrentLine+=Inchar; if(inchar=='\ n') currentline=""; if(Currentline.endswith ("+clip: \ "") ) {Readingno=true; Mobile=""; }          if(Readingno) {if(Inchar! =','){         if(Inchar! ='"') mobile+=Inchar; }Else{Readingno=false;         SERIAL.PRINTLN (mobile); if(mobile==Triggerno) {Lasttriggertime=Millis (); Serial.println ("fire!!"); Fireing=true; CurrentLine=""; Mobile=""; Delay ( +);           Digitalwrite (Led,high); Delay (4000); Gprs.println ("ATH");  while(Gprs.available ()) {gprs.read (); }                    }                }     }  } }voidPowerupordown () {Digitalwrite (9, low); Delay ( +); Digitalwrite (9, high); Delay ( -); Digitalwrite (9, low); Delay ( the);}

(Standby state and trigger State):

Arduino UNO R3 + SIM900 + USB lighter for phone triggering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.