Mohamed Maher
Published © CC BY

Sending Data from PC to Another Using Arduino UNO

Using cheap 433 MHZ RF module to establish communication between my PC and Laptop, but displays information encrypted on text LCD.

IntermediateFull instructions provided1 hour9,318
Sending Data from PC to Another Using Arduino UNO

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×2
433MHZ RF wireless receiver & transmitter module
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×2
Breadboard (generic)
Breadboard (generic)
×2
Rotary potentiometer (generic)
Rotary potentiometer (generic)
10K Ohm is fine.
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Laptop Uno connected to RF transmitter

PC Uno connected to RF Receiver

Code

Transmitter.ino

C/C++
Reading and sending data from serial port (USB) with arduino is a piece of cake compared with the same task using PIC 18F2550 , I will post soon how to build that project using 18F2550 MCU , it will make you pull out your hair :D .

Important :
to understand how to handle data transmisstion using that cheap RF module , please read a bit about the Virtual wire library by Mike McCauley from here .
https://www.pjrc.com/teensy/td_libs_VirtualWire.html
 /*************************************************************************
 * 
 * send encrypted data via Serial Port toother PC .
 * and display it on LCD
 * __________________
 * Created by : Mohamed Maher [Mr-Joe] . 
 * Embedded System Developper.
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained here in is, and remains
 * the property of Infinity Tech Company  and its suppliers.
 * Please contact me for more information .
 * Mobile: +201060449214
 * Gmail : Mrjoe767@gmail.com
 * FB    : WWW.facebook.com/joe2050
 * Linkedin : www.linkedin.com/in/mohamed-maher-37b167a5
  **************************************************************************/


#include <VirtualWire.h>
#include <VirtualWire_Config.h>

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

char cad[100];
int i=0;
void setup()
{
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  lcd.setCursor(3, 0);
  lcd.print("UNO-TX !");
  
 // initialize serial:
Serial.begin(9600); 
vw_setup(2000);
Serial.println("Encrtypted Communication");
Serial.println("Developed by: Mr-Joe"); 
Serial.println("-------------------------");
Serial.println("Important:(UNO - TX) ");
Serial.println("End with \".\" each data");
}
void loop()
{
if( Serial.available() > 0)
{
cad[i] = Serial.read(); 
i++;
}
if( cad[i-1] == '.')
{
     lcd.setCursor(1, 1);
     lcd.print( "**Classified** " ); 

      
cad[i] = '\0'; 
i=0;
vw_send((byte *)cad, strlen(cad)); 
delay(400);
}
}

Receiver.ino

C/C++
Here, we have to receive the data through the RF module first then .. sent it to the PC Serial monitor
 /*************************************************************************
 * 
 * receive encrypted data via Serial Port.
 * and display it on LCD
 * __________________
 * Created by : Mohamed Maher [Mr-Joe] . 
 * Embedded System Developper.
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained here in is, and remains
 * the property of Infinity Tech Company  and its suppliers.
 * Please contact me for more information .
 * Mobile: +201060449214
 * Gmail : Mrjoe767@gmail.com
 * FB    : WWW.facebook.com/joe2050
 * Linkedin : www.linkedin.com/in/mohamed-maher-37b167a5
  **************************************************************************/

#include <VirtualWire.h>
#include <VirtualWire_Config.h>

#include <LiquidCrystal.h>



LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
char cad[100];
int pos = 0;
void setup()
{
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  lcd.setCursor(3, 0);
  lcd.print("UNO-RX !");

   // initialize serial:
Serial.begin(9600); 
vw_setup(2000);
Serial.println("Encrtypted Communication");
Serial.println("Developed by: Mr-Joe "); 
Serial.println("-------------------------");
Serial.println("Important:(UNO - RX) "); 
  
 // initialize Virtual wire :
vw_setup(2000); 
vw_rx_start(); 
}


void loop()
{
byte buf[VW_MAX_MESSAGE_LEN]; 
byte buflen = VW_MAX_MESSAGE_LEN; 
int i;
if( vw_get_message(buf, &buflen) )
{
 // dont uncomment that unless you need to use a flag for each received line.  
/*if(pos < 2)
lcd.setCursor(0, 1);
else
{
pos=0;
Serial.println(" ");
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("UNO-RX !");
lcd.setCursor(1, 1);
}*/


for (i = 1; i < buflen; i++)
{
Serial.print((char)buf[i]);


}
if( buf[i-1] == '.')
{
     lcd.setCursor(1, 1);
     lcd.print( "**Classified** " ); 
     Serial.println(" ");
      
buf[i] = '\0'; 
i=0;
}
}
}

Credits

Mohamed Maher

Mohamed Maher

1 project • 66 followers
Experienced Founder with a demonstrated history of working in the electrical and electronic manufacturing industry, Embedded System solution
Thanks to Mike McCauley .

Comments