🎁📬❄️📦 Holiday Shipping Deadlines are approaching! International customers and domestic ground - get your orders in 12/9/2020 📦❄️📬🎁
0

graphical plotting of lsm6ds33
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

graphical plotting of lsm6ds33

by pandeyashwani on Thu Nov 12, 2020 8:21 am

Hello i am trying to visualize the lsm6ds33 acceleration sensor data. But i am getting blank graph can you please
help. Whats wrong with the code.

Sincerely
Attachments
MCP2221_Test (1).py
(5.74 KiB) Downloaded 3 times

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by mikeysklar on Fri Nov 13, 2020 2:48 pm

Have you made any changes to our stock example code from this guide:

https://learn.adafruit.com/jupyter-on-a ... elerometer

Which platform are you running on? Did you have any problems with setup?

https://learn.adafruit.com/circuitpytho ... 2221/setup

mikeysklar
 
Posts: 2398
Joined: Mon Aug 01, 2016 8:10 pm

Re: graphical plotting of lsm6ds33

by pandeyashwani on Fri Nov 13, 2020 3:00 pm

Hello Mikeysklar

Actually, I have used Jupiter notebook for that, I have installed all the required libraries for MCP2221, but I am getting blank graph without any data.

I have used Mu editor to visualise the raw data using a plotter. In Mu editor, I am getting raw data but I am not able to acquire time base on X - axis.

So my main intention is to visualise the data in Y-axis and Time in X-axis.

Sincerely

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by mikeysklar on Sat Nov 14, 2020 3:06 pm

@pandeyashwani,

Which guide are you following for the Jupyter visualizer + MCP2221 usage?

I don't think Mu can handle more than one axis (y-only) for now. Just a stream of sensor data without x-axis time stamps.

Were you using following Adafruit SensorLab Guide? That seems like the type of Jupyter + LSM6D with 2-axis charts you are going for:

https://learn.adafruit.com/adafruit-sen ... th-jupyter

mikeysklar
 
Posts: 2398
Joined: Mon Aug 01, 2016 8:10 pm

Re: graphical plotting of lsm6ds33

by pandeyashwani on Sun Nov 15, 2020 2:20 pm

Hi Mikeysklar

I am extremely thanks for helping me. Actually, I am using this guide,

https://learn.adafruit.com/jupyter-on-a ... elerometer

Moreover, my intention is to visualise the acceleration data with respect to time. Precisely, I want to visualise the acceleration data on Y-axis and Time in X- axis.

I am using a raspberry pi with LSM6DS33 sensor. I am a beginner in Python so I need your help.

Sincerely Yours
Ashwani pandey

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by mikeysklar on Mon Nov 16, 2020 8:11 pm

Ashwani,

Take a look at the Magnetometer calibration. There is an example of plotting multiple axis that could be something you can practice with the LSM6DS33 you have.

https://learn.adafruit.com/adafruit-sen ... th-jupyter

Also to pull code from another on-line example you could start your own millis counter to get an idea of time for the x-axis:

https://ozzmaker.com/berryimu/

Code: Select all | TOGGLE FULL SIZE
startInt = mymillis();
//Each loop should be at least 20ms.
while(mymillis() - startInt < 20)
{
        usleep(100);
}


mikeysklar
 
Posts: 2398
Joined: Mon Aug 01, 2016 8:10 pm

Re: graphical plotting of lsm6ds33

by pandeyashwani on Tue Nov 17, 2020 9:19 am

Good Evening Mikeysklar

Can you please have a look into my code why i am not getting any graph. Can you please suggest. I want to visualise the raw data of accelerometer in real time.

Sincerely
Attachments
2020-11-17-141012_1280x1024_scrot.png
2020-11-17-141012_1280x1024_scrot.png (136.78 KiB) Viewed 72 times

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by pandeyashwani on Tue Nov 17, 2020 9:23 am

Please suggest what changes i should make, so that i can visualise the acceleration value in real time.

sincerely
Attachments
2020-11-17-140952_1280x1024_scrot.png
2020-11-17-140952_1280x1024_scrot.png (154.64 KiB) Viewed 71 times

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by pandeyashwani on Tue Nov 17, 2020 10:43 am

Please examine both the codes given above and please suggest what changes i should make in the code

Sincerely

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by tannewt on Tue Nov 17, 2020 6:26 pm

Take a look at this guide for how to use CircuitPython libraries on Raspberry Pi: https://learn.adafruit.com/circuitpytho ... rypi-linux

It'll tell you how to construct an I2C bus on Raspberry Pi.

tannewt
 
Posts: 1922
Joined: Thu Oct 06, 2016 8:48 pm

Re: graphical plotting of lsm6ds33

by pandeyashwani on Wed Nov 18, 2020 3:02 am

Good Morning Tannewt

Thanks for your suggestions. I already installed all the required libraries of adafruit blinka and I am getting data from the LSM6DS33.

My intention is to plot the graph of LSM6DS33 in real time, with acceleration on Y - axis and Time on X - axis. Further, I want to log

data as csv file and plot the real time graph using Matplotlib. I am struggling to achieve this can you please help.

Sincerely Yours

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Re: graphical plotting of lsm6ds33

by pandeyashwani on Wed Nov 18, 2020 3:11 am

This is preliminary python code to read LSM6DS33 data.

Sincerely
Attachments
2020-11-18-080758_1280x1024_scrot.png
2020-11-18-080758_1280x1024_scrot.png (163.32 KiB) Viewed 54 times

pandeyashwani
 
Posts: 15
Joined: Tue Sep 29, 2020 9:52 am

Please be positive and constructive with your questions and comments.