|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This project uses infrared for autonomous navigation together with RF remote control. We'll use the Ming 4-button TX-99K4A transmitter, Ming RE-99 receiver, and Holtek HT-12D decoder IC. Three primary components required for the RF remote control are shown below.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The TX-99K4A transmitter uses the Holtek HT-12E 4-bit encoder IC, so we'll need the matching Holtek HT-12D decoder IC for the receiver circuit. The Ming RE-99 300MHz RF receiver module operates at the same frequency as the TX-99K4A, so we have a perfect match between transmitter & receiver. The CD-ROM has datasheets for the TX-99K4A Schematic , TX-99K4A Datasheet, HT-12D, and Ming RE-99 in Adobe .PDF format. Project Goal: Micro-Bot will begin exploring the environment using infrared sensors for obstacle avoidance. He will continue to roam until a button is pressed on the remote transmitter. Commands from the remote control unit will take precedence over any autonomous operations. Once the transmitter ends the transmission, Micro-Bot will be released to resume autonomous operation. Micro-Bot will be programmed to read the 4-bit data patterns on the outputs of the HT-12D decoder IC in the RF receiver circuit. These 4-bit binary data patterns will cause program execution within the Check_Remote sub-routine to alter Micro-Bots direction of travel or command him to stop. This gives us a way to remotely control Micro-Bot should he wander too far off course or get into trouble. He will navigate on his own using the infrared sensor until we decide to take remote control of him. Below are the infrared circuits used for several other projects. If you have these already constructed, then move on to the RF section. If not, construct both circuits as shown below.
The Decoder IC: The HT-12D decoder IC has four latching data outputs, and one momentary output. The 4-bit data pattern on output pins D0-D3 will latch, and stay at the last transmitted 4-bit value until we press another button on the transmitter sending a different 4-bit logic pattern. Note: We can't use output pin D3 of the HT-12D. The TX-99K4A transmitter does not change this bit. As shown below in Figure#1, the HT-12E encoder inside the TX-99K4A does not have a switch connected to data input pin #13 or D3. Switch SW-1 [button A] connects to D2, SW-2 [button B] connects to both D1 and D2, SW-3 [button C] to D1, and SW-4 [button D] to D0. There are no switch connections to D3.
It's not shown in the partial schematic in Figure #1, but when any button is pressed power is supplied to the encoder circuit initiating the transmission of data. Releasing a button ends the transmission by removing power from the HT-12E encoder. At the receiver end the decoders VT output pin idles at logic 0. When a transmission from an encoder with the same address as the decoder is being received, the decoders VT output will transition from ground to +5V during the transmission. When we release the transmitter button and end the transmission, VT returns to ground. Hence, VT gives us a momentary bit to use with the 3 latching data bits. We'll sample the decoders VT output with PortA3 looking for logic 1 or +5V. If the VT output is logic 1 we'll jump to a sub-routine named Check_Remote to read the 4-bit binary value present on the decoders latching outputs D0, D1, D2 and the momentary VT output. Within the Ckeck_Remote sub-routine we'll determine which button on the TX-99K4A transmitter is being pressed, and alter Micro-Bots direction or command him to stop if Button D is being pressed.
To control Micro-Bot with the TX-99K4A remote
transmitter, we'll want at least four basic control functions or
commands. We'll assign each the of the transmitter buttons a single function
as follows --:
Whoa..! Where's forward..? We'll make forward the default direction if the VT output is idle or logic 0 since this condition indicates we're not pressing any of the transmitter buttons. This turns control back over to Micro-Bot for autonomous operation each time we release the transmitter buttons. I.E. Micro-Bot can continue on his own using his onboard IR sensor for exploration. Our program code will occasionally check the status of the VT output connected to PortA.3 for logic 1 to determine if any buttons on the transmitter are being pressed. If VT=0 Micro-Bot will ignore the Check_Remote sub-routine. If a button is pressed PortA.3 [aliased as VT] will be logic 1, and we jump to Check_Remote, determine the button that's being pressed, and execute the command assigned to that specific button. Data Patterns:
As mentioned previously, the TX-99K4A transmitter has four
buttons labeled A, B, C and D. The four data outputs of the HT-12D decoder
will provide the following data patterns corresponding to each button press
on the TX-99K4A --:
Table #1 Knowing these data patterns Micro-Bot can easily determine which button is being pressed, and quickly react to each command from the transmitter. The Receiver Schematic: Below is the receiver schematic. The data output pin of the Ming RE-99 RF receiver connects to the HT-12D decoder IC pin #14. Power for the receiver module is provided by Micro-Bots regulated +5V & ground. You can wire this circuit on the Micro-Bot bread board or directly onto the circuit board. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Once you have the infrared & RF receiver circuits assembled, program the code below into Micro-Bot. Notice how we have modified the include file, and saved it with the name REMOTE.INC. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Copyright © 2007
Reynolds Electronics |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||