Preview

Serial Communication of Arduino with Matlab

Good Essays
Open Document
Open Document
2752 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Serial Communication of Arduino with Matlab
Serial Communication between Arduino and MATLAB
ByAman Mangal IIT Bombay

June 6, 2012

Aman Mangal, IIT Bombay

Serial Communication between Arduino and MATLAB

1/36

Prerequisite

Serial data transfer in Arduino. Follow the link to learn more1 2

http://arduino.cc/en/Reference/serial http://www.ladyada.net/learn/arduino/lesson4.html http://users.ece.gatech.edu/bonnie/book/TUTORIAL/ tut_1.html http://www.mathworks.in/help/techdoc/matlab_ product_page.html

MATLAB programming. To learn more, go to1

2

You should be familiar with MATLAB structures, MATLAB objects etc. Basic programming concepts.

Aman Mangal, IIT Bombay

Serial Communication between Arduino and MATLAB

2/36

Serial Communication

Serial means ”One after another”. Serial communication is when we transfer data one bit at a time, one right after the other. Information is passed back & forth between the computer and Arduino by, essentially, setting a pin high or low. Just like we turn an LED on and off, we can also send data. One side sets the pin and the other reads it. MATLAB can read/send the data from/to the serial port of the computer and process it.

Aman Mangal, IIT Bombay

Serial Communication between Arduino and MATLAB

3/36

Buffer

It is most important to understand the nature of buffer to avoid errors later while writing codes. There exists a buffer between the two events of sending and reading the data. Say a sensor is streaming back data to your program, more frequently than your program reads it. Then the data is stored to a list which we call a buffer. One writes data into it and other reads it, may be with different speeds. Buffer are of finite length.

Aman Mangal, IIT Bombay

Serial Communication between Arduino and MATLAB

4/36

Buffer...in detail

Initially the buffer is empty. As new data values come in they get added to the bottom of the list (most recent data). If your program reads a value from the buffer, it starts at the top of the list (oldest data). Once you read a byte of data,

You May Also Find These Documents Helpful

  • Satisfactory Essays

    NT1210 Lab 1

    • 319 Words
    • 4 Pages

    2. A single byte only contains 8bits of data whereas multiple bytes joined together contain more bits which mean more data.…

    • 319 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    This chapter describes the concepts behind how a CPU reads the contents from RAM. Which of the following is true about the process of read data, as described in the chapter?…

    • 957 Words
    • 4 Pages
    Good Essays
  • Good Essays

    | |data. |give rise to a number of potential |sent in clear text during |…

    • 572 Words
    • 3 Pages
    Good Essays
  • Good Essays

    a. The CPU tells the RAM which address holds the data that the CPU wants to read.…

    • 856 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Midterm 532

    • 852 Words
    • 4 Pages

    | Data received at the destination must be the same as the data sent by the source.…

    • 852 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It 240 Appendix F

    • 301 Words
    • 2 Pages

    | |randomly. This is the type of memory that most people are familiar with as it is|…

    • 301 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    MATLAB: command line mode, M files, data input, formatting output, file I/O, random numbers, statistics, reducing, solving equations, n equations in n unknowns, 2- and…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    Unit 1 Exercise 1

    • 835 Words
    • 3 Pages

    In this Exercise, you will explain how data travels long distances in a real world example.…

    • 835 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    ch02 c

    • 2468 Words
    • 11 Pages

    9. The term “data structures” refers to the speed at which data it is captured, analyzed, and reported.…

    • 2468 Words
    • 11 Pages
    Powerful Essays
  • Satisfactory Essays

    It/210 Course Design

    • 2571 Words
    • 11 Pages

    Reading Read Ch. 3 of Prelude to Programming. Reading…

    • 2571 Words
    • 11 Pages
    Satisfactory Essays
  • Good Essays

    employment legislation

    • 2462 Words
    • 10 Pages

    Data flow: between components eg input, output, memory, processor; representations eg block diagrams, flow chart, images…

    • 2462 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Homework

    • 343 Words
    • 2 Pages

    20. What is the difference between the EEPROM and data RAM space in the HCS12?…

    • 343 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Explorable

    • 2389 Words
    • 10 Pages

    To be able to analyze the data sensibly, the raw data is processed [4] into "output data [5]".…

    • 2389 Words
    • 10 Pages
    Powerful Essays
  • Powerful Essays

    matlab tut

    • 1255 Words
    • 6 Pages

    he beginning of human life is the heart of the abortion debate. Why we never see pro-choice advocates, such like Planned Parenthood or NARAL, explaining where they believe life begins? Their most usual tactics is to shift the debate from whether abortion takes a human life to how "comprehensive sex education" and contraception can lower abortion rates. We are not debating the merits of different strategies to lower abortion rates, we are debating whether or not abortion takes human life, and one side almost never seriously addresses it. Maybe it's because people have a much easier time defending abortion when we don't talk about when life begins.…

    • 1255 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Programm

    • 463 Words
    • 2 Pages

    The program will read data from the file inData. txt and write output to the file outData. txt.…

    • 463 Words
    • 2 Pages
    Satisfactory Essays