How To Send Serial Data From Arduino To Laptop or PC

By
Advertisement
Serial Communication plays important role within the communication system. All micro-controller should have serial communication port.Serial communication provides a text-user-interface(TUI). One will use serial port of microcontroller to send data serially to laptop/PC or receive data serially from laptop/PC.Here we use arduino board to communicate with the laptop. Arduino board have a minimum of one serial port to communicate known as UART and USART. It communicates with digital pin 0 and 1 of arduino refer to as RX and TX pin as well as with the computer via USB.

send data to pc with arduino
Virtual Terminal
Interfacing LCD With Arduino UNO

Arduino has a built-in function for serial port thus there is no need to go into register detail. In Arduino IDE, one can easily call the serial function for the serial port and job is finished. A simple connection for serial communication is shown below
 serial communication connection
Connection For Serial Communication
For serial communication with arduino, we have to use three function known as Serial.begin(), Serial.print(),Serial.println(). Their function is as follows

1: Serial.begin()
To initialize the serial port for the communication we use this function.In this function baud rate is used to initialize the serial port. Here we have used 9600 baud rate for the communication.

2: Serial.print()
This function helps to send serial data to the device connected to the serial port of arduino board. Using this function we are able to send both ASCII and string to the device.
3: Serial.println()
This function is used to print the send data into a new line and all the function is same as the previous function.
Circuit diagram:

circuit diagram for serial communication
Circuit Diagram
Code: 
Download the hex file from below.this image is just for showing. we connected a led to pin no 5 of arduino board therefore whenever data is sent to laptop/PC led can blink. 

code for serialcommunication
Code
Download:



Video:



6 comments:

  1. Serial Port file download have a problem..
    http://www.mediafire.com/download/fudgh1njp847r8d/serial_display.rar
    File Blocked for Violation.

    ReplyDelete
    Replies
    1. Okkk i will solve this problem very soon keep visiting.

      Delete
    2. now you can download the required file :) keep visiting

      Delete
  2. If you plug the arduino (TTL) into the PC (RS-232) you will blow the Arduino. You need a TTL to RS-232, or a TTL to USB converter.

    ReplyDelete
  3. Hii steve,
    You are right if anybody wants to exchange data between pc and arduino a logic level converter must be needed. But in this article i only concern in proteus simulation for rough idea of it soon i post an article on ttl to rs232 converion. Keep visiting :)

    ReplyDelete