Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Sensor-transceivers-pic 16f877a-gsm

Status
Not open for further replies.

aadebola5

Newbie level 4
Newbie level 4
Joined
Aug 12, 2013
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
87
please i need a guide on how to interface a pir sensor with a rf315MHz transmitter, and how to interface the rf315MHz receiver with the PIC16F877A, and how to interface the PIC with my gsm module (SM5100B-D)..i dont know if a PIC is needed with the transmitter to send the data to d receiver.. please i dont really know much on this am kind of new to these...and i have been reading some materialls on how to intterface and program this project but dey are not really helping..lease i need help from y guys...thanks
 

do one thing first start to study about that sensor,tx,rx,and microcontroller (hardwere,softwere)k then u ll get some knowledge then u tried to do your self (just imagine and do it k) then u ask others for help bcz i faced same problem...
 

please i need assistance on these codes am goin to paste now, the function of the code is to switch on the LED wirelessly if a motion us detected i used CCS to write the code but it is givin me errors..please i need help..thanks

the transmitting side

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "C:\Users\Adebola\Documents\project\pic prog\motion_rf.h"
//all these # below set up the PIC
//#include <16F877A.h>
//#device adc=8
#FUSES NOWDT      //No Watch Dog Timer
#FUSES HS         //Highspeed Osc > 4mhz
#FUSES PUT        //Power Up Timer
#FUSES NOPROTECT  //Code not protected from reading
#FUSES NODEBUG    //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP      //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD      //No EE protection
#use delay(clock=20000000)              // Sets crystal oscillator at 20 megahertz
#use rs232(baud=4800, xmit=PIN_C6, rcv=PIN_C7) //Sets up serial port output pin & baud rate
#define PIR_SENSOR PIN_A0
#define TRS PIN_C6
#define sw PIN_A1
 
 
 
void uart_send(unsigned char data);
 
 
void main()
{
   BRGH = 0;
   SPBRG = 255;
   TX9 = 0;
   TXEN = 1;
   SYNC = 0;
   SPEN = 1;
 
  set_tris_a(0xff);
  set_tris_c(0x00);
 
 
   setup_adc_ports(AN0);
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
 
   while(true)
   {  set_adc_channel(0);
      delay_us(20);
 
 
      if(PIR_SENSOR==0 && sw==0){
      output_high(PIN_C6);
      }
      else{
         output_low(PIN_C6);
      }
 
 
}
}
 
void uart_send(unsigned char data)
{
   while(TXIF==0);
         TXREG=data;
}



the receivers side

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "C:\Users\Adebola\Documents\project\pic prog\motion_receiver.h"
//all these # below set up the PIC
//#include <16F877A.h>
//#device adc=8
#FUSES NOWDT      //No Watch Dog Timer
#FUSES HS         //Highspeed Osc > 4mhz
#FUSES PUT        //Power Up Timer
#FUSES NOPROTECT  //Code not protected from reading
#FUSES NODEBUG    //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP      //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD      //No EE protection
#use delay(clock=20000000)              // Sets crystal oscillator at 20 megahertz
#use rs232(baud=4800, xmit=PIN_C6, rcv=PIN_C7) //Sets up serial port output pin & baud rate
#define RCV PIN_C7
#define RED_LED PIN_B7
 
 
void uart_rec(void);
 
 
void main()
{
   BRGH = 0;
   SPBRG = 255;
   SPEN = 1;
   RX9 = 0;
   CREN = 1;
   
   set_tris_c(0xff);
  set_tris_b(0x00);
   
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   
    while(true)
   {  set_adc_channel(0);
      delay_us(20);
 
 
      if(RCV==0){
      output_high(PIN_B7);
      }
      else{
         output_low(PIN_B7);
      }
 
}
 
unsigned char uart_rec(void) {
 
         unsigned char rec_data;
         while (RCIF==0);
         rec_data = RCREG;
         return rec_data;
}

 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top