Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Home Automation With LILYGO Esp32 Sim800
Just Do Electronics
May 01, 2021
Circuit Diagram :-
Code :-
//Prateek //www.prateeks.in #define MODEM_RST 5 #define MODEM_PWKEY 4 #define MODEM_POWER_ON 23 #define MODEM_TX 27 #define MODEM_RX 26 #define I2C_SDA 21 #define I2C_SCL 22 #define BLYNK_PRINT Serial #define BLYNK_HEARTBEAT 30 #define TINY_GSM_MODEM_SIM800 #include
#include
#include
#include "utilities.h" #define SerialMon Serial #define SerialAT Serial1 const char apn[] = "www.ideagprs.com"; const char user[] = ""; const char pass[] = ""; // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). const char auth[] = "apFsC_Ae_hw16Y70-LCb0b0_4RF2pK9h"; TinyGsm modem(SerialAT); void setup() { // Set console baud rate SerialMon.begin(115200); delay(10); // Keep power when running from battery Wire.begin(I2C_SDA, I2C_SCL); bool isOk = setPowerBoostKeepOn(1); SerialMon.println(String("IP5306 KeepOn ") + (isOk ? "OK" : "FAIL")); // Set-up modem reset, enable, power pins pinMode(MODEM_PWKEY, OUTPUT); pinMode(MODEM_RST, OUTPUT); pinMode(MODEM_POWER_ON, OUTPUT); digitalWrite(MODEM_PWKEY, LOW); digitalWrite(MODEM_RST, HIGH); digitalWrite(MODEM_POWER_ON, HIGH); // Set GSM module baud rate and UART pins SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX); delay(3000); // Restart takes quite some time // To skip it, call init() instead of restart() SerialMon.println("Initializing modem..."); modem.restart(); String modemInfo = modem.getModemInfo(); SerialMon.print("Modem: "); SerialMon.println(modemInfo); // Unlock your SIM card with a PIN //modem.simUnlock("1234"); SerialMon.print("Waiting for network..."); if (!modem.waitForNetwork(240000L)) { SerialMon.println(" fail"); delay(10000); return; } SerialMon.println(" OK"); if (modem.isNetworkConnected()) { SerialMon.println("Network connected"); } SerialMon.print(F("Connecting to APN: ")); SerialMon.print(apn); if (!modem.gprsConnect(apn, user, pass)) { SerialMon.println(" fail"); delay(10000); return; } SerialMon.println(" OK"); Blynk.begin(auth, modem, apn, user, pass); } void loop() { Blynk.run(); }
utilities.h
#define IP5306_ADDR 0x75 #define IP5306_REG_SYS_CTL0 0x00 bool setPowerBoostKeepOn(int en) { Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (en) { Wire.write(0x37); // Set bit1: 1 enable 0 disable boost keep on } else { Wire.write(0x35); // 0x37 is default reg value } return Wire.endTransmission() == 0; }
Video :-
0 Comments
Newer
Older
ESP32 Led Blink With Push Button
ESP32 Interfacing With LDR Sensor
How To Make RFID & Keypad Based Door Lock
ESP32 Interfacing With Ultrasonic Sensor
ESP32 And Fingerprint Sensor Based Biometric Door Lock Security System
Arduino WorkShop
How to Make Gas Leak Detector & Auto Exhaust Fan Using Arduino
Door Lock Security System Using Arduino
Vehicle Accident Alert System Using Accelerometer GPS And GSM
Plant Watering System With The ESP8266 | Blynk App
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
0 Comments