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.

Is is possible to design a remote control using nRF24L01 and PIC16F628?

Status
Not open for further replies.

pradeep_k_b

Full Member level 3
Full Member level 3
Joined
Dec 21, 2011
Messages
160
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,306
Location
Nilambur, India
Visit site
Activity points
2,509
Hi,I have already designed a RF remote control using 433Mhz RF transmitter&receiver + pic16f628.And this remote control is working fine.Now I am trying to replace the 433Mhz RF transmitter&receiver with nRF24L01 tranciever.But when I bought this one seems entirely different from the old RF transmitter and receiver.Actually I am trying to extend the range of remote control by using 4 nRF24L01 and I want to use 2 of them as repeaters.My idea is like this,there will be 4 units,the first one will be transmitter and the last one receiver,the remaining two will act as repeater

Transmitter-->>repeater-->>repeater--->>receiver ,

The two of them (repeaters) need to receive the signal and want to transmit again the same signal.In this way i think I will be able to increase the range.This is why i decided to replace 433Mhz one with nRF24L01

If you don't mind let me ask you something,

How to connect nRF24L01 to PIC16F628?
Can I use the same code here that I used for 433MHz?.Or can I modify that code easily to a nRF24L01 compatible one?

I am attaching the code(I am not great in coding and I wrote this with the help of my friend)


Transmitter

Code:
void main()
    {
     int keyPressed;
     TRISA = 0xFF;              //set all pin of port A as an input
     PORTA = 0x00;
     TRISB = 0x00;              //set all pin of port B as an output
     PORTB = 0x00;
     CMCON = 0x07;
     UART1_Init(9600);          // initialize UART module
     Delay_ms(100);



     while(1)
        {
          keyPressed = PORTA; //
          Delay_ms(20);  // software debouncing time
          keyPressed = keyPressed & 0x1F; // masking higher 3 bits

          switch(keyPressed)

                {
                   case 0x1E:  UART1_Write('F'); Delay_ms(500);break;
                   case 0x1D:  UART1_Write('B'); Delay_ms(500);break;
                   case 0x1B:  UART1_Write('R'); Delay_ms(500);break;
                   case 0x17:  UART1_Write('L'); Delay_ms(500);break;
                   case 0x0F:  UART1_Write('S'); Delay_ms(500);break;
                 }

    }
          }

Receiver

Code:
unsigned int receive;

void main()
{

    TRISA = 0x00;              //set all pin of port A as an input
    TRISB = 0b00000010;              //set all pin of port B as an output
    PORTB=0x00;
    UART1_Init(9600);          // initialize UART module
    Delay_ms(100);

    PIE1.RCIE = 1;  //
    PIR1.RCIF = 0;
    INTCON.GIE = 1;
    INTCON.PEIE = 1;


   while(1);
}



void Interrupt(void)   //
{
unsigned char receive0x00;

 if(PIR1.RCIF)        //
 {

 receive = UART1_Read();

 switch(receive)
      {

         case 'F': PORTA.F0=1; Delay_ms(500);PORTA.F0=0;break;   // Switching On and Off a particular port pin with 100ms delay
         case 'B': PORTA.F1=1; Delay_ms(500);PORTA.F1=0;break;
         case 'R': PORTA.F2=1; Delay_ms(500);PORTA.F2=0;break;
         case 'L': PORTA.F3=1; Delay_ms(500);PORTA.F3=0;break;
         case 'S': PORTA.F4=1; Delay_ms(500);PORTA.F4=0;break;
        }
  }

}

I'd greatly appreciate if you could help me
 

As a part of a festival here I want to use some temporary street lights.I need a total of 2km range,and there will be lights in every 150m range.So I am planning to fix a repeater in every 150m with each light and it will act as a repeater+it can use to turn on/off the light too.I am planning to design a 16 channel remote control.There will be one transmitter and 13 or 14 repeater.
 

@arun_190175 but I think SPI can use with pic16F128

@milan_rajik..Yes,I know I already checked that one.But I need to use a receiver in every 150m.And with the normal nrf24l01 we will get around 150m.And also if I can design a system like this then I will be able to extend the range to 3 or 3.5km if required easily
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top