Things used in this project

Schematics

Circuit Diagram of the first version
Hackspace 3

Code

PIC C Code for the first versionC/C++
#include <18f4455.h>
#use delay(clock=12000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)
#fuses HS,NOWRT,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP,NOCPD,NODEBUG
#use fast_io(A)// enhances self i/o settings
#use fast_io(B)
#use fast_io(C)
#include <string.h>// header file
#include <input.c>
int i,u,a,b,counter=1,toggle;
char data[20],data1[20],data2[20],data3[20],test[12],mem[12],req[12];
void main()
{
set_tris_c(128);
set_tris_b(0);
output_b(255);
set_tris_d(0);
output_d(0);
delay_ms(500);
printf("at+cmgf=1;+cnmi=2,3,2,2,1\r"); /* This puts the phone in text
mode and enables notification sending */
i=getch(); // \
u=getch(); // \
gets(data); // \
// |-Extract and silent the initial sent instruction
i=getch(); // /
u=getch(); // /
gets(data1);// /
back:
if(kbhit()) //Run the subsequent codes when there is a new data
{
welcome:
if(counter==200) // \_ Re-initialise the counter
counter=0; // /
gets(data2);
62
gets(data3);
b=0;
for(a=1;a<=6;a++)
{
req[b]=data3[a];
b++;
}
strncpy(mem,req,4);
strcpy(test,"RING"); /* The control string which the phone sends when
there is a phone call */
if(strncmp(mem,test,4)==0) //check if the notification is for phone
ringing
{
counter++; //Increment the counter
toggle=counter%10;
if(toggle==5)
{
output_high(PIN_D4); //put 5V on the D4 pin
printf("at+cmgs=\"08064702218\"\r");
printf("appliance is switched on");
putc(26);
}
if(toggle==0)
{
output_low(PIN_D4); //set pin D4 to 0V
//delay_ms(5);
printf("at+cmgs=\"08064702218\"\r");
//delay_ms(50);
printf("appliance is switched off");
putc(26);
//delay_ms(10);
}
}
goto welcome;
}
goto back;
}

Credits

4aa8a4c592c43a010a9973277f5a47fd
Michael Olafusi

A tech enthusiast.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Hank the HexaPod - Mega Bread Robotics Series # 7
Advanced
  • 187
  • 5

Work in progress

After a few months of gathering parts, reading about the new hardware, and ripping my hair out due to no support. I done did it Paw.

Punch Activated Arm Flamethrowers (Real Firebending)
Advanced
  • 43,932
  • 339

Shoot fireballs from your fists when you throw a punch with these arm mounted smart flamethrowers!

Get Nostalgic and Use Nokia 84x48 LCD with Arduino
Advanced
  • 3,190
  • 14

Protip

These 84 by 48 pixel LCDs are what you might have found in Nokia 3310. And what about using them in the Arduino projects?

GPS + WiFi Rover
Advanced
  • 1,503
  • 14

Full instructions

An outdoor rover, capable of autonomous navigation (using GPS and sonar sensors) or controlled over WiFi.

Smart Energy Monitor Based on Arduino
Advanced
  • 454
  • 3

Full instructions

Open source Smart energy monitor with some new features like "Terminal Commands " , "Readings Logger", "Data Plotting ".

Identifying Birds Using Machine Learning
Advanced
  • 501
  • 5

Full instructions

We use the Intel Edison to record bird vocalizations and pass them to a predictive model to identify four bird species from the recordings.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog