Project tutorial
Sending Data from PC to Another Using Arduino UNO

Sending Data from PC to Another Using Arduino UNO © CC BY

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

  • 4,152 views
  • 2 comments
  • 10 respects

Components and supplies

Apps and online services

About this project

This project is a good tutorial on sending data using Cheap RF module without dumping the data.

I need to send some data form my laptop serial monitor (embedded tool with arduino IDE) to my PC and receive the data on Arduino IDE serial monitor, so we need:

* Arduino Uno attached to laptop and another for the PC.

Laptop Uno connected to the RF transmitter part and the PC Uno connected to the Receiver.

* each arduino connected to a text LCD to display the sent data as stars, ex(******) -- this step is not important ,just for fun :D.

Steps :

1 - Connect all the parts as Schematics below.

2 - Starting with the Laptop Uno [the Transmitter]:

  • Setup and initialize your serial communications.
  • Read the User input data from serial monitor then.

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.

Send it to PC Uno [the Receiver] through the RF module , consider how "Virtual wire" library works.

3 - Display the data encrypted on the LCD "Optional"

4 - The code source is down below.

then we go to the PC Uno [the Receiver]:

- Read the received data from RF receiver then, write it to serial port to display it on the serial monitor.

TIPS :

- Leave arduino Uno pins (0,1) unused to make sure that serial communications is working fine.

- Understand will VirtualWire library for Arduino

- Adjust the LCD resistance to get good display.

Let's go for schematics and code.

Code

Transmitter.inoC/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.inoC/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;
}
}
}

Schematics

Laptop Uno connected to RF transmitter
Txxx djxuigf1jm
PC Uno connected to RF Receiver
Rxxx h5qlnmtipn

Comments

Author

Mr joe
Mohamed Maher
  • 2 projects
  • 21 followers

Additional contributors

  • Using his "virtual wire" arduino library for handling rf communications. by Mike McCauley

Published on

June 12, 2017

Members who respect this project

19105556 1925747304368527 5188152640299550617 n15327476 594877617365275 5113520037415924578 n mtpf46wsihDe69a62a2b35333cd5fa834c6f202b80 qq25e5259b25be25e72589258720160323205203 uugfypsuzuYo5pqjNeamulIi oica8kbi9fPhoto

and 3 others

See similar projects
you might like

Similar projects you might like

A Posture Detector Sending Bluetooth Data to a Cordova App

Project tutorial by Gini76

  • 5,647 views
  • 2 comments
  • 22 respects

Multifunctional Watch With Arduino Uno

Project showcase by shaqibmusa94

  • 4,444 views
  • 2 comments
  • 8 respects

Combo Masher

Project showcase by Reid Paulhus

  • 2,128 views
  • 1 comment
  • 3 respects

Using 16x2 LCD with Arduino

by Techmirtz

  • 47,853 views
  • 7 comments
  • 49 respects

The Dragon Weigher - Arduino Uno Controlled HX711

Project tutorial by John Hart

  • 2,309 views
  • 3 comments
  • 6 respects

Arduino Game By LCD

Project tutorial by Mohammed Magdy

  • 57,183 views
  • 53 comments
  • 182 respects
Add projectSign up / Login