DIYstompboxes.com

DIY Stompboxes => Digital & DSP => Topic started by: Izzy on May 27, 2007, 09:00:13 AM

Title: A newbie question about Radio Communication
Post by: Izzy on May 27, 2007, 09:00:13 AM
Hello everyone,

I am kinda newbie into these stuff, so please bare my stupidity.

I am currently working in a Robotic swarm project and I am assigned for Radio communication and software in this project.

I have already written the codes to send data from a Robot to the base station. The robot sends data one integer at a time.

For eg. If the Robot wants to send "352637494853034" (Which is the value from compass, Ultrasonic cencors, encoder, etc.) to the base station, it will send 3 in into the 8 pin of the pic, then 5, then 2 and so on.

So From Robot:
PIC18f4250>encoder>Transmitter> Antena

PC base station:
Antena>receiver> decoder>PIC18f4250



Now my question is how does base station knows when to read the input pin? I mean the Robot cant acess the Read() function of the base station to make the base station read the input as soon as the robot sends it. So I am confused here.


Please someone shed some light here.
Thanks in advance
Title: Re: A newbie question about Radio Communication
Post by: Izzy on May 27, 2007, 01:28:08 PM
Incase a picture of breadboard helps, here it is:


(http://img293.imageshack.us/img293/2124/dsc00012ku4.jpg)
Title: Re: A newbie question about Radio Communication
Post by: The Tone God on May 27, 2007, 02:51:22 PM
This could be an issue with the transmission protocol you are using. Which one are you using ?

Andrew
Title: Re: A newbie question about Radio Communication
Post by: Izzy on May 27, 2007, 03:01:00 PM
Thanks for your reply, Sir.

The way I connected is,

For Receiving:
From the receiver the data out goes to CIP8D Decoder chip, serially . From the decoder there is 8 pins (D0-D7) connected parallelly to 8 pins (C0-C7) of PIC184520 microcontroller.

For Transmitting:
From the PIC18f4520, the pins (D0-D7) are connected to CIP8E Encoder chip (D0-D7), parallely . Then from the Encoder the data out is connected to the transmitter serially.

I dont know if this is what you are looking for. Ignore my stupidity. 


Datasheet of the PIC 18f4520
http://ww1.microchip.com/downloads/en/DeviceDoc/39631B.pdf


Data sheet of the Decoder and Encoder:
http://www.rentron.com/Files/CIP-8.pdf

Datasheet for Transmitter:
http://www.linxtechnologies.com/Documents/TXM-xxx-LR_Data_Guide.pdf


Datasheet for Receiver:
http://www.linxtechnologies.com/Documents/RXM-xxx-LR_Data_Guide.pdf
Title: Re: A newbie question about Radio Communication
Post by: Chuck on May 27, 2007, 03:39:59 PM
Sure are good looking breadboards.
I've never seen anything so neat before.

You are going to need to either use an interrupt to let the code know to read the pins (when the state changes) or loop through a routine when you aren't doing aything else reading the pins.  The loop routine will probably be easier for you, but you need to be sure to keep up with other tasks AND keep your non looping routings quick so you don't miss any reads.

You'll probably want to slow down the transmission rate, so that the receiver has time to carry out any required tasks in between reading the pins.  You'll also want to clear the state of the pins after reading so you know when there is something new to read.

Don't let me scare you away from the interrupts.  That would probably be a better way to do it.  But you'll probably need to write the assembler routines yourself.

What compiler/library are you using?
Where'd you get that design?
Title: Re: A newbie question about Radio Communication
Post by: Izzy on May 27, 2007, 05:20:04 PM
Thanks for you reply, Sir.

we are currently using the student version of this compiler:
http://www.ccsinfo.com/content.php?page=compilers

I really want to use interupts but how would I use it? I am kind of confused as I am really new in microcontrollers.  :-\

Here is the PIC we are using:

(http://img184.imageshack.us/img184/1371/untitledwa5.jpg)


I am using pins D0-D7 and C0-C7 for data transfer between encoder and decoder. I cant use B0-B7 because I need B3, B6,B7 for debugging. SO how would I use Interrupts?
Title: Re: A newbie question about Radio Communication
Post by: Chuck on May 27, 2007, 06:23:21 PM
You should try the read loop first.
Just check the inputs every few milliseconds to see if there is anything there.
Title: Re: A newbie question about Radio Communication
Post by: Izzy on May 27, 2007, 06:32:27 PM
If you dont mind can you write a small sample code.
I want to know how to activate the PIC and let it know to start reading the pins. :-\.
Title: Re: A newbie question about Radio Communication
Post by: Izzy on June 03, 2007, 08:59:13 AM
Any RF engineers here?

I have some serious probelem with range. I am only getting 50-100', when datasheet mentions 3000' ??
Title: Re: A newbie question about Radio Communication
Post by: Chuck on June 03, 2007, 03:01:35 PM
Prolly not giving it enough current.

Transmitter is 5.1ma.
Receiver is 5.2ma
PIC needs about 12++ ma.

Thats a7 least 23 ma.
Plus whatever else you got on there, decoders, encoders....

Are you trying to run it off a battery?
Title: Re: A newbie question about Radio Communication
Post by: Izzy on June 03, 2007, 03:17:19 PM
Thanks for your reply, Sir.
I have tried it with both adapter and battery and I dont see much change.

Title: Re: A newbie question about Radio Communication
Post by: Chuck on June 03, 2007, 05:17:43 PM
What abot an antenna?
What are you using for that?
Title: Re: A newbie question about Radio Communication
Post by: Izzy on June 03, 2007, 07:58:06 PM
this one:

http://www.antennafactor.com/documents/ANT-433-PW-QW_Data_Sheet.pdf
Title: Re: A newbie question about Radio Communication
Post by: johngreene on June 14, 2007, 06:22:39 PM
The coax for your antenna needs to attach to the transmit and receiver modules as close to the output/input pins as possible. You cannot route the RF through the protoboard, it needs to be a 50 ohm line.

--john
Title: Re: A newbie question about Radio Communication
Post by: RaceDriver205 on July 22, 2007, 03:25:44 AM
QuoteDatasheet for Transmitter:
http://www.linxtechnologies.com/Documents/TXM-xxx-LR_Data_Guide.pdf


Datasheet for Receiver:
http://www.linxtechnologies.com/Documents/RXM-xxx-LR_Data_Guide.pdf
Where did you get this parts from? They look really good!
Title: Re: A newbie question about Radio Communication
Post by: Izzy on July 22, 2007, 09:29:53 AM
I got those RF modules from here.
http://www.rentron.com/PicBasic/RemoteControl.htm

They are only good for short range application. I really had hard time getting good range ou of it. And their customer service is really really bad.

So we moved to Maxstream Xtend 900Mhz RF modules. They are kind of expensive, around $180 a peice (Transceiver). But gives pretty good range. In the data sheet it is mentioned that  it can give about 40  miles with yagi antenna. Tt has many features too. And customer service is great .
Title: Re: A newbie question about Radio Communication
Post by: RaceDriver205 on July 22, 2007, 08:17:04 PM
QuoteThey are kind of expensive, around $180 a peice (Transceiver). But gives pretty good range. In the data sheet it is mentioned that  it can give about 40  miles with yagi antenna.
40miles! :icon_eek:
What are you making with these things anyway?
Title: Re: A newbie question about Radio Communication
Post by: Izzy on July 22, 2007, 09:09:36 PM
Actually I am working in a project. We are building a swarm of 10 Robots that will be sent inside a building (Where human cant go) and send the information to the base station to map the building.  And I am doing communication stuff.
I dont need 40 miles of range so I didnt get yagi antenna, instead I got Dipole antenna. We havent done much of range testing but inside a concrete building we were able to get about 300 ft. Which is good enough compared to Linx which only gave about 50 feet.  :-\

Checkout Maxstream.net , these modules have 100 times more features than Linx. But dont forget the price too! ;D
Title: Re: A newbie question about Radio Communication
Post by: johngreene on July 22, 2007, 09:24:06 PM
Quote from: Izzy on July 22, 2007, 09:09:36 PM
Actually I am working in a project. We are building a swarm of 10 Robots that will be sent inside a building (Where human cant go) and send the information to the base station to map the building.  And I am doing communication stuff.
I dont need 40 miles of range so I didnt get yagi antenna, instead I got Dipole antenna. We havent done much of range testing but inside a concrete building we were able to get about 300 ft. Which is good enough compared to Linx which only gave about 50 feet.  :-\

Checkout Maxstream.net , these modules have 100 times more features than Linx. But dont forget the price too! ;D

At 900 MHz you are allowed to transmit up to 1 Watt if it is spread spectrum. If you use the yagi antenna I think you are limited to 250 mW. I designed a spread-spectrum radio link at 2.4 GHz (years ago) that could get 50 miles range with 250 mW transmit power. Probably could have gone further but the protocol limited it to 50 miles (delay).

I'm working on a remote control project (full duplex) now that uses 900 MHz radios, I designed my own around the Semtec XM1205 device. They seem to work pretty well. They have the ability to fine tune the local oscillators enabling you to narrow the IF bandwidth to less than 10kHz. That helps a lot with the receive sensitivity. I'm getting around 350-400 ft with 1mW of transmit power and a printed antenna.

I've done several 433MHz remotes for the iPod as well. The latest one should be showing up in Best Buy pretty soon. It's a combination 433 MHz remote control and FM transmitter.

--john
Title: Re: A newbie question about Radio Communication
Post by: Izzy on July 23, 2007, 08:55:25 AM
Quote from: johngreene on July 22, 2007, 09:24:06 PM


At 900 MHz you are allowed to transmit up to 1 Watt if it is spread spectrum. If you use the yagi antenna I think you are limited to 250 mW. I designed a spread-spectrum radio link at 2.4 GHz (years ago) that could get 50 miles range with 250 mW transmit power. Probably could have gone further but the protocol limited it to 50 miles (delay).


That is really cool! I didnt know you were an RF Module designer.
So what is the range inside a building?

And is there any way to increase the range inside the building, in my case?
Title: Re: A newbie question about Radio Communication
Post by: johngreene on July 23, 2007, 11:10:03 AM
"inside a building" can mean many things. If the building is made from metal framing, room to room is not going to be very good. If you are near furniture or metal anything, your range is going to suffer. I don't have a building big enough to test in for the actual range but from inside the building to the outside, I was getting 200 feet with no real loss in signal strength. 135 feet of that was inside the building.

There are a few things to keep in consideration for links like this. And just about all of them have to do with the FCC.

1. 433/315 MHz are very restrictive on the type of data you transmit. Basically makes them useless for anything other than a remote control.
2. 900 MHz has no restrictions on data or length of transmission. 2.4GHz and 5.7GHz do not either (ISM band stuff).
3. If you do not use spread spectrum, you are limited to 1 mW in the ISM band.
4. You can use a new ruling called 'wide-band data' to increase the power to 10mW but the bandwidth has to be greater than 500kHz. (Check with Part 15 for accurate numbers). What you gain in power you lose in sensitivity because of the increased bandwidth so it is not of much value if you don't need the data rate.
5. 900 MHz will work indoors better than 2.4 and 5.7.

All that being said, the only way to really make things work 'better' or at least the best that they can, is via antenna design. The antenna should be unobstructed. Even then you have to be careful because the FCC limit is on radiated power, not just transmit power. The only real performance increase can be had (without violating FCC rules) is to get the receiver sensitivity to be the best as you possibly can. Get an additional 6dB in receiver sensitivity and you close to double your range.

Your best bet for maximum range would be to use a Frequency Hopping radio at 900 MHz. That way you can transmit a watt of power which should give better than 1000 feet of range for a mobile type application.

Freescale has a free range calculator that your might find useful.

http://www.freescale.com/files/microcontrollers/doc/app_note/AN2611.pdf (http://www.freescale.com/files/microcontrollers/doc/app_note/AN2611.pdf)

--john
Title: Re: A newbie question about Radio Communication
Post by: Izzy on July 23, 2007, 11:24:17 AM
Thanks for the info, Sir.

We are using MaxStream RF modules and they do have frequency hopping spread spectrum stuff and we are using 1 W output power.
But I dont know whether FHSS is being used by default or we have to change the configuration. (I will havee to look up the manual).