In Python 3 i think numpy is not necessary for this. To work this program as to change line 30 to: arduinoString = arduinoData.readline().decode("utf-8") #read the line of text from the serial port
@DonQuike315 жыл бұрын
also .decode('ASCII') works, or just .decode()
@bendibhafed16875 жыл бұрын
very intersting ... thnx
@ayushbhardwaj41685 жыл бұрын
You just saved my hour of debugging, thanks a ton
@dirkdevries5374 жыл бұрын
Very helpful comment
@ashusingh65173 жыл бұрын
thank you
@steveholt89915 ай бұрын
10 years later and I'm still learning ! Thanks Paul, more spanners in the toolkit!
@fjskfjdkdksofk9 жыл бұрын
i have seen every single lecture of you from arduino #1. all of them just the best of the best!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@paulmcwhorter9 жыл бұрын
+Wanseok Yang Thank you for your encouragement. I am glad you find the series useful.
@localbroadcast6 жыл бұрын
your series of lessons has really helped me out regarding getting a start on my python learning curve. nothing better than someone stepping you through it one thing at a time, explaining it all as you go. I have learnt how to program html, action script, basic, arduino all without any schooling, but at times it is very difficult without the kind of support you get from an actual class. There are many gaps in my knowledge which most professional programmers would find comical.. so again I appreciate you putting these lessons out there for people like me as I find it has filled in quite a few gaps I had while trying to figure out python on my own so far. thanks! please resist the urge to make your videos ' members only content' or something like that... share the knowledge and it'll come back to you ten fold.
@nicknackthenoo9 жыл бұрын
I have learnt more today than I have in 2 Years by watching these videos. You Sir are a good teacher and I like the way you make mistakes in spelling and admit that you have done it. I am now a net-pupil of yours. Thanks.
@paulmcwhorter9 жыл бұрын
+Nick Edd Thanks for the kind words!
@MemoMedranoo2 жыл бұрын
Paul, I wanna say thanks, this script saved my project, I'm doing a multivariable sensorial module. It tracks voltage and current from a 3 phase motor. Collecting data from 3 arduinos at the sime time, I adapted this code and it works perfectly. Keep doing videos like this, you are a great teacher!!
@olddogg608 жыл бұрын
I'm an old dog learning new tricks and I am enjoying your videos. What a fun way to learn new things. You are an excellent instructor. If I had had teachers like you those many years ago, I might have actually been interested in school. :-) At the time I was more interested in the projects I was doing at home on my own.
@RDKCREATIONS3 жыл бұрын
i have done this lesson with a joystick and its awesome. plotted x values and the y values in the graph
@eddiekvh9 жыл бұрын
You're a true teacher. I've learned a ton here. Thanks!
@paulmcwhorter9 жыл бұрын
+Eddie Liberato Thanks for the kind words.
@shailf179 жыл бұрын
hi, i am new to both python and arduino. and i am glad that i came to this tutorial first. Brilliantly explained. Thanks a lot.
@freeelectron82616 жыл бұрын
The scaling and data range updating was really useful and also your enthusiasm is infectious! :)
@karthikvigneshwar87424 жыл бұрын
I just want to wholeheartedly thank you for this channel and all your lessons. They have been very helpful and the way you teach also motivates me to try and emulate the same when I try and teach others. Thanks again!
@shanee751110 жыл бұрын
You are an excellent teacher, Paul. I found your tutorials while looking for information on Matplotlib for Python and Raspberry Pi. I am working on a project at work to automate a particular calibration chore. I've since viewed several of your tutorials and will be watching the rest soon. Thank you so much for making this information so clear and easy to understand.
@paulmcwhorter10 жыл бұрын
Shane E Thanks! Glad the videos are helpful.
@perfil_anonimo_83_br4 жыл бұрын
This is the world best teacher.
@davidbristoll1958 жыл бұрын
Great work Paul. I've missed all of your lessons, but you made this simple enough for me to understand. Thank you!
@yuanfang23527 жыл бұрын
thank you so much for solving my problem in sending multiple values from arduino to python. I'm really new to serial communication and searched a lot of methods but only yours works!
@TheBoss-rk2qr6 жыл бұрын
Thank you Paul! Love is send to you from CSULB Biomedical Engineering students!
@paulmcwhorter6 жыл бұрын
Thanks for the kind words!
@paulmcwhorter10 жыл бұрын
@hanlovciss29449 жыл бұрын
i can not express more how i like your videos, thanks.
@SoumilShah6 жыл бұрын
I need help I have string on x axis and it’s time my value on x axis get cluttered after a while how do I reset or limit my x axis using Matplotlib python
@Parshwadeep9 жыл бұрын
This is awesome Paul !Thanks for sharing. Step by Step process you have is so much better than the other videos where people usually assume most of stuff is known to the viewer . Keep it coming :).... I am new to both Python and Arduino and I am loving it so far...hope to keep the enthu ON with your regular updates !!
@parasbhanot9 жыл бұрын
This is easy with matplotlib and python but it is a nightmare with jfreechart and j2d charts in java . i am glad that i found this tutorial series .thanks
@Zugadizayn10 жыл бұрын
Thank you so much. you are my master ! Best teacher ever !! Your teaching skills and your style is OMG ! absolutely amazing. !!! Mechanical Engineer from Turkey..
@paulmcwhorter10 жыл бұрын
Cihan Büyük Thank you for the kinds works. Glad to hear this material is useful to you.
@sacredinclinations3 жыл бұрын
-thanks so much for this video I have been contemplating getting into microelectronics for a while and your lesson just sealed the deal. I subscribed and I guess its now time to buy stuff!
@penind9 жыл бұрын
The best explanation i never seen before!! you Sr are the best!!! Thanks
@jovano204 жыл бұрын
Thank you sir, as a biotechnology student this was very usefull!
@syedsibteali57613 жыл бұрын
Thank You professor for you teaching this in a quite comprehensive manner. I have a question as i am stucked on the port access denied error in python code. Kinldy let me know how this can be made working
@BrimanAerospace6 жыл бұрын
Finally someone useful
@rupinchaudhry5923 жыл бұрын
Very captivating. Many thanks
@perfil_anonimo_83_br4 жыл бұрын
Do you are the best teacher. I am happy now, the my work is save now.
@freeelectron82616 жыл бұрын
Thanks Paul! Just the info I was after - live plots.
@rsyoung019 жыл бұрын
Lucid, clear explanation, thanks for posting! I especially benefit for line by line discussion of not just wha,t by why you're doing what you're doing...
@zeylien10 жыл бұрын
Thank you very much for these good arduino python tutorials :-) My plotting was slow when using the drawnow() function, there was a few seconds delay between the plot and me activating the sensor. But when i instead inside the loop used the plt.plot() function with a plt.cla() //clears the plot after, it was able to plot at nearly live speed.
@erik7765 жыл бұрын
Thank you so much for your comment! I was having the same issue, but your solution solved it! :)
@rubertgabriel5418 Жыл бұрын
I dont understand what you mean, please cant you hellp me, I am with the same problem.
@Kennerdoll3 жыл бұрын
can you increase the width or the figure in live ploting? lets say: fig = figsize() fig.set_width(10)
@brendan39665 жыл бұрын
Is there a way to eliminate the delay(250) from the arduino code? Maybe update a .csv file with the arduino and then plot the .csv as fast as you can so you preserve the missing values? Obviously the plot would be a little behind.
@gustaavomo6 жыл бұрын
is there any way to stop the infinite loop when the user wants? If yes, how to save the generated graph up to that moment?
@SRGStuff7 жыл бұрын
What sample rate were you able to achieve?
@sagarpotnis12154 жыл бұрын
Thank you Sir, this helped me a lot ...you are too kind... and a very good teacher
@mikecraft45066 жыл бұрын
Paul great lessons - what I would really like to do is for the pressure readings to light leds showing the rise and fall of pressure in steps. Any thoughts or help would be much appreciated, maybe this would be a great future lesson sometime.
@headbanger3738 жыл бұрын
Hey Paul,i am working PIR sensor .how can i show the live plotting with this sensor
@fernandohood55424 жыл бұрын
How would you integrate this with tkinter?
@90MSB2 жыл бұрын
Thanks
@paulmcwhorter2 жыл бұрын
Wow, thanks!
@francescop14108 жыл бұрын
Hi Paul, Your work is amazing and I'm using it for my application! But I need one more thing, is there a way to slide trough the graph? I mean can I manage to stop it and see old values in the graph? I know this video is old, but you would be very important for my thesis! Thank you anyway.
@GeorgeLenoHolmesJr6 жыл бұрын
Python 2.7 readline() returns a str. Python 3 readline() returns bytes. Both versions of python readline() returns the end of line and new line delimiter in addition to the desired data. Why is this not discussed?
@rocket67868 жыл бұрын
@Paul McWhorter You sir, are a brilliant man. much respect!
@jonhclever1234 жыл бұрын
I am currently doing intern about micro controller, and this video opened a new world for me
@hafidzerdityo5524 жыл бұрын
Thank you so much, you helped my final year project :))) Love ya!
@ryangarrison70888 жыл бұрын
Hi Paul, the code I'm hoping to use this for requires user input using the arduino command serial.ParseInt(); It uses this user input, which is a user defined percentage value, and then executes the code and sends the data to the serial until specific conditions are met to satisfy if() statements (when the percentage is reached). Then it stops and waits for another user input. Is there a way to still do this (graph in real time) but also allow user input in between?
@worlwinllc4 жыл бұрын
Thanks for the tutorial - I've been trying to put something like this in a tkinter app - but i get blocked every second while updating - Do you have an example or can you point me to a matplotlib in tkinter with non-blocking update? Thanks again for this tutorial it's helping out.
@anjolaadewale40402 жыл бұрын
Were you able to figure this out?
@ElivsIsAlive157 жыл бұрын
You Sir, did an awesome job there! Thanks a lot!
@slonbeskonechen83103 жыл бұрын
Awesome! So clear and understandable! Thank you!!!
@CarlosCruz-mn6yo5 жыл бұрын
Hi Paul. Excellent lessons. Thanks very much. A question - is it possible to do do a copy paste of your code into another Arduino?
@yz83026 жыл бұрын
How to get time stamp on x axis while plotting temp data. Thanks
@carlosespinosa64467 жыл бұрын
Hello, so if I have only temperature how can I make that array into float without the .split? I just want to plot live data for temperature. Thank you
@kirkchu73049 жыл бұрын
+Paul WcWhorter Not sure it matters because its in a string, but you mispelled "pressure" in your second label for y axis. Enjoying the vids, keep it going!
@paulmcwhorter9 жыл бұрын
***** Yep, there is a reason I became an engineer . . . I can not spell. I tell the kids that if you are good enough in math they will pay someone to follow you around and clean up your spelling.
@kurtauerbach58834 жыл бұрын
wow you made this seem simple simple = fun !! (like the comments in code) just found ur lessons. I havent looked yet still catching up with this one. but like to suggest saving the data using ..than later pulling it using python and redisplay it. kind of like user can choose which file to display. saving by datetime stamp maybe simplest or user option another lesson..Thank you great lesson!!
@emmanuelirog-irog10806 жыл бұрын
How to embed the drawnow animation to a tkinter GUI ?
@kingleo1884 жыл бұрын
Very well explained. Excellent effort. You have explained this very well. Thank you so much
@lidazheng81595 жыл бұрын
Thank you very much for this video Mr McWhorter! It is absolutely helpful. I have one question related to tkinter GUIs. How can I embed this 'drawnow graphic' into a tkinter interface?
@msingh8465 жыл бұрын
SIr , I want to plot in scatter format. So I did plt.scatter().. but this code is not working but it works with plt.plot(). Can you help me out please
@diymicha49059 жыл бұрын
Hi there, very good tutorial for me as python n00b, thanks. But why don't you use if (len(TempF)>50): TempF.pop(0) ... In this way you don't need a counter variable. I think this might be useful for readings that last forever to prevent an overflow of the counter.
@shek29947 жыл бұрын
Suppose If user want to show the values associated with each DOT(sample) plotted instead of looking at Y-axis to know the temperature, how do I do this? or how do I show value for every sample plotted on window?
@BesrSence6 жыл бұрын
just i want to express my deep depreciation to you!
@hyperconnected98096 жыл бұрын
hey paul, I want to display xbee data on my gui(tkinter) can u explain in detail about how I can do it.Thank you
@arrnwodu29 жыл бұрын
Hey paul will i be able to follow along with you using the arduino nano?
@paulmcwhorter9 жыл бұрын
+arrnwodu2 Yes, it should be pretty much the same.
@aayushsingh96226 жыл бұрын
Is there any way to transmit data without connecting usb and displaying it using python?
@AJAYSINGH-ic2iy6 жыл бұрын
hello sir, i liked your video.I am also working in xbee s2 module.For providing better controlling of systems can we provide two way communications between co-ordinator and router?
@debajyotisg7 жыл бұрын
When I try to get arduinostring.split(",") I get this error a bytes-like object is required, not 'str' Help
@sreeganesh28707 жыл бұрын
yes, bro I too got the same error.
@jomephift94208 жыл бұрын
Hello, really great Tutorials! Could anyone please help me with this error: pressure = float(dataArray [1]) IndexError: list index out of range I Followed Lesson 11 untill 31:45. Error only with Raspian on RaspberryPi, but all ok on PC. But I have to use RaspPi! Help much appreciated!!
@codectronic81632 жыл бұрын
i am facing the same problem. any help would be great.
@syselec12156 жыл бұрын
thank you very very much sir, you are the best teacher
@aradhyamathur73559 жыл бұрын
sir i have been getting some problem lately while interacting with python, the data received in python is going out of sync while there is no problem while using arduino IDE ; another problem is that without exception handling for SerialException i get this error message "device showing readiness to read but returned no data (device disconnected )?"
@alexandervaldez164610 жыл бұрын
Amazing work Mr. Paul thank you very much!
@montenegromf4 жыл бұрын
Thank you Sir! I big hello for Sweden and your enthusiasm looking the results are great! Thank you very much, I've learned a lot of following your tutorials
@jakaknafelc663810 жыл бұрын
Thanks for your tutorials. For my arduino project i'm trying to make my data visible on my pc->web server. searching the web i "stumble" on your tutorial for Using Python with Arduino. What i have seen in your tutorials, I think i can achieve to make my project work. You gave me the joy for learning more python. Your tutorials are one of the most pleasant and educational to watch. Again thank you for your contributions you are true teacher. Best regards. sorry for bad english
@paulmcwhorter10 жыл бұрын
Jaka Knafelc Thank you for the kind and encouraging words. I am glad the material was helpful to you. I developed the videos for my high school engineering class, but am pleased to find that others are benefiting as well.
@jfmoya9 жыл бұрын
Paul, thank you so much for sharing! Very useful tutorial for my project.
@dilip.rajkumar7 жыл бұрын
Can we plot LIVE from IOT data getting updated on a Google spreadsheet ?
@Debraj19789 жыл бұрын
Excellent tutorial and very detailed explanation. Thank you sir for your contribution.
@Kennerdoll3 жыл бұрын
can you save the data?
@muhammadtalemand65654 жыл бұрын
Hello sir... Hope You are fine.. Sir I have a question related to your video.. Sir I am working on Tkinter where I have made a GUI that displays 3 graphs on canvas in real time.. Sir I faced the problem in uploading continuous data on it.. Kindly help..
@ajayr148 жыл бұрын
Hi Paul.. Thank you so much for your amazing video. I've followed your video and created a live plot with 4 PTC temperature sensors. 2 sensors in one figure and other two in another figure. I am saving the live plot simultaneously. Since I used 4 temperature sensors, I made 4 different arrays like you did. The program is working fine but it looks like it hangs or makes lot of load on the figure after I run it for very long time.. I am not clearing the plotting data like you did because I need to show the exact plot as it is. I need to ask you if array is a good option if I have lots of sensors and have to plot for a very long time?
@thaninilai80985 жыл бұрын
Thanks a lot Paul! Great tutorial and you are awesome!
@ashleycronk4548 жыл бұрын
Great tutorial!! Super easy and now I have a pretty great python program that can do a whole lot with arduino and multiple sensor units
@prashanthb65217 жыл бұрын
Excellent. Thanks a lot for this tutorial.
@MultiBubbo8 жыл бұрын
Thanks for the amazing lecture Paul. Could you please shed some light on how to create two separate figures in the makeFig function. Can we create the figure object outside the function, mark the axes, title just once and not do that every time makeFig is called ? I tried that but it is not working. Looking forward to your reply. Thanks Again !!
@oneoffmotors48868 жыл бұрын
Please help! getting an error message. ValueError: could not convert string to float: The Temp is: 82.76 degrees F. All Code is correct. The Serial Port is working fine, I have been researching for hours. This one really has me stuck!
@aryanjain98777 жыл бұрын
I want to plot voltage versus cureent and i want to plot as horizontal axis is voltage and vertical axis is current in serial plotter using an arduino. can u tell me plez is it possible, if yes then plez tell how can i plot? if now then can u suggest altrnative way to plot vi charactristics using an arduino???
@vinicioschmidt45717 жыл бұрын
How do plot in two graph? (temp and press)
@morgansparkes70748 жыл бұрын
Hey +Paul McWhorter , I love your videos! They are very helpful for those such as myself who are new to python. I do however have one question about Matplotlib. Is there any way that I can have two or more graphs pop up to display two or more values that come in over serial? I am using the BME280 sensor and I am trying to visualise both temp and pressure as well as humidity. Thanks so much for these videos!
@asmafajraoui3437 жыл бұрын
hi morgan hope u r having a good day i have the same question and if you can share with me how did u plot different graphes something like subploting i mean thank you
@usamasmartends12677 жыл бұрын
i get an error on float command i.e. index out of range sometimes program runs fine and sometimes this error appears
@akki1111981257 жыл бұрын
can u pls tell me how to control servo motor using python with arduino?
@aleksandrjaworski778910 жыл бұрын
Wow, nice tutorials. I'v bought adruino to use such tutorial. Do you know, how to output updating data with django or another web-framework? Can you make a tutor for such situation? I suppose, it needs websocket server and plotting of charts with any js framework.
@reyjesus578 жыл бұрын
I need help, I get the error: Traceback (most recent call last): File "Untitled", line 24 drawnow(Fig) File "C:\Python27\Lib\site-packages\drawnow\drawnow.py", line 61, in drawnow else: plt.draw_all() AttributeError: 'module' object has no attribute 'draw_all' and I don´t know why. :( This is the code: import serial import numpy import matplotlib.pyplot as plt from drawnow import * tempF = [] presF = [] arduinodata = serial.Serial("com4", 115200) plt.ion() #Le dice a matplotlib que quiero que la grafica se vaya actualizando def Fig(): #Crea una funcion que hace la grafica plt.plot(tempF) while True: #While para siempre, ya que siempre sera verdadero while (arduinodata.inWaiting()==0): #Esperar aqui mientras hay datos pass # No hace nada arduinoString = arduinodata.readline() dataArray = arduinoString.split(" , ") temp = float(dataArray[0]) pres = float(dataArray[1]) tempF.append(temp) presF.append(pres) drawnow(Fig) plt.pause(.000001) please, please, please help me :(
@louissaadeh90888 жыл бұрын
+Rey Rincón I have the same error =(
@louissaadeh90888 жыл бұрын
+Primal Tech I FIXED IT!!! 1. go to C:\Python27\Lib\site-packages\drawnow 2. open drawnow.py in a text editor 3. search for 'plt.draw_all()' 4. comment out the else statement. eg: #else: plt.draw_all()
@reyjesus578 жыл бұрын
+Primal Tech Thanks :D you're the best
@胡鑫欣8 жыл бұрын
I comment out else:plt.draw_all(), but it show a static graph, if i close the graph, it show the second graph.please help me......
@renelomasrodriguez72548 жыл бұрын
Lous Saadeh you are the best people in the world, THANK YOU
@nileshpatil31087 жыл бұрын
hello sir, i have followed you from beginning , but when i tried to check output of temperature and pressure using BMP180 , but on my Arduino IDE Serial Monitor is empty its not showing any output,,,,can you please help me???
@DonQuike315 жыл бұрын
Thank you so much for this tuto, I have been seeking for a tutorial like this! BTW i'm doing the same thing with Python 3 and jupyter notebook
@syedsibteali57613 жыл бұрын
How did you import drawnow in jupyter notebook as i am unable to do it.
@farizmuhammad6589 жыл бұрын
great tutorial video sir. thanks do you know how to stream data real time from arduino to web and make a graph from that data ?
@nicholasesposito12124 жыл бұрын
when i do plt2 it tells me that i have a syntax error and i cant figure out why, any help would be greatly appreciated
@VPannagS4 жыл бұрын
can u post the snapshot of the code?
@stlo03093 жыл бұрын
does anyone know how can i resolve lag? my plots slow down a LOT after 5-10 seconds of activity for some reason
@kuochiyoug8 жыл бұрын
Perfect! Thank your tutorial!
@kristofferlindvall928510 жыл бұрын
Okey, well the plot is running now, but it is going really slow. I am trying to plot angles from an accelerometer and gyro. Is there any way to make it go faster? Maybe another program is neccesary?
@rubertgabriel5418 Жыл бұрын
did you fix this problem? Im also would like to plot the datas more faster, but i dont know how..
@renelomasrodriguez72548 жыл бұрын
Hello i have done every tutorial since here but when i compile a messenge apears sayng: AttributeError: 'module' object has no attribute 'draw_all' i dont know whi y have check again much times, but it continu appearing, could you help me?