monika
Apr 9 2008, 3:06 AM
I have to establish a wireless link between a PC and a pic microcontroller using Bluetooth USB dongle or a bluetooth module.The data from the micro will travel to another micro again through wireless communication.
PC<----->PIC MICRO<----->PIC micro.
I am not able to decide which protocol to use(RFCOMM,L2CAP,...)
Do the bluetooth modules available have the protocols inbuilt or it will be embedded in the the code of the micro.
also wat sort of interface shud i go for in terms of cost?
this micro--->RS232---->bluetooth. or micro--->MAX3124E---->BLuetooth USB
how shud i decide a particular PIC for this particular project?
If anybody has worked on this kind of project before please guide me.
PC<----->PIC MICRO<----->PIC micro.
I am not able to decide which protocol to use(RFCOMM,L2CAP,...)
Do the bluetooth modules available have the protocols inbuilt or it will be embedded in the the code of the micro.
also wat sort of interface shud i go for in terms of cost?
this micro--->RS232---->bluetooth. or micro--->MAX3124E---->BLuetooth USB
how shud i decide a particular PIC for this particular project?
If anybody has worked on this kind of project before please guide me.
Ajay
Apr 9 2008, 8:16 AM
i think bluetooth modules avalable in market comes with on board protocol stack. You need to look in nearest market. Decision of pic controller to be used depends on how complex is your design. Which intern depends on type of module.
if you just need to make a simple wireless communication link between pc and controller then why don't you use rf modules available in market? They are really good for this.
if you just need to make a simple wireless communication link between pc and controller then why don't you use rf modules available in market? They are really good for this.
isha gupta
Apr 9 2008, 11:06 PM
I am also working on a similar project. i have to establish this link over a distance of 1 km. I have found some options for this purpose
1: http://www.lemosint.com/scripts/bluetooth_dongle_class1.asp
2:making a host controller interface USB on PIC itself and then using a usual bluetooth USB adapter easily available in the market.
3: also sparkfun has some readily available bluetooth modules.
but am not able to decide on which one to go for.
out of these 2nd one is the cheapest option but in that case the bluetooth driver(bluetooth protocol stack) need to be written.
I am not sure if i'll have to write the driver in 1st and the last case or not but i think i wont have to...wat do u say?
And i dont knw how to start with it. if any of you knows how to develop a complete driver implementing 'Bluetooth Stack" please help me.
You can tell me some links to it or may be any book if you know...
1: http://www.lemosint.com/scripts/bluetooth_dongle_class1.asp
2:making a host controller interface USB on PIC itself and then using a usual bluetooth USB adapter easily available in the market.
3: also sparkfun has some readily available bluetooth modules.
but am not able to decide on which one to go for.
out of these 2nd one is the cheapest option but in that case the bluetooth driver(bluetooth protocol stack) need to be written.
I am not sure if i'll have to write the driver in 1st and the last case or not but i think i wont have to...wat do u say?
And i dont knw how to start with it. if any of you knows how to develop a complete driver implementing 'Bluetooth Stack" please help me.
You can tell me some links to it or may be any book if you know...
sashijoseph
Apr 10 2008, 6:24 AM
The 1st option would be the easiest as the module already has the bt stack.
The 2nd option would be really difficult unless you use sth like the MAX3124 or a uc with a built in master usb(most usb 'enabled' micros are just slaves).So atleast you don't have to study the whole usb spec and write a USB stack.You still have to write the bt stack though.
btw National too has a serial module with stack implemented.Probably you could get a sample.
The 2nd option would be really difficult unless you use sth like the MAX3124 or a uc with a built in master usb(most usb 'enabled' micros are just slaves).So atleast you don't have to study the whole usb spec and write a USB stack.You still have to write the bt stack though.
btw National too has a serial module with stack implemented.Probably you could get a sample.

shyam
Apr 10 2008, 7:57 AM
@IshaG
bluetooth communication over a 1 KM range????
i missed something here isnt it??
bluetooth communication over a 1 KM range????
i missed something here isnt it??
shyam
Apr 10 2008, 8:04 AM
y r u people going for bluetooth????


sashijoseph
Apr 10 2008, 8:41 PM
shyam wrote ...
@IshaG
bluetooth communication over a 1 KM range????
i missed something here isnt it??
Yup ..... they're providing a patch antenna for increased coverage.Wonder whether it really works error-free in noisy,trying conditions though.
IshaG
Apr 11 2008, 3:29 PM
@shyam
I have to establish wireless communication as depicted:
PC<----->uc1<---->uc2<----->uc3<------>........<------>uc20(say). over a distance of 1 km.
i.e. each micro will be communicating with adjacent micros only.PC will be communicating only with uc1 only.I have to make a secure wireless communcation. and bluetooth is good security wise.
I think this can be done using bluetooth modules....wat do u say?
@sashijoseph
I think i'll go for Bluetooth----->RS232 module which has embedded bluetooth stack on it.
but dont knw hw to begin writing the driver code on the PIC.?:-(
and only directing tha data to the PC's COM port will be sufficent for the PIC to recieve it wirelessly or dis will also require some system software on PC .
Please help me guyz with watever u can..thanks a ton....
I have to establish wireless communication as depicted:
PC<----->uc1<---->uc2<----->uc3<------>........<------>uc20(say). over a distance of 1 km.
i.e. each micro will be communicating with adjacent micros only.PC will be communicating only with uc1 only.I have to make a secure wireless communcation. and bluetooth is good security wise.
I think this can be done using bluetooth modules....wat do u say?
@sashijoseph
I think i'll go for Bluetooth----->RS232 module which has embedded bluetooth stack on it.
but dont knw hw to begin writing the driver code on the PIC.?:-(
and only directing tha data to the PC's COM port will be sufficent for the PIC to recieve it wirelessly or dis will also require some system software on PC .
Please help me guyz with watever u can..thanks a ton....
Ajay
Apr 11 2008, 11:26 PM
Monika and IshaG looks like you both have got a similar project or you are working in same class
Still i want to say.. a simple RF module is enough.. you can define your own encryption algorithm before sending data to other uC and while receiving decrypt the data. Also you can add authentication before data is accepted.
Well do think over it.. Its much better method and cost effective solution. Final decision is still yours..
Still i want to say.. a simple RF module is enough.. you can define your own encryption algorithm before sending data to other uC and while receiving decrypt the data. Also you can add authentication before data is accepted.
Well do think over it.. Its much better method and cost effective solution. Final decision is still yours..

sashijoseph
Apr 12 2008, 1:18 PM
Yeah and with so many links you'll become bankrupt in no time purchasing bluetooth modules.Could've been ok for a single connection......
IshaG
Apr 15 2008, 5:50 PM
Ok Ajay thanks for ur advice i was in a fix wich to perfer(BLuetooth or RF) but now i go with RF first and c if it can work. i have some RF transciever modules from sparkfun which i think can serve the purpose.
actually i have a doubt regarding security of RF signal in transceiver modules and also the signal of 2 communicating modules might interfer with the signal between the other 2.....how shud i confirm that it wont?...
Can u provide me with some links to read to establish such a link b/w PIC+RF module...it will be of great help..
actually i have a doubt regarding security of RF signal in transceiver modules and also the signal of 2 communicating modules might interfer with the signal between the other 2.....how shud i confirm that it wont?...
Can u provide me with some links to read to establish such a link b/w PIC+RF module...it will be of great help..
shyam
Apr 15 2008, 6:12 PM
i know about some RF-modules in fact i have been using only these ...
they come with inbuilt spread spectrum technique for less interfernce...
plus u can set device addres for each of them the way we do in I2C devices.
then the data will only be received by the module which is being addressed !!!!
m talking about MaxSream's xbee pro modules
they come with inbuilt spread spectrum technique for less interfernce...
plus u can set device addres for each of them the way we do in I2C devices.
then the data will only be received by the module which is being addressed !!!!
m talking about MaxSream's xbee pro modules

Ajay
Apr 16 2008, 6:37 AM
addressing of RF modules is a good thing..
you can send and receive data in frame formats..
like..
[ destination addr ] [ source addr ] [ encrypted data ] [ checksum or crc ]
you can send and receive data in frame formats..
like..
[ destination addr ] [ source addr ] [ encrypted data ] [ checksum or crc ]
manokar
Apr 16 2008, 6:44 PM
plese send the link
IshaG
Apr 16 2008, 10:05 PM
shyam plz chk ur mail i hav written u a mail...and reply asap...
Ajay
I know abt the data formats but dont know how to implement them in a C code on PIC...
i.e if i have the data which needs to be send how shud i make a packet of it.
can u enlighten me on that...:(
Ajay
I know abt the data formats but dont know how to implement them in a C code on PIC...
i.e if i have the data which needs to be send how shud i make a packet of it.
can u enlighten me on that...:(
Ajay
Apr 17 2008, 5:33 AM
use data structures.. for defining a packet.. or even simple array would do..
the packet is already defined in my previous post..
can you be more specific on what u want to know?
the packet is already defined in my previous post..
can you be more specific on what u want to know?
IshaG
Apr 17 2008, 6:10 PM
shyam
thanks for ur reply. i have gone through this.
this seems to be pretty interesting of a device
...but my application only needs to transmit data in 2 directions(i.e.send an ACK back to the host and fwd the packet to another (uc+RF) system. it does not require PWM or ADC. Still will u recommend dis?.
even i have something..plz hav a look at it also and tell me ur views..cost is not an issue for this project...soo dont judge on that..just enlighten me on implementation will be easier with which one..... RF or this.....
Ajay
yeah evn i was thinking of data structures only, like stacks for that matter....
wen i have recieved a data packet thru UART at the micro then i want to extract the information from it and send an ACK to the source and also fwd the remaining packet to next uc system and so on so forth.
can i save the address of all the destinations in the packet i.e. how can i find the maximum packet length...
Can u be a bit more elaborate....
thanks guyz...
thanks for ur reply. i have gone through this.
this seems to be pretty interesting of a device
...but my application only needs to transmit data in 2 directions(i.e.send an ACK back to the host and fwd the packet to another (uc+RF) system. it does not require PWM or ADC. Still will u recommend dis?.even i have something..plz hav a look at it also and tell me ur views..cost is not an issue for this project...soo dont judge on that..just enlighten me on implementation will be easier with which one..... RF or this.....
Ajay
yeah evn i was thinking of data structures only, like stacks for that matter....
wen i have recieved a data packet thru UART at the micro then i want to extract the information from it and send an ACK to the source and also fwd the remaining packet to next uc system and so on so forth.
can i save the address of all the destinations in the packet i.e. how can i find the maximum packet length...
Can u be a bit more elaborate....
thanks guyz...
IshaG
Apr 17 2008, 6:15 PM
this is the attachment
IshaG
Apr 17 2008, 6:18 PM
attachment is not being attached here....:(
i have also mailed it to u shyam..reply asap...
i have also mailed it to u shyam..reply asap...
Ajay
Apr 19 2008, 8:29 AM
well first tell me what kind data is gonna be transferred between PC and micro, i mean what will it contain..
and is it gonna be constant? or something..
coz there can be two things, either we can set a defined fixed frame length if data size not gonna change again and again... or if you have variable lenght then we need to specify few more things like frame length along with next frame flag.
give me more specifications about your project so i can help you better..
and is it gonna be constant? or something..
coz there can be two things, either we can set a defined fixed frame length if data size not gonna change again and again... or if you have variable lenght then we need to specify few more things like frame length along with next frame flag.
give me more specifications about your project so i can help you better..
IshaG
Apr 20 2008, 7:08 PM
AJAY
data between PC and micro will not be CONSTANT it will be changing at regular intervals.
It contains 4 fields of information..each of approximate 10 bytes....this information can be sent in packet format or individually one aftr the other...which one u think is reliable????....
PC is the one generating the information and a copy of this information will be transferred in a cascaded manner to each uc in the chain....till the the last uc....and ACK generated by each uc is tranferred to the PC again in a cascaded manner....
Thanks for ur help
data between PC and micro will not be CONSTANT it will be changing at regular intervals.
It contains 4 fields of information..each of approximate 10 bytes....this information can be sent in packet format or individually one aftr the other...which one u think is reliable????....
PC is the one generating the information and a copy of this information will be transferred in a cascaded manner to each uc in the chain....till the the last uc....and ACK generated by each uc is tranferred to the PC again in a cascaded manner....
Thanks for ur help
tyagiG
Apr 20 2008, 7:41 PM
hi, u r using a good concept but can u be nrief abt its apllication. 

shyam
Apr 20 2008, 8:46 PM
Isha
make a struct like
make a struct like
CODE:
struct Packet_Send
{
char destination_Add[4];//any code say "s4b2" that wiill be rcver address
char My_Add[4]; // senders address
char Packet[10]; //this is the exact data
unsigned char Packet_Index; //packet no
//this is index to check if a data has been
//missed
}Packet_Send1;
main()
{
Packet_Send1.Packet_Index =1;
strcpy(Packet_Send1.MyAdd,"SK");
strcpy(Packet_Send1.destination_Add,"IG");
strcpy(Packet_Send1.Packet_Add,"Hello IG");
send_RTS_Packet( Packet_Send1.destination_Add);
while( Rcv_ACK(Packet_Send1.destination_Add));
Send_Data_Packet(Packet_Send1.Packet,Packet_Send1.Packet_Index );
Packet_Send1.Packet_Index++;
strcpy(Packet_Send1.Packet_Add,"BYE :bye ");
Send_Data_Packet(Packet_Send1.Packet,Packet_Send1.Packet_Index );
.
.
.
.
.
.
.
}
{
char destination_Add[4];//any code say "s4b2" that wiill be rcver address
char My_Add[4]; // senders address
char Packet[10]; //this is the exact data
unsigned char Packet_Index; //packet no
//this is index to check if a data has been
//missed
}Packet_Send1;
main()
{
Packet_Send1.Packet_Index =1;
strcpy(Packet_Send1.MyAdd,"SK");
strcpy(Packet_Send1.destination_Add,"IG");
strcpy(Packet_Send1.Packet_Add,"Hello IG");
send_RTS_Packet( Packet_Send1.destination_Add);
while( Rcv_ACK(Packet_Send1.destination_Add));
Send_Data_Packet(Packet_Send1.Packet,Packet_Send1.Packet_Index );
Packet_Send1.Packet_Index++;
strcpy(Packet_Send1.Packet_Add,"BYE :bye ");
Send_Data_Packet(Packet_Send1.Packet,Packet_Send1.Packet_Index );
.
.
.
.
.
.
.
}
IshaG
Apr 21 2008, 8:22 PM
Thanks shyam..this will help will go through it and consult u for queries....i am working on the code now...and will seek for ur guidance in future also...thanks a ton... 

Ajay
Apr 22 2008, 3:03 AM
isha one more thing as you know there is data in 4 fields with 10 bytes each, so i was asking if those 10 bytes are constant or they can vary? And you can send in single frame only, specifying number of bytes in each of 4 sections. This way it will be easy to extract on the other end. Reason for sending in one frame is making the communication protocol simple to implement.
IshaG
Apr 27 2008, 8:20 PM
The length of the data in the packet will vary and so does the information also.i was wrong wen i quoted that it'll be 10 bytes each.infact the fields can also vary.
or may be i can keep the length of packet large enuf to accommodate information accordingly..can i do dat i.e. i can put small information also as well as large info also in the same packet may be by separating the information in the packet by some special characters like % in the data part of the packet.
also can u tell me that "Can a bluetooth master differentiate btw the slaves on the basis of distance i.e. can it tell wich one of the slave is near to him and wich 1's far?..."
or may be i can keep the length of packet large enuf to accommodate information accordingly..can i do dat i.e. i can put small information also as well as large info also in the same packet may be by separating the information in the packet by some special characters like % in the data part of the packet.
also can u tell me that "Can a bluetooth master differentiate btw the slaves on the basis of distance i.e. can it tell wich one of the slave is near to him and wich 1's far?..."
sashijoseph
Apr 27 2008, 11:46 PM
IshaG wrote ...
also can u tell me that "Can a bluetooth master differentiate btw the slaves on the basis of distance i.e. can it tell wich one of the slave is near to him and wich 1's far?..."
Think it can be done using the RSSI field......dunno about the resolution though..like how much signal strength variation would register.
Vishay
Apr 29 2008, 7:12 PM
Hi,
I would like to do something similar like Monica mentions. I want my PC to to talk to the PIC using wireless..but i don't know which communication to use..rf, zigbee, bluetooth..am quite new to communications thingy..could you guys gimme some ideas please?. I would really appreciate that..
thanks a lot!!
I would like to do something similar like Monica mentions. I want my PC to to talk to the PIC using wireless..but i don't know which communication to use..rf, zigbee, bluetooth..am quite new to communications thingy..could you guys gimme some ideas please?. I would really appreciate that..
thanks a lot!!
sashijoseph
Apr 29 2008, 9:57 PM
Your question's already been answered in the thread.Do go through......