In a remote control application if loads or devices are directly interfaced to the RF receiver a maximum of 4 devices or loads can be controlled by the RF module. This is because a 4-bit data transmission allows only four control signal at the four data pins of the receiver’s decoder IC individually. However, on a 4-bit data, maximum 16 control signals can be sent. In order to utilize full potential of the 4-bit data transmission, loads need to be interfaced with the receiver module via other logical circuit or microcontroller based circuit instead of direct interfacing.
By using a microcontroller based circuit, the 4-bit data can be analyzed to control at most 16 loads corresponding to each control signal. Even each control signal can be utilized to carry out a sequence of operations on multiple loads or batch operations on multiple loads connected at the receiver section. This project is a demonstration of performing batch operations on a set of loads by connecting them to the receiver section via microcontroller circuit.
The loads can any actuators, relays, motors or sensors but a series of LEDs is used as load in the following project. This is an Arduino based project and the microcontroller is programmed to analyze four control signals to invoke four different lighting patterns on the series of LEDs. Since the Arduino Pro Mini has 14 digital input/output pins, a series of maximum 10 LEDs can be flashed with different lighting patterns after 4 input/output pins are used for receiving the control signals but for demonstration only four LEDs are used to display the patterns.
Fig. 1: Prototype of Transmitter Side of Arduino based Wireless LED Pattern Generator
Components Required
Sr. No. | Components Required | Qty. |
---|---|---|
1 | RF Transmitter and receiver module (434 Mhz) | 1 |
2 | HT12E/ HT12D Encoder IC | 1 |
3 | LEDs | 5 |
4 | Resistor – 1KΩ (Quarter Watt) | 8 |
5 | Resistor – 1MΩ (Quarter Watt) | 1 |
6 | Resistor – 50KΩ (Quarter Watt) | 1 |
7 | Resistor – 1KΩ (Quarter Watt) | 4 |
8 | Battery – 9V | 2 |
9 | 8×1 DIP switches | 2 |
10 | Arduino development board | 1 |
11 | Resistor network 8×1@1K | 2 |
12 | Push button switches | 4 |
13 | Bread Board | 3 |
14 | Connecting Wires | – |
Fig. 2: Block Diagram of Arduino based Wireless LED Pattern Generator
Circuit Connections
The series of LEDs is remote controlled using the RF transmitter and receiver. The transmitter section is connected by interfacing RF transmitter with the antenna of standard height and the HT12E encoder IC. The circuit connections are made as specified by the data sheets of the RF transmitter and encoder IC. The pin 14 of encoder IC is grounded to facilitate uninterrupted transmission and its address byte is configured to 0x00 by grounding all the address bits.
At the receiver section there is a connection of RF receiver with the antenna and HT12D decoder IC. These connections are made as specified by the data sheets of the RF receiver and the decoder IC. The decoder IC is configured to have an address of 0x00 for matching the address of the transmitter. The data bits D0 to D3 of the decoder IC are connected to digital input/output pins 13 to 10 respectively. A series of LEDs is connected at pins 9 to 6 of the Arduino board. The LEDs are connected to the pins through ground so that on receiving HIGH bits, they are forward biased and they start glowing. When there is LOW bits output at the LED connected pins, LEDs remain reverse biased and does not glow. The analog input pins are unused and power and ground are supplied at the VCC and Ground labelled pins respectively. Learn about basic circuit connections of Arduino Pro Mini here.
Fig. 3: Prototype of Receiver Side of Arduino based Wireless LED Pattern Generator
How the Circuit Works
Both the RF transmitter and receiver are configured to have address byte of 0x00. The transmitter section has pin 14 of encoder IC grounded so that there is a continuous transmission to the receiver section. By default, the data pins of the encoder IC are connected to ground but they are also parallel connected to VCC through push-to-on switches. On pressing a switch the respective data bit gets HIGH. The transmitter section can transmit bit between 0x0 to 0xF. The default transmission is 0x0. The control signals for invoking four different lighting patterns on the LEDs has been selected to 0x1, 0x2, 0x4 and 0x8. The control signals 0x1, 0x2, 0x4 and 0x8 can be passed by pressing the switch connected to data pins D0, D1, D2 and D3 respectively while keeping switches connected to other data pins released and thereof keeping the respective data pin HIGH and the other data pins to LOW.
The 4-bit RF signal is received from the data pins D0 to D3 of decoder IC and latched to pins 13 to 10 of the Arduino Pro Mini. These pins of the Arduino are configured as input pins in the program code’s initialization. The LEDs are connected to pin 9 to 6 of the board and these pins are configured as digital output in the program code’s initialization. The default nibble received is 0x0 and the board is programmed to do nothing till it receives the default signal.
When switch connected to D0 pin of encoder IC is pressed, a control nibble 0x1 is transmitted to the receiver section. The switch is released after pressing once. This nibble is read by the microcontroller and a sequence of HIGH and LOW bits is passed on a delay of 500 millisecond to the output pins 9 to 6 one after the other. So a pattern of each LED blinking for one second from left to right one after the other is flashed.
When switch connected to D1 pin of encoder IC is pressed, a control nibble 0x2 is transmitted to the receiver section. This nibble is read by the microcontroller and a sequence of HIGH and LOW bits is passed on a delay of 500 millisecond to the output pins 6 to 9 one after the other. So a pattern of each LED blinking for one second from right to left one after the other is flashed.
When switch connected to D2 pin of encoder IC is pressed, a control nibble 0x4 is transmitted to the receiver section. This nibble is read by the microcontroller and a sequence of HIGH bits is passed on a delay of 100 millisecond to the output pins 9 to 6 one after the other and then LOW bit is passed to each pin from 9 to 6 on a delay of 100 millisecond. So a pattern of each LED switching ON one after the other from left to right and then switching off again from left to right is flashed.
When switch connected to D3 pin of encoder IC is pressed, a control nibble 0x8 is transmitted to the receiver section. This nibble is read by the microcontroller and a sequence of HIGH bits is passed on a delay of 100 millisecond to the output pins 6 to 9 one after the other and then LOW bit is passed to each pin from 6 to 9 on a delay of 100 millisecond. So a pattern of each LED switching ON one after the other from right to left and then switching off again from right to left is flashed.
Fig. 4: Image of Arduino based Wireless LED Pattern Generator
Programming Guide
The program code first run the initialization code. The variables are assigned to reference received codes at pin 13 to 10 as tx4 to tx3 respectively and pins where LEDs are connected are referenced as led1 to led4.
After initialization a Loop() function is called where all the LEDs are default to switch off by writing LOW signal at the pins by using DigitalWrite() function and each transmitted code is checked by using DigitalRead() function. An if-else-if logic is implemented to check received codes and invoke LED lighting patterns.
The 0x1 code is checked by verifying if tx1 pin is HIGH. If it is high a sequence of HIGH and LOW bits is passed to pins 9 to 6 one after the other on a delay of 500 milliseconds.
Otherwise if 0x2 is received by checking if tx2 is HIGH, a sequence of HIGH and LOW bits is passed to pins 6 to 9 one after the other on a delay of 500 milliseconds.
otherwise if 0x4 is received by checking if tx3is HIGH, first a sequence of HIGH bits is passed from pins 9 to 6 on a delay of 100 milliseconds and then a sequence of LOW bits is passed from pins 9 to 6 with the same delay.
The code pins are configured as input pins and led pins are configured as output pins in an initialization function setup(). The baud rate is set to 9600 bits per second using the Serial.begin() function.
The if-else-if logic tests the conditions top to down i.e. first it tries to detect 0x1, if it is not true, it skips to detect 0x2 and so forth. Therefore, if any switch connected to data pin of lower bit denomination of the encoder IC like D1in contrast to D2 or D3 of the encoder IC is left pressed, though a different control signal like D1 and D2 both are pressed and 0x6 is transmitted, the if-else logic will implement the lighting pattern corresponding to lower bit denomination (as it is tested before the other in the code) and will skip the test condition.
Project Source Code
###
//decoder 10,11,12,13 output pins connected to arduino 10,11,12,13 digital pins as input. int tx1 = 10; int tx2 = 11; int tx3 = 12; int tx4 = 13; //decoder 10,11,12,13 output pins connected to arduino 6,7,8,9 digital pins as input
int led1 = 6; int led2 = 7; int led3 = 8; int led4 = 9;void setup() { pinMode(tx1,INPUT); pinMode(tx2,INPUT); pinMode(tx3,INPUT); // decoder output microcontroller reading as input. pinMode(tx4,INPUT); pinMode(led1,OUTPUT); pinMode(led2,OUTPUT); pinMode(led3,OUTPUT); // led's as output. pinMode(led4,OUTPUT); Serial.begin(9600); }void loop() { // turn off all the LEDs first digitalWrite(led1,LOW); digitalWrite(led2,LOW); digitalWrite(led3,LOW); digitalWrite(led4,LOW); // reading data and storing in a variable for further use. int Tx1 = digitalRead(tx1); int Tx2 = digitalRead(tx2); int Tx3 = digitalRead(tx3); int Tx4 = digitalRead(tx4); if (Tx1 == HIGH){ digitalWrite(led1,HIGH); delay(500); digitalWrite(led1,LOW); delay(500); digitalWrite(led2,HIGH); // left to right sequence delay(500); digitalWrite(led2,LOW); delay(500); digitalWrite(led3,HIGH); delay(500); digitalWrite(led3,LOW); delay(500); digitalWrite(led4,HIGH ); delay(500); digitalWrite(led4,LOW); delay(500); }{ digitalWrite(led4,HIGH); delay(500); digitalWrite(led4,LOW); delay(500); digitalWrite(led3,HIGH); delay(500); digitalWrite(led3,LOW); //right to left sequence delay(500); digitalWrite(led2,HIGH); delay(500); digitalWrite(led2,LOW); delay(500); digitalWrite(led1,HIGH ); delay(500); digitalWrite(led1,LOW); delay(500);} else if (Tx3 == HIGH) { digitalWrite(led1,HIGH); delay(100); digitalWrite(led2,HIGH); delay(100); digitalWrite(led3,HIGH); delay(100); digitalWrite(led4,HIGH); delay(100); digitalWrite(led1,LOW); //led’s will on in sequence and later off in sequence //delay(100); //from left to right with 100 milliseconds each// digitalWrite(led2,LOW); delay(100); digitalWrite(led3,LOW); delay(100); digitalWrite(led4,LOW); delay(100); }###
Circuit Diagrams
Project Video
Filed Under: Featured Contributions
Filed Under: Featured Contributions
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.