PDA

View Full Version : Using INTOSC 32Mhz as RF Radio Control and Data Communication



rayzrocket
- 29th December 2010, 05:59
I'm attempting to generate some simple & low cost ($2 + PIC) RF radio control and data comm' by taking advantage of the 32Mhz INTOSC found on some of the PIC's (16F1826 is on the bench now). It would be nice to get 3kbps.

I'm trying a few circuits(op-amp & RLC filters) now without success by outputting the clock (32Mhz) on a pin.

Am I crazy to think this is possible?:o

Any ideas or anyone interested?

mackrackit
- 29th December 2010, 08:32
Some things to consider if you have not.

A quarter wave length antenna for 32Mhz is around 7 feet long.

But if I am not mistaken you will only be able to output 1/4 of that.
8Mhz = 29 foot antenna

Ioannis
- 29th December 2010, 08:47
I think yes, that you are ...

The OSC power is too litle to make a good transmission, plus at 32MHz you need a long long antenna.

Ioannis

rayzrocket
- 29th December 2010, 22:02
OSCCON = %11110000
'32Mhz intosc use
CLKRCON = %11010000
'Turn on ref clock output BE SURE TO DISABLE "CLOCK OUT" IN MEPROGRAMMER
With these statements, I see the 32Mhz on the 'clkout' pin. On a 5v pwr supply, the waveform looks like a sawtooth ~1volt peak to peak that is offset by 2v from zero.

Most low cost radio control toys are 27Mhz or 40Mhz. I tested one that is 27Mhz using Tx antenna length of just 4inches and receiver antenna length of 8inches; the toy car worked for over 40feet.

mackrackit
- 29th December 2010, 23:14
Most low cost radio control toys are 27Mhz or 40Mhz. I tested one that is 27Mhz using Tx antenna length of just 4inches and receiver antenna length of 8inches; the toy car worked for over 40feet.
And they have a loading coil before the antenna. Giving an electrical length of well over 4 inches. A straight wire for an antenna will need to be the lengths given above.

I will suggest you pick up a book about antennas and wave propagation. Then start on a project like this.

Here is a good place to start
http://www.arrl.org/

Ioannis
- 4th January 2011, 21:01
See post #3 about power.

Also if you use a loaded coil with short antenna, much of the RF power will be spent in the coil and mismatches.

With picowatt I think you can go a few mm away...

Unless you are going to amplify the signal. Maybe a MAR-1 or more in series can help.

Look here for data: http://www.minicircuits.com/pdfs/MAR-1+.pdf

Ioannis

rayzrocket
- 12th January 2011, 06:37
Thanks.
I tried a few simple (perhaps stupid) experiment setups such as...
Transmitters tried:
a. 8" wire soldered straight to the clk out pin (with a 5v supply to PIC, this pin shows 1.5v p-p 32mhz waveform that is 2v offset above zero)
b. tried modulating the full 5v using RF transistors and amps unsuccessfully (likely due to impedance issues of clk pin feed).
c. successfully modulated the full 5v supply onto a wire(antenna) using a Schmitt trigger, triggered by clk(clock) out pin, and powered by 5v supply, unfortunately my received signal strength did not go up as this idiot(me) expected.

Receiver: ~5" wire feeding a bandpass filter (series R & L then parallel to gnd R & L) that worked great, feeding a RF amp (Avago ADA-4543).

The above gave an output of 45mv p-p centered on zero before the RF amp, and about 190mv p-p after the amp. This was at a distance of about 6" apart. My application needs about 36" (~1meter) apart maximum (for a rotating equipment sensor).

I modultated the 32mhz clk output either (both ways worked great):
a. through a NPN transistor where the data pin from PIC(controls if 32mhz is on/off) feeding the base directly(no resistor), collector connected to clk out pin, and emitter hooked to a 8" wire(antenna).
b. through software by turning on or off the Clock output on the clk out pin using the CLKRCON register and placing pausues statements inbetween. To send data out this way, one could(no start and/or stop bits shown here):
Data var BYTE
code....(setting a value to Data)
For x= 0 to 7
if data.x=0 then
CLKRCON = %00010000
'Turn off ref clock output BE SURE TO DISABLE "CLOCK OUT" IN MEPROGRAMMER
pauseus=300
if data.x=1 then
CLKRCON = %11010000
'Turn on ref clock output BE SURE TO DISABLE "CLOCK OUT" IN MEPROGRAMMER
pauseus=300
next x
...
I need to work on the receiver a bit more, just need to amplify it a bit more to ~50% of receiver supply voltage, then I can use a Schmitt trigger to send it to the +V rail so the PIC can see good data coming into a receive (SERIN2) pin.
...
If anyone has good ideas, pls pass them along.

Ioannis
- 12th January 2011, 13:20
Why not put 2 MARs in series to amplify the Transmitter signal?

Ioannis

dhouston
- 12th January 2011, 15:33
Why not put 2 MARs in series to amplify the Transmitter signal?I've tested with 3 MAR-6 on the receiver end just to see if it would work. It did, but you can easily overwhelm some receivers.

At much higher frequencies (~300MHz), many people have reported this tip http://davehouston.org/passive.htm worked for them. One fellow with access to a lab, measured 10dB gain in all directions. Most small battery powered transmitters have very inefficient loop antennas formed by a PCB trace. Their range is frequently poor and this can make quite a difference. I have no idea whether it might work (or be at all practical) at longer wavelengths.

rayzrocket
- 13th January 2011, 05:46
hi Dave, what do you mean 'but you can easily overwhelm some receivers' ?

I would guess one would do this for the receiver:
Ant -> Filter -> Amp -> Filter -> Amp -> Filter -> Amp -> Schmitt Trigger ->Data input Pin on a PIC.

The amp i tried as mentioned above (Avago) is very similar to the 'MAR' amps.
(BTW, I've given up on testing this at the moment and resorted to using the 'Radiotronix' low cost modules to move forward with my project).

What is important here is to get a good SNR (signal to noise ratio)...where both are the ~32Mhz frequency but one is the 'intended signal' and the other is 'unwanted background noise' (sometimes called the noise floor).
One can do this several ways...
a. make a really hi power transmitter and weak reciever.
b. use AGC algorithm/control on reciever or on both reciever & transmitter.
c. both the above.
d. others...

I am trading several methods, but i normally gravitate towards the LOWEST COST options, especially when i can replace hardware with code techniques or algorithms.

rayzrocket
- 13th January 2011, 05:52
I did try the amp on the transmitter side, it did not work.
Clk out pin -> capacitor -> amp -> wire antenna

BUT, i got a Schmitt trigger to generate the full 5v supply swing the 32Mhz about a wire antenna by just Clk out pin -> Schmitt trigger -> wire antenna... only problem was that i did not see a stronger (higher voltage) reception.

There is some impedance matching (or decoupling) that needs to be done from Clk Out Pin to the radiating Antenna.
I need help with this part.

thanks.

dhouston
- 13th January 2011, 12:10
hi Dave, what do you mean 'but you can easily overwhelm some receivers' ?
My experience has mostly been with 300-434MHz where there are dozens of suppliers of small, inexpensive superregenerative receivers (http://davehouston.org/modules.htm ) and somewhat more costly superhet or hybrid receivers. I cascaded 3 MAR-6 amps between ANT & RCVR (w/o any filtering). This worked fine with the superhet & hybrid receivers and with most of the superregenerative receivers. However, there was one manufacturer whose superregenerative receiver had much wider bandwidth than most and it did not deal well with the higher signal levels. This was disappointing as the wider bamdwidth was a desirable trait as several devices of interest (automation & security) to me were in the 308-320MHz range. http://www.e-madeinchn.com/ReceiverModules.html And, they were dirt cheap, costing about $1 each even with some requested mods and in relatively modest (~100 pcs) quantities.

Noise is not much of a problem as most of these receivers employ a data slicer circuit (a simple comparator) that gives an extremely noise free data output. http://davehouston.org/rf-noise.htm.

As it's against FCC rules to futz with the transmitters (or TX antenna) but not with the receiver, I always use better antennas (http://davehouston.org/eggbeater.htm) and MAR-6 based preamps on the receiver side.

Most of the superregenerative receivers also have an analog output which is merely the raw signal at the comparator input. You can measure the modulation depth and get a rough measure of the signal level (rough, because the AGC circuits also affect this amplitude) which you can use for comparing before/after (antenna, preamp) scenarios.

I have no idea what might be available at 27MHz. I did look at this briefly a few years ago as it was/is(?) used by one of the audio receiver makers for remote control. (It's been too long for my ancient gray cells to remember details.)