Hello folks, I am here with a simple and interesting
arduino project, RF based wireless Message Transmitting system. By using this
system you can feed the data to be transmitted serially to the transmitter from
your PC. The project mainly consisting of a Transmitter and a receiver section. Transmitter is made by
Arduino Uno board and receiver is made by Arduino Mega2560. The communication
between transmitter and receiver is through RF, Amplitude Shift Keying. (More about Binary Frequency shift keying) This
wireless transmitter and receiver pair operates in 433Mhz. Only one way of
communication is possible through this system, the received message will be
displayed on a 16x2 alpha-numeric liquid crystal display. The receiving section
updates the display whenever a new message arrives from 433Mhz RF transmitter.
Circuit Diagram of Transmitter
Receiver Section Circuit Diagram
Program - Transmitter
#include <VirtualWire.h>char inData[30];char inChar;byte index = 0;void setup(){vw_setup(2000); // Bits per secSerial.begin(9600);}void loop(){while(Serial.available() > 0){if(index<30){inChar = Serial.read();inData[index] = inChar;index++;inData[index] = '\0';}}Serial.println(inData);send(inData);index=0;}delay(100);}void send (char *message){vw_send((uint8_t *)message, strlen(message));vw_wait_tx(); // Wait until the whole message is gone}
Program - Receiver
#include <VirtualWire.h>#include <LiquidCrystal.h>LiquidCrystal lcd(22, 23, 24, 25, 26, 27, 28);byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messagesbyte messageLength = VW_MAX_MESSAGE_LEN; // the size of the messagevoid setup(){Serial.begin(9600);vw_setup(2000); // Bits per secvw_rx_start(); // Start the receiver}void loop(){if (vw_get_message(message, &messageLength)) // Non-blocking{lcd.clear();for (i = 0; i<messageLength; i++){message[i];Serial.write(message[i]);lcd.write(message[i]);}for (i = 0; i<messageLength; i++){message[i]=NULL;}messageLength = 16;}}
Download VirtualWire Header File.
Comments
Post a Comment