Site icon Ercan Koçlar

433 Mhz RF Receiver-Transmitter MikroC Library

433mhz-rf-alici-verici-verici-modul-kapak

433mhz-rf-alici-verici-verici-modul-kapak

This post is also available in: Türkçe (Turkish)


 


Radio Frequency Transmitter and Receiver

433 Mhz RF Transmitter Module
433 Mhz RF Receiver Module

Module Type

433 Mhz RF Module Types – Although some elements are different, they all work the same way.

Frequency and Power

Antenna

There are ready antennas and SMA connectors for 433 MHz.

SMA connector. The middle leg is the connecting part and the other legs are attached to the chassis.

System Type

433mhz-rf-alici-verici-tam-dubleks                                                                                                                   “image is taken from e-book Aydın Bodur Radyon Mühendisliği Notları””

 

General Notes and Cautions

Module Pins And Their Functions

Receiver Module Pins

433 Mhz Receiver Module Pins
Pin Pin Adı Description
1 DGND Digital GND  Connected to power source
2 DATA Digital Data Output- Connected to PIC
3 NC
4 Vcc +5v Feeding
5 Vcc +5v Feeding- Left empty. no connection shall be made
6 GND RF gnd – Never connect to the ground of circuit
7 GND RF gnd – Never connect to the ground of circuit
8 ANT Antenna input

Transmitter Module Pins

433mhz-rf-alici-verici-verici-modul-PIN
Pin Pin Name Description
1 ANT Antenna connection shall be made
2 GND Connected to Circuit GND
3 DATA Data input is done here – connected to PIC
4 Vcc +5-12 Volt feeder is connected

Circuit Scheme

433 Mhz RF Devre Şeması

Necessary Materials

  1. 433 Mhz Transmitter Module
  2. 433 Mhz Receiver Module
  3. Perforated Pertinax Board
  4. 433 Mhz Antenna
  5. SMA Connector

Making Circuit


The appearance of a full duplex unit / receiver and transmitter have separate antennas
Full duplex unit view / Separate antennas for receiver and transmitter – Side View

433 Mhz RF Module MikroC Library

Heap Space Separation for MicroC Dynamic Memory

Functions

 

RF_433MHZ_ILETISIM_BASLAT Function

Function : void RF_433MHZ_ILETISIM_BASLAT(unsigned char SENKRON_BIT_SAYISI)

Purpose: Sends mixed data, which wakes up the receiver before sending the data and makes it synchronized.

Parameters:

Usage:

RF_433MHZ_ILETISIM_BASLAT(150);//Send 150 sets of synchronous data

Feedback : Does not do feedback

 

-RF_433MHZ_VERI_GONDER Function

Function : void RF_433MHZ_VERI_GONDER(unsigned char *VERI,unsigned char DIZI_SAYISI,unsigned char CRC7_POLINOM,unsigned char ON_TANIMLAMA_KODU)

Purpose: Sends data to the receiver

Parameters :

Usage:

 erc[0]=1;
 erc[1]=3;
 erc[2]=5;
 erc[3]=7;
 erc[4]=9;
 erc[5]=10;
 erc[6]=12;
 erc[7]=14;
 erc[8]=16;
 erc[9]=18;

RF_433MHZ_VERI_GONDER(erc,10,0b10001001,21);

Feedback : Does not do feedback.

 

-RF_433MHZ_VERI_AL Function

Function : unsigned char RF_433MHZ_VERI_AL(unsigned char *VERI_HATASI,unsigned char DIZI_SAYISI,unsigned char CRC7_POLINOM,unsigned char ON_TANIMLAMA_KODU)

Purpose : It reads the data sent by the transmitter

Parameters  :

Usage:

do{
    x=RF_433MHZ_VERI_AL(&hata,30,0b10001001,21);//&error handling is used to read the internal pointer
  }while(hata ==1 || hata ==255) //  check whether there is a crc error in the parity bit with the error variable
//the data sent can be read from variable x

Feedback :

Functions Application

Basic Command Submission

//RECEIVER CODES//
//IT WILL BE USED FOR UART RECEIVER PIC
 sbit UART_RX at RC7_bit;
 sbit UART_TX at RC6_bit;
 sbit UART_RX_Direction at TRISC7_bit;
 sbit UART_TX_Direction at TRISC6_bit;

void  main()
{
    unsigned char erc[1];
    unsigned char hata;
    unsigned char x;

    ADCON1=13;
    CMCON=7;



do{
     x=RF_433MHZ_VERI_AL(&hata,1,0b10001001,29);

   }while(x!=125);

// operation to be performed after command
//TRANSMITTER CODES//
//IT WILL BE USED FOR UART TRANSMITTER PIC
 sbit UART_RX at RB2_bit;
 sbit UART_TX at RB3_bit;
 sbit UART_RX_Direction at TRISB2_bit;
 sbit UART_TX_Direction at TRISB3_bit; 



void  main()
{
    unsigned char erc[1];
    unsigned char i=0;

    
    ADCON1=13;
    CMCON=7;


 erc[0]=125;
   

   RF_433MHZ_ILETISIM_BASLAT(50);
   for(i=0;i<40;i++)
     {     
       RF_433MHZ_VERI_GONDER(erc,1,0b10001001,29);
     }

Data Transfer

//RECEIVER CODES//
//IT WILL BE USED FOR UART RECEIVER PIC
 sbit UART_RX at RC7_bit;
 sbit UART_TX at RC6_bit;
 sbit UART_RX_Direction at TRISC7_bit;
 sbit UART_TX_Direction at TRISC6_bit;

void  main()
{
    unsigned char txt[7],erc[30];
    unsigned char hata,y=0;// stringe çevrim için oluşturuldu
    unsigned char i=0,j=1,k=0,t=0,z=0,w=0;

    unsigned char *x;
    ADCON1=13;
    CMCON=7;


SAP1024_INIT(248,128,6);//GLCD analysis command

//first data reading
do{
     x=RF_433MHZ_VERI_AL(&hata,30,0b10001001,21);
  }while(hata ==1 || hata ==255);//error control
    
//read data is printed on the screen
for(l=0;l<30;l++)
  {
   
  ShortTostr(x[l],txt);
  res = Ltrim(txt);//erases space on the left side of data
  SAP1024_YAZI_YAZMA(j,i,res);//GLCD writing on the screen command
  i++;
  if(i>16){j=j+3;i=1;}//GLCD de column line setting

  }
         
erc[0]=255;

//notification of data receipt
RF_433MHZ_ILETISIM_BASLAT(150);
for(k=0;k<250;k++)
   {
     RF_433MHZ_VERI_GONDER(erc,1,0b10001001,20);
   }
}
//IT WILL BE USED FOR UART TRANSMITTER PIC
 sbit UART_RX at RB2_bit;
 sbit UART_TX at RB3_bit;
 sbit UART_RX_Direction at TRISB2_bit;
 sbit UART_TX_Direction at TRISB3_bit; 



void  main()
{
    unsigned char txt[7],erc[30];
    unsigned char hata,y=0;// created to transform into string
    unsigned char i=0,j=1,k=0,t=0,z=0,w=0;

    unsigned char *x;
    ADCON1=13;
    CMCON=7;
  
    //LED's port settings to be switched on after confirmation
    trisb.rb1=0;
    portb.rb1=0;

 //the data sequence was written in this way for clarity. of course, the "for" loop will make more sense
 erc[0]=1;
 erc[1]=3;
 erc[2]=5;
 erc[3]=7;
 erc[4]=9;
 erc[5]=10;
 erc[6]=12;
 erc[7]=14;
 erc[8]=16;
 erc[9]=18;
 erc[10]=1;
 erc[11]=3;
 erc[12]=5;
 erc[13]=7;
 erc[14]=9;
 erc[15]=10;
 erc[16]=12;
 erc[17]=14;
 erc[18]=16;
 erc[19]=18;
 erc[20]=1;
 erc[21]=3;
 erc[22]=5;
 erc[23]=7;
 erc[24]=9;
 erc[25]=10;
 erc[26]=12;
 erc[27]=14;
 erc[28]=16;
 erc[29]=18;

   
   RF_433MHZ_ILETISIM_BASLAT(150);//first the wake-up signals are sent
   for(k=0;k<250;k++)//data is sent 250 times because of the size of the data
     {  
       RF_433MHZ_VERI_GONDER(erc,30,0b10001001,21);
     }
  
//anticipation of a confirmation command
  do{
     x= RF_433MHZ_VERI_AL(&hata,1,0b10001001,20);
    }while(x[0]!=255);
    


  portb.rb1=1;// the LED connected to the port lights up after confirmation

}
Sending 30 bit data with 433 Mhz RF receiver and transmitter full dublex system and getting a confirmation code

Experiment Video


 

Result


Library Files

 


References


 

This post is also available in: Türkçe (Turkish)

Exit mobile version