ESP32 SIM800L | Send and Receive SMS to Control Relay

  Переглядів 29,242

Ahmad Logs

Ahmad Logs

3 роки тому

In this video I will show you how to control relay module with ESP32 SIM800L by using Arduino IDE. When you want to control AC load connected to the relay, you will have to send an SMS to control the AC load (fan, bulb). You will also receive a response SMS showing the status of the relay (ON or OFF). You do not need of TTGO ESP32. I am using sim800l GSM module with esp32. Also you do not need any Arduino library with this esp32 GSM module project. This is a simple esp32 home automation project to control home appliances from anywhere in the world using sim800l GSM module and relay module.
--------------------------------------------------------------------------------------------------------------------
Parts Buy Links (Affiliate Links)
--------------------------------------------------------------------------------------------------------------------
1. ESP32 - amzn.to/3YCq2dS
2. SIM800L GSM Module - amzn.to/3l6rKGP
3. Relay Module - amzn.to/3l1aoem
4. 18650 3.7v Rechargeable Battery - amzn.to/3ZAxV51
--------------------------------------------------------------------------------------------------------------------
Useful Video Links
--------------------------------------------------------------------------------------------------------------------
Sim800L MIT App Inventor Relay Control
• GSM Based Home Automat...
--------------------------------------------------------------------------------------------------------------------
Social Media Links
--------------------------------------------------------------------------------------------------------------------
GitHub:
github.com/ahmadlogs/
UKposts:
ukposts.info?sub...
--------------------------------------------------------------------------------------------------------------------
Download Code
--------------------------------------------------------------------------------------------------------------------
github.com/ahmadlogs/arduino-...
--------------------------------------------------------------------------------------------------------------------
Disclaimer
--------------------------------------------------------------------------------------------------------------------
Disclaimer: All videos are for educational purposes and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.
Warning: I will use High Voltages which if incorrectly or improperly used could result in serious injuries or death. So be careful of what you are doing because I will take no responsibility for any of your actions.
Warning: In some countries it is required to register gsm module from govt authorities before using it. So, get proper understanding of govt laws related to gsm technologies.
#esp32 #sim800l #homeAutomation

КОМЕНТАРІ: 103
@suyashmirajkar7857
@suyashmirajkar7857 Рік тому
No words man.. you did every possible things with sim800L. and you provide openly.. salute to your efforts. we understand how much time you spend to doing this... thank you...
@AhmadLogs
@AhmadLogs Рік тому
Thanks a ton
@heilmannsvej
@heilmannsvej Рік тому
nice projekt but after power los i need to reset the esp 32 board. is there a way to solve this problem
@passaw7
@passaw7 2 роки тому
THANKS!! Your sketch is working with esp32 and sim800L. Its help me.
@AhmadLogs
@AhmadLogs 2 роки тому
Glad it works
@user-nd1ol2vw9h
@user-nd1ol2vw9h 6 місяців тому
Hi Ahmad, I did step by step the project, but when I send "Relay1 on" nothing happens and in serial monitor I can see: AT+CMGR=36, +CMGR: "REC Unread", "+my phone number", "", "date, time", Relay1 on. Could you advise what type of error is it? Have you faced with the issue?
@gulzaibkhan6913
@gulzaibkhan6913 2 роки тому
Hello, nice video brother. Can you kindly let me know if we can connect the GSM SIM800L module with node MCU ESP32 using the same configuration? And the code? We want to get the GSM internet, 2g/3g signals from the sim and use it with ESP32. kindly help
@AhmadLogs
@AhmadLogs 2 роки тому
yes you can. I did not test it. but it must works with nodemcu esp32
@OUTER50UL
@OUTER50UL 9 місяців тому
hey rather than AC power would using just the relay be able to remotely power off a PC or a TV(something with a soft off button) ?
@AhmadLogs
@AhmadLogs 9 місяців тому
yes you can
@anas.ghouila
@anas.ghouila 2 роки тому
Greatt job! i've a question: it is possible and safe to supply the gsm module with battery 5v and 10000 mAh ?
@AhmadLogs
@AhmadLogs 2 роки тому
most of sim800l works with 3.4v to 4.4v. there are just few sim800l that works on 5v. if you provide 5v to sim800l it does not work properly. try to provide between 3.3 to 4.4v
@anas.ghouila
@anas.ghouila 2 роки тому
@@AhmadLogs should i power it with a battery 3.7 v and 7000 mAh?
@AhmadLogs
@AhmadLogs 2 роки тому
@@anas.ghouila yes, I am using 7800mAh
@bbdas52
@bbdas52 Рік тому
its ok, but i need SIM800L with esp32 connected with wifi relay for distance light
@retrohd1_
@retrohd1_ Рік тому
Help! I don't get a reply message from the sim800L module. I have used a 3.7V LiPo Battery with the SIM800L. ESP32 is powered by the USB port. Red light is constantly blinking on the sim800L with 3 second intervals. Both LEDs on ESP32 are turned on. I am using a jazz sim. I am using the helical antenna that came with the module.
@AhmadLogs
@AhmadLogs Рік тому
It mean your module is working fine. I think there is some issue with your rx and tx connections. 1. your sim card must have balance or you activate sms bundle. 2. Try changing the baud rate 3. check your rx and tx connection, Try to connect without breadboard
@retrohd1_
@retrohd1_ Рік тому
@@AhmadLogs UPDATE: It worked! 😄 I made the ground common and set the baud rate to 115200. Thankyou!!! I wanted to use this in a bigger project for long distance communication.
@AhmadLogs
@AhmadLogs Рік тому
@@retrohd1_ bravo
@alessiom
@alessiom 2 роки тому
Great video, Can you know if the module works with thingsmobile SIM?
@AhmadLogs
@AhmadLogs 2 роки тому
unfortunately not.
@user-pb6ly4qh9b
@user-pb6ly4qh9b 2 роки тому
How many lamps can I control at the same time or each one in sequence?
@AhmadLogs
@AhmadLogs 2 роки тому
you may use 8 channel or even 16 channel relay module with external power to relay module. you also need to modify the code for your number of relays
@renwanangozy3394
@renwanangozy3394 Рік тому
hello dear Sorry I had a question I want to control an electrical device through esp32 and GSM800L by phone my code and things all worked well the first time but then sent a delay complaint the problem is with GSM or esp32 if you can help me I would be grateful
@AhmadLogs
@AhmadLogs Рік тому
give me some more detail. what do you mean by sent a delay conplaint?
@alimoaz
@alimoaz 2 роки тому
Hi, Please reply!!! I have been stuck for day on my GSM module SIM800L. I have tried using JAZZ 4G,2G, UFONE and ZONG sims but is not connecting to the network. I tried using using this exact code and wiring connecting and powered my GSM module with 3.7 volts lithium battery. Kindly tell me what should I do? PS. I have even registered my GSM module with PTA. I am also using only helical antenna which is soldered on the connector pin.
@AhmadLogs
@AhmadLogs 2 роки тому
most of the time it is power issue. which battery you are using to power sim800l
@alimoaz
@alimoaz 2 роки тому
@@AhmadLogs The LED on SIM800L is blinking after each second. I am using the battery "ICR18650P-TS13" which gives 3.7V.
@AhmadLogs
@AhmadLogs 2 роки тому
@@alimoaz try to use a capacitor (470uf 25v). connect capacitor negative pin to sim800l ground and capacitor positive pin to sim800l vcc pin.
@alimoaz
@alimoaz 2 роки тому
@@AhmadLogs okay now the markets are closed... I will do this first thing in the morning and let you know about the result
@AhmadLogs
@AhmadLogs 2 роки тому
ok
@moussaab8292
@moussaab8292 3 роки тому
Please, I have a problem when writing pineMode (7,OUTPUT) The relay works directly without typing HIGH
@AhmadLogs
@AhmadLogs 3 роки тому
you must use normally closed (NC) and common (COM) pin to connect ac load.
@moussaab8292
@moussaab8292 3 роки тому
@@AhmadLogs The relay is closed immediately when writing pinMode
@AhmadLogs
@AhmadLogs 3 роки тому
@@moussaab8292 after pinMode() function, on the next line add digitalWrite() to send HIGH signal to control the relay.
@moussaab8292
@moussaab8292 3 роки тому
@@AhmadLogs Thank you for helping me the relay no longer closes but does this affect the code while writing it in void loop
@AhmadLogs
@AhmadLogs 3 роки тому
@@moussaab8292 no it does not. have you test the relay without any micro-controller?
@user-qs3wl7fo7t
@user-qs3wl7fo7t 3 роки тому
👍👍👍👍👍👍👍💪
@AhmadLogs
@AhmadLogs 3 роки тому
thanks
@nagarava
@nagarava 2 роки тому
Sim800l working on 2g sim ?, now all the operators using 4 g Sims only what can I do?
@AhmadLogs
@AhmadLogs 2 роки тому
then you might use sim900A
@karandahiwale8770
@karandahiwale8770 2 роки тому
Can we do the same with nodemcu and gsm800
@AhmadLogs
@AhmadLogs 2 роки тому
no, you need to modify the code
@yusufgedik8511
@yusufgedik8511 Рік тому
Hello. I want to add DHT 11 temperature sensor in this code, but I couldn't, can you help me?
@AhmadLogs
@AhmadLogs Рік тому
1. Connect the DHT11 sensor to your Arduino 2. Download and install the DHT library for Arduino from the Arduino IDE library manager. 3. Include the DHT library at the beginning of your code by adding this line: #include 4. Define the DHT11 sensor pin by adding this line at the beginning of your code: #define DHTPIN 2 5.Initialize the DHT11 sensor by adding this line to your setup() function: dht.begin(); 6. Read the temperature and humidity values from the DHT11 sensor by adding this code to your loop() function: float humidity = dht.readHumidity(); float temperature = dht.readTemperature(); 7. Send the temperature and humidity values to the SIM800L module by adding this code to your loop() function: sim800l.print("AT+CMGS="+1234567890" "); // Replace with your phone number sim800l.print("Temperature: "); sim800l.print(temperature); sim800l.print("C, Humidity: "); sim800l.print(humidity); sim800l.write(26); Note: Replace the phone number in the code with your own phone number. Also, adjust the code to fit your specific project requirements.
@yusufgedik8511
@yusufgedik8511 Рік тому
@@AhmadLogs when i send dht11 sms send me the values ​​as sms same as role hungry
@celtafrancisco5336
@celtafrancisco5336 Рік тому
I'm getting this type of error: invalid conversion from 'int' to 'SerialMode' [-fpermissive]
@AhmadLogs
@AhmadLogs Рік тому
This is just a syntax error. You have made changes in the code, and you have added some invalid code in the main sketch. I will have to take a look at your code to figure out the issue
@BABATECHNICALKNOWLEDGE
@BABATECHNICALKNOWLEDGE 2 роки тому
Nice video esp32 communicate with sim 800 but relay output not working plz help me relay not on or off
@AhmadLogs
@AhmadLogs 2 роки тому
please give me some details
@BABATECHNICALKNOWLEDGE
@BABATECHNICALKNOWLEDGE 2 роки тому
@@AhmadLogs thanks for reply OK what details you need I send you
@BABATECHNICALKNOWLEDGE
@BABATECHNICALKNOWLEDGE 2 роки тому
@@AhmadLogsserial monitor show i send msg relay1 on but relay also is on
@AhmadLogs
@AhmadLogs 2 роки тому
@@BABATECHNICALKNOWLEDGE have you connected the relay correctly?
@ghstrider100
@ghstrider100 3 роки тому
Sir kia aap received message ko aik variable me save karna bata sakte hain.. Btw I subscribed nice video!
@ghstrider100
@ghstrider100 3 роки тому
Mere paas bhi SIM800L hai
@AhmadLogs
@AhmadLogs 3 роки тому
I have save sms in one variable. read the code carefully, message is stored in "msg" variable.
@AhmadLogs
@AhmadLogs 3 роки тому
@@ghstrider100 hmmmm....
@ghstrider100
@ghstrider100 3 роки тому
Sir can you make a tutorial on just to save a message in a variable? That would be so helpful
@AhmadLogs
@AhmadLogs 3 роки тому
@@ghstrider100 OK, I will try to make a video on it soon.
@nouuchhiengsung31
@nouuchhiengsung31 3 роки тому
Can you tell me about AT comment to delete all sms
@AhmadLogs
@AhmadLogs 3 роки тому
at+cmgd=1,4
@lamismohamed1350
@lamismohamed1350 Рік тому
can i use the code with gsm sim900a ?
@AhmadLogs
@AhmadLogs Рік тому
dtmf ukposts.info/have/v-deo/gKFijn2Ojplhxmg.html
@mehdidehghanian8365
@mehdidehghanian8365 Рік тому
Hi I got this eror 👇 Use of undeclared identifier 'parseDada' Use of undeclared identifier 'extractSms' Use of undeclared identifier 'doAction' Use of undeclared identifier 'Replay' Please help me, i need to fixed for my project
@AhmadLogs
@AhmadLogs Рік тому
you have made some severe change in the code. that's why you are facing the issue. so download and use the fresh copy of the code
@crazytronics9917
@crazytronics9917 2 роки тому
I follow the same but the serial monitor shows me another data
@AhmadLogs
@AhmadLogs 2 роки тому
can you please tell me what data is displaying in the serial monitor
@crazytronics9917
@crazytronics9917 2 роки тому
@@AhmadLogsI have tried serial port 1 & 2 but both are printing the same
@AhmadLogs
@AhmadLogs 2 роки тому
@@crazytronics9917 what is printing on serial monitor
@crazytronics9917
@crazytronics9917 2 роки тому
@@AhmadLogs guru meditation error load prohibited
@crazytronics9917
@crazytronics9917 2 роки тому
@@AhmadLogs i have sent you the pics of serial monitor on your facebook
@fazlerabbie2808
@fazlerabbie2808 11 місяців тому
can i use the code in esp8266
@AhmadLogs
@AhmadLogs 10 місяців тому
no. watch this for esp8266 ukposts.info/have/v-deo/b3OJoIWHh32Vr2g.html
@killgroth8092
@killgroth8092 Рік тому
I try it so many times but is not replying me everytime i send sms and nothing happens on relay huhu help me
@AhmadLogs
@AhmadLogs Рік тому
what displayed in serial monitor
@alirezasarrami1955
@alirezasarrami1955 2 роки тому
hi can i use this code for esp32 wrover
@AhmadLogs
@AhmadLogs 2 роки тому
yes, It must work
@alirezasarrami1955
@alirezasarrami1955 2 роки тому
@@AhmadLogs tanx
@AhmadLogs
@AhmadLogs 2 роки тому
@@alirezasarrami1955 so nice of you
@alirezasarrami1955
@alirezasarrami1955 2 роки тому
@@AhmadLogs hi again i use your library to connect whit sim800l but UARAT pin's are Different in esp32 WROVER i changed the pin's but it did not work what should i do ? is sim800l work whit UART or virtual UART in your library?
@AhmadLogs
@AhmadLogs 2 роки тому
@@alirezasarrami1955 sim800l works both with hardware serial and software serial. have you sim800l working? may be issue with power supply for sim800l
@esp3263
@esp3263 Рік тому
Excelent! One remark: For me the "senderNumber = buff.substring(0, 13);" was too short, my phone number has 14 digits.
@Gusfus128
@Gusfus128 Рік тому
exact. That happens to me too. How did you solve it?
@esp3263
@esp3263 Рік тому
@@Gusfus128 --> senderNumber = buff.substring(0, 14); and next line: --> buff.remove(0,20); worked for me.
@Gusfus128
@Gusfus128 Рік тому
@@esp3263 thanks!!
@AhmadLogs
@AhmadLogs Рік тому
then you can use buff.substring(0, 14); you also need to change the subsequent substring function as well
@EL90291
@EL90291 10 місяців тому
Will this work with esp8266 ?
ESP32 SIM800L: Send Text Messages (SMS Alert) with Sensor Readings
6:47
GSM Based Home Automation | Sim800L MIT App Inventor Relay Control
11:58
Самый большой бутер в столовке! @krus-kos
00:42
Кушать Хочу
Переглядів 6 млн
🐩🐕
00:25
Янчик
Переглядів 1,9 млн
NodeMCU ESP8266 Blynk IOT with SIM800L using Blynk App and SMS
10:31
Sending and Receiving SMS with a SIM800 GSM Module - Tutorial (#124)
26:44
ESP32 Publish Data to Cloud without Wi-Fi (TTGO T-Call ESP32 SIM800L)
7:55
Как заставить работать SIM800L
6:58
arduinoLab
Переглядів 46 тис.
SIM800L Blynk | How to Control Relay with Sim800L and Blynk App
7:20
GSM RELAY Control from  Registered Number Call
11:46
Saravanan AL
Переглядів 38 тис.
GSM/GPRS based GPS Tracker using Blynk with Calling & SMS features
9:05
SIM800L GSM Made easy -AT commands Dial & SMS
12:44
Saravanan AL
Переглядів 73 тис.
Самый большой бутер в столовке! @krus-kos
00:42
Кушать Хочу
Переглядів 6 млн