Remote Controller for a Seven Segment Display using RF 433.92 MHz (Part 1 of 3)

<<<< Previous : 433.92 MHz RF Communication Between two Arduino Boards

In the previous post, we saw the circuit for the communication between two arduino boards through 433.92 MHz radio modules. Here, we will design a circuit in which transmitter section will have seven switches (1-7) and receiver section will have a seven segment display. Number corresponding to each switch will be displayed in the seven segment display when any of the switch is pressed. Transmitter circuit is done as shown in the following diagram.

transmitter (copy)

After completing the circuit, upload the following program to your arduino board. Before uploading the program, VirtualWire library should be installed properly in your arduino IDE. Read my previous part for installing the VirtualWire library in your arduino IDE.

/*
SimpleSend
This sketch transmits a short text message using the VirtualWire library
connect the Transmitter data pin to Arduino pin 12
*/

#include <VirtualWire.h>

void setup()
{
  Serial.begin(9600);
  
  // Initialize the IO and ISR
  vw_setup(2000); // Bits per sec

  pinMode(2, INPUT);
  pinMode(3, INPUT);
  pinMode(4, INPUT);
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
}
void loop()
{
  int from_2 = digitalRead(2);   // Read the state of switch 7
  int from_3 = digitalRead(3);   // Read the state of switch 6
  int from_4 = digitalRead(4);   // Read the state of switch 5
  int from_5 = digitalRead(5);   // Read the state of switch 4
  int from_6 = digitalRead(6);   // Read the state of switch 3
  int from_7 = digitalRead(7);   // Read the state of switch 2
  int from_8 = digitalRead(8);   // Read the state of switch 1
  
  if(from_2==1)
  {
    send("7");      // If switch "7" is pressed, transmit "7".
    delay(1000);    
  }

  if(from_3==1)
  {
    send("6");      // If switch "6" is pressed, transmit "6".
    delay(1000);    
  }
  
  if(from_4==1)
  {
    send("5");      // If switch "5" is pressed, transmit "5".
    delay(1000);    
  }

  if(from_5==1)
  {
    send("4");      // If switch "4" is pressed, transmit "4".
    delay(1000);    
  }
  
  if(from_6==1)
  {
    send("3");      // If switch "3" is pressed, transmit "3".
    delay(1000);    
  }
  
  if(from_7==1)
  {
    send("2");      // If switch "2" is pressed, transmit "2".
    delay(1000);    
  }

  if(from_8==1)
  {
    send("1");      // If switch "1" is pressed, transmit "1".
    delay(1000);    
  }

}
void send (char *message)
{
  vw_send((uint8_t *)message, strlen(message));
  vw_wait_tx(); // Wait until the whole message is gone
}

If uploading is successful, your transmitter part is ready for working. Next is the receiver part.

Continued in Next Part (Part 2) >>>>

(Visited 4,355 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.