Seven Segment Display Controlled using RF Remote Controller (Part 2 of 3)

<<<< Read Previous Part (Part 1)

In the previous part, we saw the circuit to make a remote controller, to change the number displayed in a seven segment display, using 433.92 MHz radio modules. Here, we will see the receiver part. Receiver will have a common cathode seven segment display. Number displayed in the seven segment display will change when different switches are pressed in the transmitter part. Circuit is done as shown in the following diagram. If the circuit is not clear, view the circuit in pinterest to get a larger and clear view. Pin out diagram of 4511 is given here. Similarly, pin out diagram of common cathode seven segment display is given in this page.

receiver seven segment display

If the circuit is not clear, view the circuit in pinterest to get a larger and clear view. After completing the circuit, upload the following program to your arduino board.

/*
SimpleReceive
This sketch displays text strings received using VirtualWire
Connect the Receiver data pin to Arduino pin 11
*/
#include <VirtualWire.h>

int D0 = 7; // D0 pin of 4511 is connected to the 7th digital pin of arduino
int D1 = 6; // D1 pin of 4511 is connected to the 6th digital pin of arduino
int D2 = 5; // D2 pin of 4511 is connected to the 5th digital pin of arduino
int D3 = 4; // D3 pin of 4511 is connected to the 4th digital pin of arduino

int LE = 3; // LE pin of 4511 is connected to the 3rd digital pin of arduino

byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messages
byte messageLength = VW_MAX_MESSAGE_LEN; // the size of the message

void setup()
{
  Serial.begin(9600);
  Serial.println("Device is ready");
  // Initialize the IO and ISR
  vw_setup(2000); // Bits per sec
  vw_rx_start(); // Start the receiver

  pinMode(D0, OUTPUT);
  pinMode(D1, OUTPUT);
  pinMode(D2, OUTPUT);
  pinMode(D3, OUTPUT);
  pinMode(LE, OUTPUT);

}
void loop()
{
  if (vw_get_message(message, &messageLength)) // Non-blocking
  {
    Serial.print("Received: ");
    for (int i = 0; i < messageLength; i++)
    {
      Serial.write(message[i]);

     if(message[i]=='1')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, HIGH);
        digitalWrite(D1, LOW);
        digitalWrite(D2, LOW);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      }
      
      if(message[i]=='2')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, LOW);
        digitalWrite(D1, HIGH);
        digitalWrite(D2, LOW);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      }      

      if(message[i]=='3')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, HIGH);
        digitalWrite(D1, HIGH);
        digitalWrite(D2, LOW);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      } 
      
      if(message[i]=='4')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, LOW);
        digitalWrite(D1, LOW);
        digitalWrite(D2, HIGH);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      } 
      
      if(message[i]=='5')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, HIGH);
        digitalWrite(D1, LOW);
        digitalWrite(D2, HIGH);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      } 

      if(message[i]=='6')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, LOW);
        digitalWrite(D1, HIGH);
        digitalWrite(D2, HIGH);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      } 

      if(message[i]=='7')
      {
        digitalWrite(LE, LOW);        
        
        digitalWrite(D0, HIGH);
        digitalWrite(D1, HIGH);
        digitalWrite(D2, HIGH);
        digitalWrite(D3, LOW);
        
        digitalWrite(LE, HIGH);
      } 
    }
    Serial.println();
  }
}

If uploading is successful, your receiver part is ready for working. Press different switches in the transmitter part. Number displayed in the seven segment display will change in each presses of switch.

Next : Video Demonstration >>>>

(Visited 1,633 times, 1 visits today)
paulpp644

A deep electronic enthusiast who spent most of my time for electronic experiments. I am also interested in publishing my experiments in my blog for helping other electronics enthusiasts.