There is no proper article or instructable available which details you every step used to build up a GSM enabled switch to control your home appliances . Thus this instructable demonstrates a way to control your home appliances using your mobile phone. Since the mobile phone uses GSM service so it is called a GSM enabled switch.
THINGS REQUIRED :
1. Arduino UNO
2. SIM 900 GSM Cellular Shield For Arduino
3. 4 channel Relay Module
4. Jumper Wires
5. Cell phone
6. Sim Card
Step 1: Interfacing the 4 channel relay module
A relay is an electrically operated switch.
Relay breakout module is a smart choice for controlling higher current loads from your microcontroller development board, PC parallel port or Arduino. The relays are driven by popular darlington array ULN2803A . This darlington transistor provide sufficient output to be driven by the arduino digital output.
Connect the V pin to 5V and the GND pin to the corresponding GND of the Arduino. The darlington IC pins are marked 1-n (n here is the number of relay the darlington IC is driving) connect them to the digital output pins of arduino The relay have three terminals N/O(NORMALLY OPEN) , N/C(NORMALLY CLOSED), COM.
One of the AC terminals which is conventionally connected to a manual switch is connected to the COM terminal and the other is connected to the N/O terminal.The pins marked IN1,IN2....IN8 are used for driving the corresponding relay ,connect these to the digital output pins of the arduino.
Step 2: Interfacing the SIM900 GSM cellular module for arduino
1. Power: The Linksprite shield we use needs 5V up to 2A into the onboard DC socket.
2. Antenna. If your module does not have an antenna - get one.
3. SIM: Turn off the PIN lock on the SIM card. The easiest way to do this is to put the SIM in a handset and use the menu function.
We will use the Arduino software serial library and the Linksprite shield has hard-wired the serial from the SIM900 to a set of jumpers, and uses a default speed of 19200. jumpers are to be set to the "SWserial" side.
And thus whenever an instance of SoftwareSerial is created, we use 7,8 as shown below:
SoftwareSerial SIM900(7, 8); // RX, TX
1. Insert the SIM and lock the SIM card to the carrier on the bottom of the shield as shown in the figure.
2. Then plug the shield into your Uno, attach 5V power to the DC socked on the GSM shield, and USB from the Uno to the PC.
3. Press the "PWRKEY" button on the side of the shield for a second.
4. The bright "STATUS" LED will be on, and then the "NETLIGHT" LED will blink once every 800 milliseconds- until the GSM module has found the network, at which point it will blink once every three seconds.
Step 3: Software
The first command to use is AT+CMGF=1 which sets the SMS mode to text (as used in the previous example)
The second is AT+CNMI=2,2,0,0 - which tells the GSM module to send the contents of any new SMS out to the serial line.
The program works in two stages.
First it will wait for an SMS to be received, and then have the contents sent to the Arduino via serial .
The next stage is to filter out the commands in the text message
The commands (that is, the contents of your text message to the Arduino) will be in the form #ON1 or #OFF1 where ‘ON’ will be switching on the bulb 1, 2, 3 and 4 will relate to digital pins 7, 8, 12 and 13. For example, to turn on D7, you would compose your SMS as #ON1.
After processing the SMS we use the AT command AT+CMGD=1,4 to delete all the SMSs from the SIM card, otherwise it will fill up and reject further commands.
When D7,D8.. are HIGH it switches on the corresponding relay to complete the circuit and hence the bulb is on.