Very low signal area? Simple remote control solution required? Tired of unexpected complications? In this IoT-driven world, some oldies but goldies implementations as this relay(s) controlled by SMS still takes the spotlight. Forget fancy implementation, just KISS!
Activate and release relay(s) contacts, commands confirmation and SMS originator number authentication... let's go.
- in this project we've used Polulu 2-Channel SPDT Relay Carrier with 5VDC Relays; using a pair of those shields, and enabling four channel compiling directive, you may obtain very fast a four channel relay driven by SMS;
- both xyz-mIoT versions (M95FA and BG96) can be used. For second one, just activate the BG96 compiling directive in the Arduino schetch.
1 / 3 • xyz-mIoT M95FA version
Additional Hardware References
SMS Relay Controller Hardware Integration (Wiring)
For relay shields having 5V relays, wire as shown below.
xyz-mIoT by itbrainpower.net shield wiring with two relays [5V] - board
HINT, for 12V relays: Relay shield Vin pin (in above picture, it's the RED wire on the right side, marked +5V) should be connected to +12V power source and the GND pin should be connected to both xyz-mIoT GND and 12V power source GND.
SMS Relay Controller Arduino Software
- download "xyz-mIoT shields Arduino class" from: here. Expand the archive and follow the install instructions.
- Make a folder named "SMS-relay-controller". Download the code from: SMS relay controller - control relay(s) via SMS Arduino code and save it in one file named "SMS-relay-controller.ino" inside folder created previously.
- download "xyz-mIoT kickstart for Arduino" from: here. Expand the archive and copy "XYZMIOT_basic_lbr.h", "XYZMIOT_basic_lbr.ino", "XYZMIOT_SMS_lbr.h" and "XYZMIOT_SMS_lbr.ino" in previously created folder.
- In schetch line 29, update the phoneNumber value with your phone number (will act as MASTER number - only messages received from this number will be processed). Save.
- Select xyz-mIoT shield board and programming port. REMINDER: In order to be able to upload the code, you must press twice (fast) xyz-mIoT shield RESET switch [the board will enter programming mode].
Arduino, select board and programming port
- Now, you may compile and upload the code to your xyz-mIoT shield. Debug messages can be seen in Serial Monitor [115200bps, 8N, 1].
SMS Commands Accepted by Relay Controller
- Two relays version send relay0, relay1 where relayX can be 1 for activate relay, or 0 for release relay [SMS example.: 1, 0 - this meaning: Relay 0 activated and Relay 1 released]
- Four relays version send relay0, relay1, relay2, relay3 where relayX can be 1 for activate relay, or 0 for release relay
Relay controller originated / reply messages
- At BOOT, the relay controller will send "BOOT" message to MASTER number;
- In case of accurate commands, the controller will reply with received command + content defined in variable executed;
- In case of messages parsing error, the controller will reply with a sort of help message [defined by notunderstand variable content];
- Messages received from unknown SMS originator will be simply discarded, no reply;
TUTORIAL PROVIDED WITHOUT ANY WARRANTY!!! USE IT AT YOUR OWN RISK!!!!
Originally published by me on itbrainpower.net projects and how to section.