Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I had to whip up something similar for work pretty recently. First, pySerial has some odd design issues, one of which makes readline() pretty slow. I suggest using this little modification for faster line reading. Second, as nice as matplotlib can be, it is also veryy slow for live plotting. I highly suggest you check out PyQtGraph, which is a nice library for much faster plotting. You can look up resources/examples on how to do real-time animations with it. Of course, this is only required if your sensor actually outputs to serial fast enough, but honestly it's pretty easy to overwhelm matplotlib even at some slow speeds.