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.

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

Wolf: Search and  Rescue Multi-Terrain Robot
Advanced
  • 401
  • 10

Full instructions

Wolf is an IoT multi-terrain robot running on the Arduino 101 platform.

Sweep 3D Scanner
Advanced
  • 1,987
  • 36

Work in progress

A complete hardware and software kit for creating full spherical 3D scans with a sweep scanning LiDAR sensor.

Sweep 3D Scanner

Team Scanse

Caravaggio, a Drawing Machine
Advanced
  • 5,608
  • 40

Caravaggio is a drawing machine able to replicate a digital image using a pen and a continuous line.

Mycroft AI Furboid
Advanced
  • 206
  • 5

Work in progress

I am using Hasbro's 1998 Furby, a Raspberry Pi Zero W, Pimoroni Explorer pHAT, and the Mycroft AI to make a fun robo assistant.

Animatronic Tail by circuito.io
Advanced
  • 507
  • 5

Full instructions

Our first wearable project (!) is an animatronic tail with dual-control. No animals harmed in the making of this project.

Smart Parking
Advanced
  • 1,796
  • 18

it system that managing cars access to parking place by using Rfid Technology

Smart Parking

Team Hadramoot

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback