Arduino Forum

Using Arduino => Project Guidance => Topic started by: AbdullahZubair on Apr 22, 2012, 09:12 am

Title: Wireless communication from Arduino to PC
Post by: AbdullahZubair on Apr 22, 2012, 09:12 am
Hello people,
Need your help
I need to communicate from my arduino to PC,wirelessly. Bluetooth was costly,so we bought 2.4GHZ RF modules from robosoft systems
http://www.robosoftsystems.co.in/roboshop/cc2500-wireless-module.html
How do I program the arduino,this module has only tx and rx pins.
Should i just connect the rx tx pins of arduino(pin no. 1 and 2) to those of the module? How do I set the baud rate?
Help me out.

Thanx
Title: Re: Wireless communication from Arduino to PC
Post by: Steen on Apr 22, 2012, 09:26 am
if you took a good look on that page you would have found this:
http://www.robosoftsystems.co.in/roboshop/media/catalog/product/pdf/RFpro%20Module%20-%20how%20to%20use%20v4%20.pdf

it's a pdf in which everything is described
Title: Re: Wireless communication from Arduino to PC
Post by: michael_x on Apr 22, 2012, 06:41 pm
Quote
pdf in which everything is described

... except how to connect the PC side module to a PC with USB only ... ;)

If that's easy for you, and if you're sure the module uses TTL level (5V) signals, then search for Arduino's SoftwareSerial  library. I'd keep pins 0,1 for testing/deugging using the standard USB connection. At least until all works fine.

Not sure if you can use these modules to load sketches into the Arduino. Hope this isn't your goal.
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on Apr 28, 2012, 07:17 pm
Thanx for the help guys,
I had seen that pdf.
I am communicating from Arduino to PC. No programming is required at the PC. Need to program the arduino. They have given a code for a microcontroller,can any one translate it for me.

I connected the transmitter's TX pin to Arduino's TX pin(pin#1), should i write my data to the TX pin or should i just make the TX pin High and use Serial.print.
Can any one tell me what is the use of TX pin and how to send the data?

Urgent help required. :(
Title: Re: Wireless communication from Arduino to PC
Post by: dhunt on Apr 28, 2012, 09:55 pm

Thanx for the help guys,
I had seen that pdf.
I am communicating from Arduino to PC. No programming is required at the PC. Need to program the arduino. They have given a code for a microcontroller,can any one translate it for me.

I connected the transmitter's TX pin to Arduino's TX pin(pin#1), should i write my data to the TX pin or should i just make the TX pin High and use Serial.print.
Can any one tell me what is the use of TX pin and how to send the data?

Urgent help required. :(


Those modules have an RS232 interface suitable for direct connection to a PC. It's not suitable for direct connection to an Arduino. You'll need a level shifter like this one http://www.sparkfun.com/products/8780 (http://www.sparkfun.com/products/8780), or a MAX232 (http://www.maxim-ic.com/datasheet/index.mvp/id/1798).
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on Apr 28, 2012, 10:10 pm
Yeah i used max 232.
Okay I am using this code now

void setup()
{
Serial.begin(9600);
}

void loop()
{
int anlogvalue=analogRead(0);
Serial.println(analogvalue);
delay(10);
}


I will connect the tx of the transmitter to the tx pin of arduino.
Will the data be transmitted?
Title: Re: Wireless communication from Arduino to PC
Post by: Cheezey on Apr 29, 2012, 02:19 am

Yeah i used max 232.
Okay I am using this code now

void setup()
{
Serial.begin(9600);
}

void loop()
{
int anlogvalue=analogRead(0);
Serial.println(analogvalue);
delay(10);
}


I will connect the tx of the transmitter to the tx pin of arduino.
Will the data be transmitted?


If I were you, I would try it first.
However, I noticed an error in your code:
Code: [Select]
int anlogvalue=analogRead(0);
Serial.println(analogvalue);


You missed an 'a' in the first 'analogvalue'.
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on Apr 29, 2012, 06:30 am
Quote
If I were you, I would try it first.
However, I noticed an error in your code:
Code:

int anlogvalue=analogRead(0);
Serial.println(analogvalue);


You missed an 'a' in the first 'analogvalue'.


Thanx man.
Yeah i will try. :)
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 01, 2012, 06:24 pm
Hello abdullah my name is mohammed junaid...actually i have a project in which iam using arduino mega 2560 and cc2500 wireless module..I would like to know how you actually communicated from the arduino to the pc...if u could give the example code it would be really helpful..the project submission is this week so urgent reply needed..thankyou!!
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on May 01, 2012, 10:26 pm
Hey junaid,are you using cc2500 directly?
We used a RF module which has cc2500 embedded in it.
Its a readymade chip and comes with only three pins rx,tx and ground. You just need to connect it to tx rx of arduino via a level shifter like max 232 and a simple code with serial.print will transmit the data, the receiver module directly connects to the pc via rs 232 port

But if u are using cc2500 module independently , i guess u will have to do a little more.

Hope it helped,btw where you from?
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 02, 2012, 09:13 am
abdullah Iam from bangalore...and iam using the same module shown in the pdf ...i  have one wireless module connected to the arduino mc on the bot..that has to send a signal when ever the bot changes the direction..that signal should be received by the pc..which also has the same wireless module attached to it through a rs232 usb to serial convertor..
so hence how do i  send and access these values..
and could u show a example code for it..its urgent
Thankyou!!
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on May 02, 2012, 11:41 am
Well junaid, this module is directly compatible with pc,you dont need max 232 or any other converter.
But you need max 232 at the bot side.
So its like ur Arduino---->MAX 232----->RF Module.
And at the PC,RF Module---->PC
Once you are done with conditions, try this code
Yeah i used max 232.
Okay I am using this code now

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println(1);
delay(100);
Serial.println(0);
delay(100);
}

And if u have downloaded the terminal program given by robosoft, you will see the output.
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 02, 2012, 02:53 pm
Thanks a lot Abdullah for your response...i will try this out and hope it works..thanks once again..!!
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 03, 2012, 02:59 pm
Hey abdullah ,i thot the next time i would send a post it would say 'module working"  but seems tt would take a while..
I bought  MAX232 today and the one question that popped up was, how do i connect the arduino and rf module through this..
cant i directly connect the Tx pin of the rf moudle to the RX pin of the arduino board and vice versa...??
iam a comp science student so dont have much idea about these devices..please help..!!
Thankyou!!
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on May 03, 2012, 04:12 pm
http://chuckontech.com/wp-content/uploads/2011/09/Max232.jpg

pin no. 7 and 8 to rx and tx of rf module

pin no. 9 and 10 to rx tx of arduino

Connect the capacitors and 5v supply

it should work inshallah
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 11, 2012, 02:45 pm
Salaam abdullah i have made the connections as u have mentioned allhumdollilah the pc side module works fine but the transmitter rf module connected on the bot is not transmitting the cahracters specified in the arduino code  do we have to mention the tx and rx pins in the code for that?
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on May 11, 2012, 03:18 pm
Nope,you need not,is the power led of the transmitter module on? Is the other LED blinking?
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 12, 2012, 01:24 pm
yes both the led's one of the configuration mode and other of the power led..both the transmitter rf module and the receiver have two led's glowing but the tr/rf led does not glow
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on May 12, 2012, 03:05 pm
hey junaid pm me with ur emailid,will forward u some documents that may help you.
Title: Re: Wireless communication from Arduino to PC
Post by: mdj1342 on May 12, 2012, 07:03 pm
Hello abdullah..my mail id is " mdj.1342@gmail.com " ..so in the code do we need a special command that tells the arduino to send the data wirelessly or whatever it prints on the serial monitor automatically is sent thru the cc2500 rf module to the pc side receiver.?..too much confusion..  monday is the submission now,... :smiley-roll-sweat:
Title: Re: Wireless communication from Arduino to PC
Post by: AbdullahZubair on May 12, 2012, 10:04 pm
Check ur mail junaid