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

Intelligent Community Alerts Beacon [-iCAB-]
Advanced
  • 311
  • 11

A cloud connected alert system that parses local alert feeds ranging from weather to missing persons and provides visual and audio feedback.

Power Lunch
Advanced
  • 161
  • 7

Full instructions

An insulated food container divided into two sections by a thermoelectric cooler module for quickly heating one side and cooling the other.

Power Lunch

5 members

Wifi controlled ceiling fan
Advanced
  • 169
  • 5

Full instructions

My young children were not tall enough to pull the chains on the ceiling fan, to turn on the fan & light. Alexa, turn on the 'Boys Light'.

Suicide Prevention Gun Safe Locking System
Advanced
  • 1,232
  • 4

Full instructions

An IoT device that helps prevent gun suicides through safe monitoring, only allowing access to a safe through a request/approval process.

Smart Home System [AHCS]
Advanced
  • 171
  • 2

Full instructions

Very easy and effective home automation system based on PIC16F877A. Control home appliances remotely and monitor fire and break-ins.

Smart Home System [AHCS]

Team Infinity Tech

Magia Transformo - The Dance of Transformation
Advanced
  • 167
  • 1

Magia Transformo is a playful physical experience with digital augmentations.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login