I have a rocket-shaped (tube-shaped) mobile 20mm in diameter. From a base-unit, 600yards away, I want to be able to send two floats (call it x and y) every 1/60th of a second (60Hz data rate [or faster]) to a pic chip such as the below pic chip that is inside the mobile.
https://www.mouser.com/datasheet/2/268/40001723D-767332.pdf
For this I will need some type of antenna that will fit in the mobile. You can assume there is line-of-sight between the fixed-base and the mobile with regard to communication-range. The antenna will need to be able to communicate the (x,y) values to the pic chip.
Any suggestions on the antenna (and base communicator) for this?
If the correct term is âreceiverâ instead of âantennaâ, I also apologize in advance.
edit/add: It seems a communication-delay of about 0.033seconds may be tolerable.
1 Like
Hey @JohnDoe,
Interesting request. Lets confirm your requirements first:
- Send packets of data from 600 yards away (line of sight available) at 60 Hz or better.
- The packets of data will contain two floats (assuming standard IEEE 32 bit floats here, such as what is used in C/C++/etc.).
- The data has to be valid.
- The data has to be sent to the PIC ”C.
Lets cover those points and see if we can figure out something.
-
Send packets of data from 600 yards away (line of sight available) at 60 Hz or better.
This is quite far when considering surface mount antennas and such but fortunately technology has gotten quite far with respect to this. Iâve used quite a few XBee devices in the past for line of sight projects and this may be something youâd want to look into. Hereâs a handy comparison chart.
As you can see in the chart even the higher frequency ones (in 2.4 GHz) have quite long ranges (with surface antenna!). Iâd still recommend to go for a 900 MHz one if you can since youâll probably have less interference in that band nowadays (and it has better penetration if something gets in the way of the line of sight).
-
The packets of data will contain two floats (assuming [standard IEEE 32 bit floats]
Youâll need to create data packets so that it is intelligible on the receiving end. Integrated devices like the one recommended above are quite advanced and provide all sorts of neat features (like transparent management of the wireless link), but you still want to ensure your receiver can tell which bits are what. Typically, youâll have a magic number sent as a âheaderâ to indicate the start of a data frame followed by data and maybe a âfooterâ to indicate end of transmission for that packet. If the packets are fixed (or known) length you may skip the footer entirely.
Ex: Every packet could be a 1 byte magic number followed by two 4 byte data payload (your 32 bit floats). Just make sure to use a magic number that is unique (not used elsewhere in the payload). If that is not possible with 1 byte alone simply increase its size (2 bytes or even 4 bytes).
-
The data has to be valid.
You did not specify that, but I assume you want your device to only act on valid X/Y data, not invalid/corrupted/etc. data. Simplest way to do this would be to add a simple CRC to your data. You can find plenty of example online about this. So your final packet could be something like:
1 byte header, 8 byte data (2x floats), 2 byte CRC.
If the receiver gets the packet and the data does not match the CRC then it can discard it and wait for the next packet (or do something else, as required).
-
The data has to be sent to the PIC ”C.
The PIC you linked to seems to have only 6 pins. Youâd need at least one pin to use a UART interface with your wireless device (i.e.: receive the data from it). Devices like the XBee discussed above basically create a transparent communication. To your ”C, it looks as if you have a UART interface with the other device right next to it and they usually come straight out of the box usable without further configurations.
I hope all these details help you get a better idea of what will be required! Good luck and do post about your project when you have some progress on this. Iâm sure the community will be curious to know what you end up doing.
Sincerely,
P.-S.: Of course, you could always attach a whip antenna (i.e.: a wire) with some support components to a pin on the ”C and try and use that directly. Much more work though then using an already established product. Unless you want to become a radio expert I recommend sticking to stuff available off the shelf.
2 Likes