433 Mhz RF Circuit design

I need some help with a few questions building a Rf circuit to send a 32bit data stream. Data is 4 characters (A-Z, a-z, 0-9)

I plan on using a TWS-434A Transmitter Module along with a RWS-434 Receiver Module.

Everything i have read goes MCU>>Encoder>>TWS-434A RWS-434>>Decoder>>MCU

I am thinking of using a PIC to send the Data in 8Bit packets to the encoder then to the TWS-434A Transmitter.

On the receiving side the data through the RWS-434 then to the Decoder into my Basic Stamp.

Do i really need an Encoder and Decoder? If so can the PIC be programed with the data and encode it all in the same chip? Can the BS2 Decode the data on the receiving side?

Is a PIC the best way to send the data to the transmitter? I plan to program each PIC with a unique 4 Character data that is sent wireless about two seconds.

My ultimate goal is to have a wireless proximity switch that controls a relay and some leds. Similar to RFID each transmitter has a unique data and when it is read and matches the compassion done by the basic stamp it will operate the relay.

Any help with this would be great.

Yes, a uController can provide the encoding / decoding. Whether YOURS can is unknown to me.The transmitter uses OOK (on off keying) whenever the data input pin goes high the output RF goes high. The receiver does the reverse BUT has an automatic gain control that has to lock on to the signal first; so you have to send a short msg that your decoder recognizes as invalid data, then your message. The range of these devices would probably cause problems for your application if you plan on having multiple receivers in the same room unless you you encode an intended recipient byte in your data along with the transmitter ID byte you plan to do. Multiple transmitters in use on the same freq would also be a problem.

NOTE: the FCC (if you’re in the US) intended this frequency to be used by both ham radio and low duty cycle, short range devices such as car keyless entry / remote starter, garage door openers etc. You can not (legally) continuously stream on these frequencies. You can transmit a periodic burst.

What exactly is the purpose of the encoder/decoder?

I plan on transmitting a data stream every 3 seconds.

Want to use An 8 pin pic to send the data. I also think I want to program using picbasic because it seems like an easy language. I just need to find a pic program that works with pic basic.

The decoder reverses the effect of the encoder returning the information to it’s original form; that was easy.

Somebody else can jump in an explain what an encoder does. Only kidding! The encoder formats the information in a way that the medium being used can effectively convey it. As an example. I want to turn on and off a light bulb. In my house I can sent a voltage over a wire to turn it on and stop sending voltage to turn it off. If I’m transmitting via RF (the medium) things have to be different. If I constantly transmit a carrier at 433 Mhz to hold the light on I’m jamming my neighbors garage door opener. If I transmit a pulse at 433 Mhz I can have the uC turn on the light, but how do I turn it off? Following the the household wiring analogy, I just stop transmitting pulses. But if I use that as my encoding my light only flashes momentarily as all pulses are followed by an off time or they wouldn’t be pulse. Let’s say I decide to have 1 pulse turn on my light and 2 pulse turn it off. How long should I wait for the second pulse before deciding The transmitter was sending a single pulse? This is your encoding scheme, it has to effectively communicate the information to the receiver. So you would need to send 2 pulse in a certain time frame to command off and your receiver, when receiving a pulse it should see if one has already been received in a certain time frame and if so interpret it as the second of a pair and if not, entertain the possibility that it may be the first of a pair and wait certain time frame for a 2nd pulse and if received interpret it as a pair. Otherwise It must be a single pulse and the command was on. There are many encoding / decoding schemes, you can look some up on Wikipedia.

I thought one up once I called a “quadrature clock code” where if I remember correctly, I set a timer to 4 times the desired bit rate and used p/w modulation where all info was a logic hi to the transmitter (OOK transmission):

“invalid” was 1 out of 4 clock width,

binary 0 was 2 out of 4 clock widths

binary 1 was 3 out of 4 clock widths

and the between byte gap was 4 lows (I’m fuzzy on whether it was 4 or 8)

After receiving a CR terminated message over my uart port I did the following:

1.) counted the number of bytes in the message and generated a check-sum bit

2.) sent n bytes of “invalid” to wake up and settled the AGC in the receiver.

3.) created a new message consisting of the # of bytes being transmitted, the original message and a checksum byte.

4.) took each byte and for each bit, did a bitwise shift to into a bit variable and called a subroutine that generated either a 2 clockwidth pulse or a 3 clockwidth pulse and outputed it via the transmitter. After all 8 pulses in the byte were sent I when low for 4 ( or maybe 8?) clock cycles as an interbyte gap.

it was up to the decoder attached to the receiver to measure the length of the incoming pulses and:

1.)ignore the “invalid” bits in the header

2.) identify 2/4 and 3/4 width and bit shift them into bit positions in a byte.

3.) identify the 4 ( or 8?) bit gap in transmission as a end of byte signal and add the byte to the incoming message string and increment the byte count. If it was the first byte, interpret it as the message length and calculate the time the transmission should take and set a timer to underflow at after that (plus a small amount for various system errors)

4.) after the message byte count of received bytes reached the limit, a checksum was created from the message and compared to the last byte. Message was discarded on checksum fail If. The message byte count had not been achieved by the time the timer underflowed then the message was also discarded.

that was my “encoder / decoder” in a nutshell. There was no protocol for what to do on errors other than discard.

I’ve never used PICBasic, but love Oshon Basic for PICs, for it’s phenomenal user interface. If you haven’t spent $$ yet, go to the Oshonsoft web page and check it out. It has a 30 day free trial. Just finished a PIC12F675 design for a uninterruptable P/S controller using supercaps in under a day with it. 2 A/D converters, 2 relay control lines and 2 HZ timer for a backup in use status/power failure alarm line. Oshon basic’s IDE made it “easy”; and I’m not paid to say that.