You are on page 1of 11

Step 5Assembling the Electronics Controller -- Part 2 Step 6Assembling the Electronics Controller -- Part 3

Part 3 -- Assembling the Keypad Controller The keypad controller will control the three relays which in turn "press" the buttons on the keypad to send the "ERROR" sms or any other SMS you need to send. I built it on a scrap piece of perfboard using PCB-friendly (whose pins are meant to be soldered on to circuits) 5v relays. The circuit diagram below shows the connecting of the parts in order. Circuit Index: Q1, Q2 and Q3 are 2N2222 transistors. D1,D2 and D3 are 1N 4001 snubbing diodes. R1, R2 and R3 are 1K current limiting resistors. K1, K2 and K3 are the 5 volt relays. The base of the transistors are connected to the Arduino's digital pins via 1K resistors to limit the current draw from the pins. The snubbing diodes prevent any power spikes from the relay coils frying the circuit.

The collectors of the transistors are connected to a common ground shared by the Arduino. The emmiters are connected to the anode of the diodes as shown in the second circuit diagram below.

Step 7Assembling the Electronics Controller -- Part 4

Part 4 -- Connecting the bits and pieces

Now that we are finished assembling the parts of the circuit, it is time to connect them all up.refer to the provided diagram and do the following things: 1. Attach the Keypad controller's pin 1,2 and 3 to Arduino digital pins 4,5 and 6 respectively. 2. Attach the relay controller's "relay control" wire to the Arduino digital pin 3. 3. Connect the LDR's wires to GND, 5v and analog 0, as explained in step 5. 4. Connect the wires from the TIP 31 to the phone's vibrator motor terminals. 5. Attach the Keypad controller's 5v and GND to the respective Arduino pins. 6. Connect the power LED to the 3v and GND.(if additional power LED is attached) 7. Connect the relay controller's 9v and GND to the Arduino's respective pins.

8. Connect the MCB sensor's wires to GND, 5v and analog 2, as explained in step 3. 9. Attach the previously soldered keypad wires to the keypad controller. 10. Connect a 9v power supply to the Arduino and set the power jumpers to "EXT" Confirm once more with the circuit diagram that everything is attached to the proper pins before continuing. You may zip-tie everything up once you test that everything is OK.I did not do it, so it looks rather messy, but I plan to do this when I get time.

Step 8Wiring the Cellphone

This step is different for every mobile phone, but the basics are same.We will attach the two wires from the 240v relay controller to the phones's vibrator motor connections and also connect up the relays from the keypad controller in this step. You need to find out whether the mobile has the feature to send draft messages to a saved number,

if not you're out of luck and you need to get another mobile. Almost all Nokia mobile phones have this feature, and they are also easy to modify. The first thing to try with the phone is to find out what are the minimum number of different buttons you have to press to send the drafts message, start to finish. The number of buttons you need are the number of relays you need on the keypad controller circuit. I needed only two buttons, but still I kept an extra relay on the board, just in case. We will wire the relays switching pins to the keypads buttons so that they can be operated by the Arduino. Before starting to modify the phone, make sure that you have altered the main menu listing on the phone so that you have to use the least number of buttons on the keypad.Also make shure that the phone is set to "Vibrate Once", on receiving an SMS. Solder on the connections from the relay pins to the keypad as shown and clearly mark it out (colour coding , etc.) so that connecting to the Arduino is easy.I used some ribbon cable as it looks neat and orderly. We will remove the vibrator motor and solder the two wires from it to the LED-LDR circuit and reassemble the phone to complete this step. The video below shows the booting up process of the Phone after modification

Step 9Installing the Firmware onto the Arduino

The only thing to do in this step is to copy the sketch to your computer and to upload that to the Arduino. The code is not at all well written, but it does work and I am ALWAYS welcome to sugesstion, bug reports and anything else you wish to tell me about. You will need to change the SMS_error function to suit your phones menu system. Feel free to PM me for any help.Remember to add another HIGH/LOW combo if you need to press an extra button to wake the phone from standby. The code is attached below(GSM_irrigation2_0a.pde) and am not going into the details of uploading a sketch to the Arduino as there are many tutorials on the net teaching you to do the same. I suggest you learn a bit more about Arduino coding, if you don't know how to upload a sketch, before starting this project.

GSM_irrigation2_0a.pde3 KB Step 10Changing your Phone's Settings

You need to change the settings on the phone and change some with your SIM card provider so that no junk SMSs are received. I used a new SIM card, I did not disclose the number to anyone and I suggest you do the same to avoid unwanted calls/SMSs The first step would be to register yourself on the operator's DND(Do Not Disturb) list for calls and SMSs. That would prevent any telemarketing calls from making your system go bonkers! Then set the following settings on your phone: 1. Set the "Vibrate Once" alert type for SMS received. 2. Change the main menu order so that the SMS menu is on top of the list.(optional) 3. Delete all SIM card (NOT phone) contacts and keep only one number saved under any name. (Phone number of the person who will receive the "error" SMS)

Step 11Finish it all up

The last step is to connect the electronics controller to the mains controller. We will cut and attach the Mains wire from the plug to to the relay using 2 Spade connectors and the other connector will go to the Mains circuit box while the Neutral and Ground wires are routed via the electronics enclosure to the Mains circuit box Solder everything,screw everything into place, give a final check, close the top of the enclosure and we are done!!!!

Step 12Testing!!
i

Well we're done constructing it and now comes the exciting part. Switching ON and OFF: Attach the 9v connector to the Arduino,attach the power plug to the mains socket and switch 'er ON!! If nothing happens???? >> Go to the last step But if everything powers on OK and you see the little green Power LED >> Huzzah!! Connect a load (I used an aquarium air pump just for the sake of variety) to the Mains's circuit's socket, set the MCB to 'ON' position and then insert the SIM card into the phone and power it up. Connect its charger to a wall socket too. Send a SMS to the phone number and if the LED flashes on receiving the SMS, and the relay is switched on by the Arduino, we are DONEEEEEEEE!

You need to connect the irrigation pump to the wall socket on the MCB box to control it. Any other appliance can be SMS controlled via this socket. Sending the Error SMS: Trip the MCB by hand to see the little relays clicking,controlled with the Arduino.The phone should display an SMS being sent to the pre-saved number.The "kat" sound at the beginning of the video is the MCB getting tripped and we can clearly see "Message Sent"

Step 13Troubleshooting

If nothing happens when you power the system up, see that: 1. The Arduino power jumper is set to "EXT" or external power. 2. The power adapter you use is not faulty. 3. The Arduino is not faulty. If the Arduino powers on and the code isn't executed, check that: 1. You have uploaded the code properly, if not, reinstall the code. 2. Your Arduino is not faulty. 3. The USB cable is not faulty. 4. All connections are connected properly. ( check step 7) If still your problem is not solved, PM me for help.

ARDUINO CONTEST WINNERS THE MONTHLY CHALLENGE: AUDIO HACKS MAKE IT MOVE