Which MicroPython libraries should I use for ECG with ESP32?
Hello everyone, I'm trying to make ECG using esp32 with micropython, I need help to find the libraries to use in code.
18 Replies
Hi, you can use the machine library for hardware interaction and time for delays.and you can save and plot the data by matplotlib, do you have something specific you want to do!?
Only those txo librairies?, also, Can I use AI to analyse data ?, I mean I want to make GUI with tkinter and add button analyze which takes the data and makes analysis of the patient .
Those are basic libraries, For AI analysis use Python on your computer. Save the ECG data from the ESP32 and transfer it to your computer. Because micropython is not that strong for ai tasks
Ok thank you so much, If I find problems can I ask you again ?,sorry it's my first project.
Absolutely, you can ask in any time, you are very welcome
Hi again, I wanna plot a list of data that contains the values of ECG, thony of micropython doesn't know the library matplotlib.pyplot, what should I do ?, can I plot it in spyder ? If yes how I can do it ?, thank you
@Razali Abdelrahmen I don't think thonny support standard Python libraries like matplotlib.
using Spyder would be better for plotting your ECG data.. and Yes you can use Spyder
how are you going to showcase the plot?
On your device or somewhere else?
OLED, LCD, etc..
Cant imagine matplotlib to run on those...
@Razali Abdelrahmen you can import the library matplotlib.pyplot as plt then use plt.plot(data)...hope this helps??
I have a doubt,
How does matplotLib get to know which display is used,
As we are not passing any display object info to Matplotlib
I wanna plot the graph of an ECG on pc
This message is printed : no module named matplotlib
But my data is on thony, how can I plot it in spyder ?
Thonny
is not suitable for matplotlib
based plotting, Spyder
is a good alternative where you can easily plot your ECG
data using matplotlib
. You can manually transfer your ECG
data to Spyder
or load it from a file and then use matplotlib
to create the plots.
If you're plotting your ecg data directly from a list
If you're using a csv file
Hope this helpsThen i have a way,
you can use serial port to transfer data from micropython to your desktop
then on PC, use python, pyserial to read data,
and plot normally
Hey @Razali Abdelrahmen first In Thonny Save your ECG data to a file then open and plot it in Spyder using matplotlib it's that easy 😁