家居安防报警器,参考程序。
火灾报警
涉及用sim800c发短信,拨打电话通知。
接线:
Sim800c 3.3V -> Arduino 3.3V
Sim800c GND -> Arduino GND
Sim800c RX -> Arduino TX
Sim800c TX -> Arduino RX
#include <SoftwareSerial.h> // 采用软件的串口
#define Infrared 7 //启动开关
SoftwareSerial SIM800C(10, 11); // Serial RX, TX
boolean bState, bOldState;
int incomingByte = 0; // for incoming serial data
int Infrared_NUM = 0;
void setup() {
// put your setup code here, to run once:
// Open serial communications and wait for port to open
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode