Recently I have been doing a lot of IOT projects, mostly Bluetooth and WIFI modules based, but since then I wanted to move on and start making my projects SMS or phone call control which is almost too simple GSM module, however, a problem arose ... They are expensive! And it made me think a phone is just a GSM module with more features and I have a few phones, just use one of them as a GSM module and this is what we will be looking at in this project the irrigation system.
Now we realize the following circuit:
Whenever a phone receives an SMS or Phone call it either lights up, buzzes or makes a sound. Now knowing this we can take advantage of these features with an Arduino, we will do this by tapping into the phones rumble motor which is used to make it and then use an Arduino to read data and see when the speaker is supplied power thus allowing the Arduino to see went the phone receives an SMS or phone call. This, of course, isn't as good as having a real GSM module as you can see what data is coming through or be able to send data back but it is a cheap option if you have a bunch of phones just lying around collecting dust.
here is the code used to control the phone keypad:// www.youssefbahanni.com int roteur=2; int down=3; int one=5; int option=4; int action=6; char c; void setup(){ Serial.begin(9600); pinMode(roteur,OUTPUT); pinMode(down,OUTPUT); pinMode(one,OUTPUT); pinMode(option,OUTPUT); pinMode(action,OUTPUT); c=0; } void loop() { int Message_R = analogRead(A0); Serial.println(Message_R); if(Message_R>40&&c==0){ delay(200); digitalWrite(action,HIGH); digitalWrite(roteur,HIGH); delay(500); digitalWrite(roteur,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(one,HIGH); delay(500); digitalWrite(one,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(2000); c=1; } Message_R = analogRead(A0); Serial.println(Message_R); if(Message_R>40&&c==1){ delay(200); digitalWrite(action,LOW); digitalWrite(roteur,HIGH); delay(500); digitalWrite(roteur,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(one,HIGH); delay(500); digitalWrite(one,LOW); delay(500); digitalWrite(one,HIGH); delay(500); digitalWrite(one,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(500); digitalWrite(option,HIGH); delay(500); digitalWrite(option,LOW); delay(2000); c=0; } }
To program the android application I used the Mit App Inventor platform. It uses a graphical user interface (GUI) very similar to the programming languages Scratch (programming language) and the StarLogo, which allows users to drag and drop visual objects to create an application that can run on android devices, while a App-Inventor Companion (The program that allows the app to run and debug on) that works on iOS running devices are still under development. In creating App Inventor, Google drew upon significant prior research in educational computing, and work done within Google on online development environments.
here is the programming result:
Finally you can show the simulation:
Good work
ReplyDeleteI would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... Arduino library for Proteus
ReplyDelete