This was a hobby project from 2 years ago. I believe this is among the worst components i've delt with and i would generally not recommend this to anybody. This was developed to manage your home lights via SMS in a secure fashion. This code for me personally was quite reliable, though i must admit it was poorly written.
- SMS Control
- Light status checking
- DTMF tone
- Password protection
- Voice feedback
- Auto retry
This code was made for the following hardware, but as a tinkerer you should be easily able to configure it for your own personal usecase
- Arduino due
- SIM800 GSM module
- 2 Channel relay module
and the pinout follows:
- RELAY 1 (52)
- RELAY 2 (53)
- SIM800 TX (Serial3 RX)
- SiM800 RX (Serial3 TX)
password=YOUR_PASSWORD*COMMAND>PHONE_NUMBERPHONE_NUMBER is used for feedback via sending an SMS/calling to your phone number
here is an example
password=YOUR_PASSWORD\*r1=tThis sets relay1 to turn on
or
password=YOUR_PASSWORD*statust>+1234567890you'll get a response of
r1=on
r2=offeven more
password=YOUR_PASSWORD*statusc>+1234567890- The system calls your phone number
- Waits 45 seconds to answer
- Upon answering it tells you "relay one on" (or "off") and same for relay two
password=YOUR_PASSWORD*statusct>+1234567890- System calls your phone number
- Upon answering you can use your phone keypad to 2.1. Press 1 => toggle relay 1 and the same for relay 2
Set
if (text.indexOf("PASSWORD") != -1)to your password of choice
Main Functions
relayManager(String info)
Parses SMS commands Updates relay states Controls GPIO pins
callStatusManager()
Initiates automated status call Announces relay states via TTS Handles call failures with retry logic
liveCallStatusManager()
Initiates interactive control call Listens for DTMF tones (keypad presses) Toggles relays based on user input Provides voice feedback
relayManager(ATManager &atManager, HardwareSerial &serial)
Main SMS processing loop Password verification Command routing