Wireless Equipment Control Using AT89C51

The circuit that uses microcontroller AT89C51 can control four devices from a distance of upto 30 metres wirelessly. An LCD module is used to show the device number and preset control time at the transmitter module. -- Dr A. A. Bhaskar, Dr H. N. Pandya And S. J. Oza

- Advertisement -

Pin 14 is a transmit-enable (TE) input pin. The encoder will send data only when pin 14 is connected to ground. Whenever a button is pressed, logic ‘0’ is sent to this pin through the microcontroller, thus activating it and enabling transmission.

Pin 17 is the data-out (Dout) pin that sends a serial stream of pulses containing the address and data. It is connected to the data input pin of the TRX RF module.

The time-out control is set using input keys S1 through S4 to turn on/off the devices at predetermined time. The default time for all the devices is ‘00’ seconds. So using ‘up’ key you can increment time by one second, and using ‘down’ key you can decrement time by one second down. At the same time, the LCD module shows the current status of increments and decrements.

- Advertisement -

When the time-out for a device is set, press ‘ent’ key so that the program control transfers to the next device for time-out settings. In the same way, the remaining three time-out settings must be done before pressing ‘run’ key. When ‘run’ key is pressed, it executes the device control program subroutine in the microcontroller and the program automatically collects the time-out information entered by the user and sends the processed data to encoder IC HT12E. The encoder IC sends the data to Din (pin 2) of the RF transmitter module. The data is transmitted by the TRX-434 module to the receiver section through the antenna.

Receiver circuit. Fig. 5 shows the receiver circuit. The RF receiver (RX- 434) module can receive the signal transmitted by the transmitter from a distance of up to 9 metres (30 feet). The range can be increased up to 30 metres using a good antenna.

Fig. 5: Receiver circuit
Fig. 5: Receiver circuit

Dout pin of RX-434 RF module is connected to Din pin of decoder IC HT12D (IC4). Din pin of IC4 receives address and data bits serially from the RF module. Decoder IC4 separates data and address from the received information. It accepts data only if the received address matches with the address assigned to encoder IC1 (HT12E). We have used ‘1111’ as the permanent address for communication. Pins 1 through 8 of IC4 are address pins and therefore 256 possible addresses are available. The address on the encoder and decoder ICs must match for the data to be valid.

The HT12D decoder receives serial addresses and data from the encoder that are transmitted by a carrier signal over RF medium. The decoder compares the serial input data three times. continuously with its local addresses. If no error or unmatched codes are found, the input data codes are decoded and transferred to the output pins. VT pin (valid transmission) goes high to indicate a valid transmission. The HT12D provides four latch-type data pins whose data remains unchanged until new data is received.

Data pins D8 through D11 (pins 10 through 13) of the decoder send 4-bit data to CD4519 multiplexer IC5.

Fig. 6: Software flow-chart
Fig. 6: Software flow-chart

CD4519 multiplexer. This IC provides four multiplexing circuits with common select inputs (SA and SB); each circuit contains two inputs (An, Bn) and one output (On). It may be used ton select 4-bit information from one of the two sources.

There are eight input lines (A0 through A3 and B0 through B3), of which four (A0 through A3) are permanently connected to Vcc through resistor R19, while the rest four (B0 through B3) are connected to the data output lines of the decoder (IC4).

The select inputs can be connected to either Vcc or VT pin (pin 17) for latch or momentary mode-selection section. Jumper switch (Js) is used to select between latch and momentary operation. When latch mode is selected, data present at the output pins is latched, i.e., they remain the same and the respective relay energises until the next change is made in the mode selection. When momentary mode is selected, data present at the output pins is available as long as VT pin remains active-high. As soon as VTpin becomes active-low, the respective relay de-energises.

The latched output data from multiplexer CD4519 is fed to relay driver IC ULN2003, to control up to four devices through the relays (RL1 through RL4). VT pin is connected to LED4 through IC6 to indicate the status of VT signal when it is active-high.

Software program

The software flowchart programmed in the microcontroller of the transmitter section is shown in Fig. 6. It is written in Assembly language and compiled using ASM51 software to generate the hex code. The hex program can be burnt into the AT89C51 microcontroller by using any standard programmer available in the market. We have used TopView programmer from Frontline Electronics to program the microcontroller.




What's New @ Electronicsforu.com

Most Popular DIYs

Electronics Components

Truly Innovative Tech