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!

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

Give feedback

Comments

Similar projects you might like

Wildlife Detector
Advanced
  • 603
  • 12

Device detects motion, then takes a picture of triggering wildlife. Uses a neural net to identify the wildlife species and does something

Solar Power Module V2
Advanced
  • 1,626
  • 24

Full instructions

Single board to control solar charge and battery monitoring for your outdoor projects. Your project will see a perpetually charged battery.

MEGA BREAD - Hank the Hexabot
Advanced
  • 222
  • 4

Work in progress

A 6 legged, 18 servo, self guiding time wasting project. MEGA BREAD series #7, Delivery and retrieval from the air project.

Baby Room Watcher
Advanced
  • 342
  • 7

Full instructions

Monitor what happening in the baby room when we are not present there and send an SMS to the parent when motion is Detected.

Tracking TV Stand
Advanced
  • 523
  • 8

Full instructions

The Tracking TV Stand uses a Walabot to angle a monitor in the optimal angle for viewing depending on the audience in the field of view.

Smart Mirror with Home Automation using chats
Advanced
  • 1,234
  • 22

Full instructions

The mirror which shows news with date, calendar and quotes. Home automation can be controlled by Telegram chat.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Feedback