You are on page 1of 11

Using Low-Cost RF Transmitters & Receivers On The New CDbot

By: Abraham L. Howell In this paper I will cover the basic steps needed to add the TXLC-434 and the RXLC434 RF modules to a New CDbot. This project will require some degree of technical knowhow, since you will need to solder, cut, and crimp various components.

The required parts list for this project has been provided below.

Copyright 2003, Abe Howells Robotics

Parts List For RF Modules

Qty 1 1 2 2 2 20 1 1 1 1

Part# TXLC-434 RXLC-434 WM2013-ND WM2000-ND WM2003-ND WM2200-ND

Description TXLC-434 RF Transmitter RXLC-434 RF Receiver 4-pos 0.100" Housing 2-pos 0.100" Housing 5-pos 0.100" Housing Crimp Terminals for 0.100" housings 6" length of 24 gauge wire red 6" length of 24 gauge wire black 6" length of 24 gauge wire white piece of 3/32dia. shrink tube

Price 14.95 23.95 0.32 0.23 0.42 0.067 0 0 0 0 Total

Total 14.95 23.95 0.64 0.46 0.84 1.34 0 0 0 0 42.18

Where to get? www.rentron.com www.rentron.com www.digikey.com www.digikey.com www.digikey.com www.digikey.com Scrap Scrap Scrap Scrap

The above list will allow you to build one RF-Transmitter and one RF-Receiver unit. If you only want uni-directional communication between two CDbots, then this will be fine. If you want bi-directional communication then you will need to double the quantities listed above. You must solder on the small antennae for each module according to the supplied instructions. We will first assemble the cable for the RXLC-434 RF Receiver module. To start we will need three pieces of 22-24 gauge wire cut at approximately 6 with the following colors: red, black, and white. Finally, strip both ends of each of the three wires and then crimp a crimp terminal to both ends of each wire. The ends of your wires should now appear as shown below.

Now insert the wires into the 5-Pos and 2-Pos 0.100 housings as shown below. The red wire will be connecting to pin#4(+5v) on one of the OOPics I2C Network connectors. The black wire will be connecting to pin#2(GND) on one of the OOPics I2C Network 2

Copyright 2003, Abe Howells Robotics

connectors. The white wire will be connecting to pin#39(Rx) on the OOPics I/O connector.

Now we need to connect the crimps on the other end of each wire to the 4-Pos 0.100 connector, which will connect to the RXLC-434 module. Connect the wires as shown below. You may want to refer to the online documentation from Rentron. The black wire will be connecting to the GND pin on the RXLC-434. The red wire will be connecting to the Vcc pin on the RXLC-434. The white wire will be connecting to the data pin on the RXLC-434.

Finally, plug the 4-Pos connector onto the RXLC-434 and you will have a completed cable. Connect as shown below. 3

Copyright 2003, Abe Howells Robotics

You now have a completed cable, which can connect the RXLC-434 to your OOPic micro-controller. Your cable should appear as shown below.

Completed cable for RXLC-434.

Now we can be begin to work on the cable for our TXLC-434 RF Transmitter module. To start we will need three pieces of 22-24 gauge wire cut at approximately 6 with the following colors: red, black, and white. Again, strip both ends of each of the three wires, but only crimp a crimp terminal to one end of each of the three wires. One end of your three-wire cable should appear as shown below. 4

Copyright 2003, Abe Howells Robotics

One end of your three-wire cable.

Now insert the three wires with crimp terminals into the 5-Pos and 2-Pos 0.100 housings as shown below. The red wire will be connecting to pin#4(+5v) on one of the OOPics I2C Network connectors. The black wire will be connecting to pin#2(GND) on one of the OOPics I2C Network connectors. The white wire will be connecting to pin#37(Tx) on the OOPics I/O connector.

Since we will be using the TXLC-434 transmitter module with a +5volt supply we need to have the 430ohm resistor connected between the VADJ pin and the GND pin on the module. To do this we will take one end of the 430ohm resistor and take the stripped end of the black wire and twist them together and finally crimp on a crimp terminal. Now we need to crimp a second crimp terminal to the other end of the 430ohm resistor. To protect the bare leads of the resistor we will need to cover it with a small piece of heat shrink tubing. Now we can crimp a crimp terminal to the red and white wires. Next, we can insert the wires with the crimps into the second 4-Pos 0.100 housing. The white wire crimp will be connecting to the Data pin on the TXLC-434. The black wire and 430ohm resistor crimp will be connecting to the GND pin on the TXLC-434. The red wire crimp will be connecting to the Vcc pin on the TXLC-434. The 430ohm resistor crimp will be connecting to the VADJ pin on the TXLC-434. 5

Copyright 2003, Abe Howells Robotics

Next we need to plug the TXLC-434 module into the 4-Pos connector as shown below.

Copyright 2003, Abe Howells Robotics

You now have a completed cable, which can connect the TXLC-434 to your OOPic micro-controller. Your cable should appear as shown below.

Completed TXLC-434 Cable.

Below is a picture for where you can attach an RF module onto your CDbot. We chose to attach it to the side of the AA-battery holder with a small piece of reclosable tape.

Copyright 2003, Abe Howells Robotics

New CDbot with RXLC-434 RF Receiver Module.

If you have any questions with regards to this paper please send an email to abe@abotics.com.

Programming The OOPic Micro-controller For The TXLC-434 And RXLC-434 Low-Cost RF Modules

By: Abraham L. Howell This paper will help you to program your OOPic micro-controller so that it may utilize the TXLC-434 and RXLC-434 low-cost RF modules. This paper will assume that you have already made the appropriate cables for your RF modules. If not, please read the following paper: Using Low-Cost RF Transmitters & Receivers On The NewCDbot, which will walk through the steps needed to build your own cables. The first topic to be covered will deal with unidirectional communication between two OOPics. Unidirectional Communication: First off we need to understand exactly what is the idea of unidirectional communication. Unidirectional communication can occur between two OOPics when one is outfitted with a TXLC-434 and the other is outfitted with an RXLC-434. With this setup only the OOPic with the TXLC-434 will be able to send a message across the wireless RF-link and only the OOPic with the RXLC-434 will be able to receive this message. Observe the diagram shown below.

Copyright 2003, Abe Howells Robotics

The OOPic can be programmed using Basic, C, or Java syntax, but we will illustrate all our examples using Basic. We will also be sending data at a baud rate of 1200 BPS. The TXLC-434 and the RXLC-434 can send and receive data at a higher rate, but we have decided to illustrate with 1200 BPS. We will not be performing any encoding, decoding, or error checking in our coding samples. Okay, lets get on with the coding! Every OOPic program must contain a main sub routine, but more importantly we must first decide exactly what OOPic objects are going to be needed in our program. In our program we are only going to need to make use of two different objects: the oSerial object and the oByte object. Since we are going to have one OOPic be the transmitter, while the second acts as a receiver we will need to different programs. We will first concentrate on the transmitters program. Listed below is the transmitter program. -----------------------------------------------------------------------------------------------------------First Declare all objects Dim Tx as new oSerial Dim Tx_buffer as new oByte Sub Init() 'Setup Tx Baudrate Tx.Baud=cv1200 Tx.Operate=cvTrue Setup Tx_buffer Tx_buffer=125 End Sub Sub Main() Init

Copyright 2003, Abe Howells Robotics

Do OOPic.Delay=100 Tx.Value=Tx_buffer.Value Loop End Sub -----------------------------------------------------------------------------------------------------------Now lets figure out what exactly is going on in the above piece of code. All the objects that will be used in the program have been declared. We are using an oSerial object, Tx, and an oByte object, Tx_buffer. Next we have setup an initialization routine, Init, where we initialize our two objects. We configure the serial port with a baud rate of 1200 BPS when we code: Tx.Baud=cv1200. We turn on the serial port when we code: Tx.Operate=cvTrue. Finally we have decided to initialize Tx_buffer with a value of 125. In the Main subroutine we first call our initialization routine, Init, and then we enter a Do Loop, where we wait 100 milliseconds and then transmit the value stored in TX_buffer. Basically, the above program, once loaded in an OOPic with an attached TXLC-434, would transmit the value stored in Tx_buffer every 100ms. Now lets take a look at the program for the receiving OOPic, which is listed below. -----------------------------------------------------------------------------------------------------------First Declare all objects Dim Rx as new oSerial Dim Rx_buffer as new oByte Sub Init() 'Setup Rx Baudrate Rx.Baud=cv1200 Rx.Operate=cvTrue Setup Tx_buffer Rx_buffer=0 End Sub Sub Main() Init Do If Rx.Received=cvTrue Then Rx_buffer.Value=Rx.Value End If 10

Copyright 2003, Abe Howells Robotics

Loop End Sub -----------------------------------------------------------------------------------------------------------Again, we use the exact same objects, but here we have given them different names. The Rx oSerial object will be used to receive any data from the wireless RF-link and the Rx_buffer oByte will be used to store any incoming data. Basically, the program runs though the initialization routine, Init, and then simply loops until data is received on the serial port. Once data is received from the Rx object it is stored in the Rx_buffer. Obviously, the above two programs are fairly useless as they have been written. These programs have only been written to help illustrate the basic ideas behind serial communication with the OOPic. Additional coding would be necessary to make these two programs perform some other higher purpose and luckily we have two such programs for you to look over. The following programs will be available for you to download: test_rf_tx.osc and test_rf_rx.osc. These two programs have been written so that (2) New CDbot robots can play a game of follow the leader. The CDbot with the program named test_rf_tx.osc is the leader, while the other CDbot is loaded with the test_rf_rx.osc program and behaves as the follower. These two programs may seem a little bit complicated at first, but have been fairly well commented. Below is a picture of the follower CDbot.

I hope this has been somewhat helpful for those of you that are looking for a low-cost method for wireless communication. Email any questions to abe@abotics.com and happy roboting!

Copyright 2003, Abe Howells Robotics

11

You might also like