plotting real time data from arduino uno using python code


Plotting Real Time Data From Arduino Uno Using Python Code

 Introduction :

plotting real time data from arduino uno using python code is one of the best way to help you gain information about what is happening. For example Tracking the real time traffic of your blog website or analysis real time data of facebook ads etc. 

Plotting Real Time Data From Arduino Uno Using Python Code
Plotting Real Time Data From Arduino Uno Using Python Code

Pre-requirement :

  1. Arduino IDE
  2. Python Ide
  3. Arduino UNO
  4. potentiometer

Procedure (plotting real time data from arduino uno using python code) :

For this project we simply take the sensor values data and it’s send to laptop screen using python code and plot this value in real time 
Coding :

Python code for plotting real time data from arduino uno :

import serial
import matplotlib.pyplot as plt

plt.ion()
fig=plt.figure()


i=0
x=list()
y=list()
i=0
ser = serial.Serial('COM13',9600)
ser.close()
ser.open()
while True:

    data = ser.readline()
    print(data.decode())
    x.append(i)
    y.append(data.decode())

    plt.scatter(i, float(data.decode()))
    i += 1
    plt.show()
    plt.pause(0.0001)  # Note this correction

Summary :

In this project we saw How to plotting real time data from arduino uno using python code. so friends about this project you have any problem then free to ask me

Resources : highvoltages

BEST OF LUCK!!

I am Mr. Sachin pagar the founder of Pythonslearning, a Passionate Educational Blogger and Author, who love to share the informative content on educational resources.

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *