Real-Time Data Visualization and CSV Logging with Arduino and Python

preview_player
Показать описание
In this video, I demonstrate how to send sensor data from the Arduino, plot the data in python, and then automatically save the data to a CSV file.

Check out this Reference Desk Mat for Arduino:

Video Timestamps:
0:00 - Introduction
0:11 - Arduino Code
0:59 - Python Code
4:15 - Data Visualization in Arduino
4:25 - Data Visualization in Python
4:34 - Saving data to a CSV

👉Subscribe for more robotics and engineering tips:

Share this video with a friend:

Website:

Parts needed for this example:

Connect:
Instagram - /theboredrobot
Twitter - @theboredrobot
Pinterest - /TheBoredRobot

Disclaimer: This video contains affiliate links, meaning that if you make a purchase from one of the product links, I'll receive a small commission.
Рекомендации по теме
Комментарии
Автор

perfect on point video!
In this world theire are 2 typ's of Tutorials those who go 25min+ and thos who just get to the point in 5min

Stakodron
Автор

Thank you so so so much !! This is exactly what I needed, short and effective, really good tutorial.

LeLouisLafontaine
Автор

Thank you so much for this. Straight to the point, clean code, and easy to apply to just about any project with sensors. You really saved me a bunch of time on StackOverflow hahaha

andrepereira
Автор

That was really well edited and so informative!! Thanks for actually explaining what each line does it was so helpful, def subscribing :)

remremgaming
Автор

Great video. Wish you had made it a year ago when I was banging my head trying to figure this out.

brynmrsh
Автор

Thank you! Phenomenal video! I love the style I love the explanations, to the point and easy to follow!!

You may was to consider adding to the end of the ser.close() in the in_close() function. My system doesn't automatically close serial communication and this may save some headaches for other viewers as well!

joshuas
Автор

oooh i'm gonna need this really soon.
Thanks for saving a ton of people a ton of effort :)

ameliabuns
Автор

can you please tell me which compiler you used for python?

zainarshadvirk
Автор

hello. im performing a teste where i need that the sensorValue1 and 2 to be a float. because i need to be very precise.
and so when i put float sensorValue1 and 2, in the python code, the append on the list does not accept float value to be assigned. Can you help?

PeedrooHenriiquee
Автор

can i do the same thing in matlab ?? for further data processing and visualize as sub plots

vigneshkailas
Автор

I have to run the python file when the Arduino starts running?

Daniel-dgpo
Автор

since arduino is running before the python script activates the time stamps do not start at 0. is there a way to make the timestamp start at zero once the python code starts?

Автор

void setup() {
Serial.begin(115200); //setting up the connection between arduino and computer
}

void loop() {
float time = micros() /1e6; // calculate the current time using micros and convert it to seconds for time stamping
int sensorValure1 = analogRead(A0); //read the analog values from the two light sensors
int sensorValure2 = analogRead(A1);
delay(100); // add a short delay to ensure a reasonable sampling rate

Serial.print(time); // send the data to the computer via the seral port. Print the "timestamp, sensorValure1, sensorValure2"
Serial.print(", ");
Serial.print(sensorValure1);
Serial.print(", ");

}

Alina-phvl
Автор

hi, where can we download code?
Thanks!

gregowen
Автор

Hi great video. But my code does not work. It just displays a blank plot and says: Animation was deleted without rendering anything

visheshsaxena