Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

LSM6DS33_data_visualisation
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LSM6DS33_data_visualisation

by pandeyashwani on Tue Sep 29, 2020 9:59 am

Hi

I am using lsm6ds33 breakout board for my project. I am using lsm6ds33 and raspberry pi for I2C Interface. Currently i have acquired raw data of acceleration and gyroscope.
I am try to visualise these raw data graphically. Since i am new to python can you please help me with suitable python code.

Sincerely
Ashwani

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

Re: LSM6DS33_data_visualisation

by mikeysklar on Wed Sep 30, 2020 6:44 pm

Hello Ashwani,

Since you are acquiring data already it might be possible to use the Web Serial API in your Chrome browser, but it would expect a serial port to read from.

https://learn.adafruit.com/how-to-fuse- ... visualizer

Another option to consider would be how the BN055 sensor uses WebGL to visual data from a Pi.

https://learn.adafruit.com/adafruit-bno ... gl-example

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

Re: LSM6DS33_data_visualisation

by pandeyashwani on Thu Oct 01, 2020 3:17 am

Dear Mikeysklar

I am extremely thankfull for your response. Actually i am trying to visualise the 3D Acceleartion and 3D Gyroscope data graphically in real time. I want to use matplotlib
for that. Can you please tell me how i should do that. Below you can see my python code and raw data of 3D Acceleration and 3D Gyroscope in real time.

Sincerely Yours
Ashwani pandey
Attachments
2020-10-01-085954_1280x1024_scrot.png
2020-10-01-085954_1280x1024_scrot.png (219.69 KiB) Viewed 182 times

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

Re: LSM6DS33_data_visualisation

by mikeysklar on Thu Oct 01, 2020 10:25 am

I see the Jupyter notebook guide for this accelerometer is using matplotlib.

Is this close to what you are describing?

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

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

Re: LSM6DS33_data_visualisation

by siddacious on Thu Oct 01, 2020 12:54 pm

I'm unsure if it's what you're looking for, but the plotter in the Mu editor works well for visualizing data. I use it nearly daily!

You'll just need to configure your program to print out the tuple returned by the acceleration and gyro directly like so:

print(sensor.acceleration)
or
print(sensor.gyro)

once you see the raw tuples printed on the serial console, you can close it and open the mu plotter to see the charts :)

siddacious
 
Posts: 338
Joined: Fri Apr 21, 2017 3:09 pm

Re: LSM6DS33_data_visualisation

by mikeysklar on Fri Oct 02, 2020 11:41 am

Thanks siddacious.

Ashwani had asked about using matplotlib so I was stearing him that way, but good tip on a third option to use the built-in Mu plotter. I've not used it myself.

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

Re: LSM6DS33_data_visualisation

by pandeyashwani on Mon Oct 05, 2020 4:09 am

Dear mikeysklar and siddacious

I am extremely thankful for your support and help. It work for me. However, i am just getting real time 3D Acceleration, but i am not getting 3D Gyroscope in real time. I want to acquire and visualise acceleration and gyroscope value simulataneously in real time.

Please have a look.

Sincerely
Ashwani pandey
Attachments
2020-10-05-084756_1280x1024_scrot.png
2020-10-05-084756_1280x1024_scrot.png (256.01 KiB) Viewed 142 times

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

Re: LSM6DS33_data_visualisation

by pandeyashwani on Mon Oct 05, 2020 10:06 am

Can you please provide me a python code by which i can convert the time domain acceleration into frequency domain. As i have to analyse the frquency and its amplitude.

Sincerely Yours
Ashwani pandey

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

Re: LSM6DS33_data_visualisation

by pandeyashwani on Tue Oct 06, 2020 5:14 am

Can you please tell me how i can visualise frequency after this.

Sincerely Yours
Ashwani pandey

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

Re: LSM6DS33_data_visualisation

by mikeysklar on Tue Oct 06, 2020 5:26 pm

pandeyashwani -

Please try using a single print statement.

Code: Select all | TOGGLE FULL SIZE
print(sensor.accelleration, sensor.gyro)


That should give you both acceleration and gyro data. You can learn a bit more by reading this Plotting Data with Mu guide:

https://codewith.mu/en/tutorials/1.0/plotter

If you want to get into data rate the accelerometer and gyro are using:

Code: Select all | TOGGLE FULL SIZE
print(sensor.accelerometer_data_rate, sensor.gyro_data_rate)


More here about which values you can see from the sensor library:

https://circuitpython.readthedocs.io/pr ... t/api.html

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

Re: LSM6DS33_data_visualisation

by pandeyashwani on Thu Oct 08, 2020 6:05 am

Hello Mikesklar

Thanks for your quick response. I am trying to analyse the frequency response of lsm6ds33 sensor, since i am learning python i actually dont know how to implement this in code
in order to read and analyse the frequency response. Please help.

Sincerely Yours
Ashwani

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

Re: LSM6DS33_data_visualisation

by pandeyashwani on Thu Oct 15, 2020 8:30 am

Hi Siddacious

Can you please suggets me how i can make this graph sinusoidal. I am getting a randam graph, so i am not able to interpret the graph of the data.

Sincerely Yours
Ashwani
Attachments
2020-10-06-113442_1280x1024_scrot.png
2020-10-06-113442_1280x1024_scrot.png (179.2 KiB) Viewed 40 times

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

Please be positive and constructive with your questions and comments.