Wireless Data Transmission

Bluetooth, XBee, RF......

Wireless Data Transmission

Postby PIGBAOBAO » Sun Oct 31, 2010 11:44 am

Hi friend,

I am doing a wireless data transmission base on Cytron DIY project by using cytron product. I am using 315MHz transmitter and receiver and PIC16F877A in my project. Now I was developed a program (mikro-c compiler) and simulated successful for my RF receiver part. Below is my receiver side program;

CODE: SELECT_ALL_CODE
// LCD module connections
sbit LCD_RS at RD4_bit;
sbit LCD_EN at RD5_bit;
sbit LCD_D4 at RD0_bit;
sbit LCD_D5 at RD1_bit;
sbit LCD_D6 at RD2_bit;
sbit LCD_D7 at RD3_bit;
sbit LCD_RS_Direction at TRISD4_bit;
sbit LCD_EN_Direction at TRISD5_bit;
sbit LCD_D4_Direction at TRISD0_bit;
sbit LCD_D5_Direction at TRISD1_bit;
sbit LCD_D6_Direction at TRISD2_bit;
sbit LCD_D7_Direction at TRISD3_bit;
// End LCD module connections

#define   click_button   RA1

unsigned int num;
char string1[]= "Welcome";
char string2[]= "Final Year Project";
char string3[]= "Wireless Data Transmission";
char string4[]= "Thank You";

char *string;

void Move_Delay() { // Function used for text moving
Delay_ms(500); // You can change the moving speed here
}


 void main() {
  int i=0;
  TRISA = 0xFF;             //configure PORTA as input
  TRISB = 0xf0;             //configure PORTB as input
  PORTC = 0;                //LED
  TRISC = 0;
  TRISD = 0;
  PORTD = 0x00;
  TRISD = 0x00;

Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,3,"Wireless Data");
Lcd_Out(2,4,"Transmission");
Delay_ms(3000);
Lcd_Cmd(_LCD_CLEAR); // Clear display

while(1)
{
if((portb.f0==0)&&(i==0))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,7,string1);
i++;
}
if((portb.f0==0)&&(i==1))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,1,string2);
i++;
}
if((portb.f0==0)&&(i==2))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,1,string3);
i++;
}
if((portb.f0==0)&&(i==3))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,1,string4);
i=0;
}
}
}



But, the problem is I am confused and not understand about how is a transmitter program should be i used for make the receiver part operate by using RF since the Transmitter part cannot be shown how it work if simulated in Proteus Professional. Can you give me some suggestion or idea about my problem and if can give me a example of transmitter based on my program above?

Could my project going successfully without using UART (UART_write and UART_read) in both transmitter and receiver program?

Thanks for your help, I am really appreciate it! :D Regard!
PIGBAOBAO
Freshie
 
Posts: 6
Joined: Sun Oct 31, 2010 10:54 am

Re: Wireless Data Transmission

Postby KSW » Sun Oct 31, 2010 4:26 pm

How r u going to use ur RF module set??? From ur code, i just see u want to display these message only oo??
char string1[]= "Welcome";
char string2[]= "Final Year Project";
char string3[]= "Wireless Data Transmission";
char string4[]= "Thank You";

then RB0_bit r u going to connect to a switch?? and where is ur transmitter gonna to place?? Can specify a bit?@@
KSW
Novice
 
Posts: 21
Joined: Fri Jul 30, 2010 10:32 pm

Re: Wireless Data Transmission

Postby PIGBAOBAO » Sun Oct 31, 2010 5:56 pm

Dear friend,

The reason why i put a switch and make the character display in LCD in the receiver side (program) instead of put the switch in transmitter, it is because i want to make sure the receiver part can build successful in operation by mikro-c compiler. (Operate if receive the digital switch signal.)

(*since the transmitter side we never know how it's function when we are simulated in Proteus Professional so I assumed the switch in receiver side is transmitter signal.)

Here is my transmitter side source code,
CODE: SELECT_ALL_CODE
///////////////////////////////////////////////////
#define   click_button   RA0

char *string;
unsigned int adc_rd;

 void main() {

  unsigned int num;

char string1[]= "Welcome";
char string2[]= "Final Year Project";
char string3[]= "Wireless Data Transmission";
char string4[]= "Thank You";

  TRISA = 0x3F;             //configure PORTA as input
  TRISB = 0x00;             //configure PORTB as output
  TRISC = 0x00;             //configure PORTC as output

  num=0;

    while(click_button == 1)
    {
        num++;
        if(num > 3)
           num=0;
        Delay_ms(1000);
    }

}

///////////////////////////////////////////



So is it work??Is it my concept wrong? Will the RF module continuous send and read signal and only work if any signal is exist? Sorry for my English...
PIGBAOBAO
Freshie
 
Posts: 6
Joined: Sun Oct 31, 2010 10:54 am

Re: Wireless Data Transmission

Postby robosang » Mon Nov 01, 2010 9:34 am

Whole long list of source code, can you please use the proper tools to share the code?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Wireless Data Transmission

Postby PIGBAOBAO » Mon Nov 01, 2010 10:08 am

Dear friend,

Sorry for inconvenience. It is because i think that's easy for preview, since i am newbiew in c-language and yet mikro-c compiler so I am hope you all can help me check whether the coding is work or not and if i was proceed my rf project without using UART interface and what is the result???

My project is a easy wireless rf project. What is my project want to do is when i pressed a pushbutton in transmitter there will be a digital signal transmitted to receiver and show the character in LCD display.

Can anyone help me in my preview question and if can give me coding(mikro-c compiler) with similar to my project except from the PR16??
PIGBAOBAO
Freshie
 
Posts: 6
Joined: Sun Oct 31, 2010 10:54 am

Re: Wireless Data Transmission

Postby shiyan » Mon Nov 01, 2010 9:32 pm

:shock:
User avatar
shiyan
Amateur
 
Posts: 189
Joined: Wed Jun 09, 2010 10:59 am

Re: Wireless Data Transmission

Postby ober » Tue Nov 02, 2010 2:30 pm

PIGBAOBAO WROTE:Dear friend,

Sorry for inconvenience. It is because i think that's easy for preview, since i am newbiew in c-language and yet mikro-c compiler so I am hope you all can help me check whether the coding is work or not and if i was proceed my rf project without using UART interface and what is the result???

My project is a easy wireless rf project. What is my project want to do is when i pressed a pushbutton in transmitter there will be a digital signal transmitted to receiver and show the character in LCD display.

Can anyone help me in my preview question and if can give me coding(mikro-c compiler) with similar to my project except from the PR16??


Hi, please go through our forum rules and regulations if you are new. Pasting source code is not encouraged as non of us is code debugger or checker. If it is unavoidable please use proper tools to share it.

As for your project, the nature of low cost RF module is open to noise/interference, I would still recommend you to send data/signal in uart format and even in better is you could use package format, the discussion here might help you.

Good luck and do let us know the progress.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Wireless Data Transmission

Postby shahrul » Sun Nov 07, 2010 4:58 am

PIGBAOBAO WROTE:My project is a easy wireless rf project. What is my project want to do is when i pressed a pushbutton in transmitter there will be a digital signal transmitted to receiver and show the character in LCD display.

Can anyone help me in my preview question and if can give me coding(mikro-c compiler) with similar to my project except from the PR16??

You state that is easy project. So, why you request for coding? You just learn for your self.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor


Return to Wireless Device

Who is online

Users browsing this forum: No registered users and 41 guests