Black Lives Matter - Action and Equality.
0

Combine accelerometer data output to one feed?
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Combine accelerometer data output to one feed?

by Pwelco on Mon Apr 27, 2020 6:43 pm

Hi,

I am using an mpu6050 (GY-521) accel/gyro/temp board to detect movement of a person with it strapped to them. I only want to detect that they moved, so I don't really care about which direction etc... Is there a way in Arduino code to combine X,Y,Z accel data so that I only need one feed? Meaning did they move or not. The issue I have is wanting to see real time data without having to delay 5 seconds since I am sending 6 feeds. I am getting the Throttling Error: Exceeded the limit of Adafruit.

I have searched the forums and not found a solution to my issue. I have an IO+ account so 60 data points per minute. If I had one feed I would think I could get down to once per second receiving that feed/data?

Pwelco
 
Posts: 5
Joined: Thu Nov 08, 2018 2:22 pm

Re: Combine accelerometer data output to one feed?

by adafruit_support_bill on Mon Apr 27, 2020 7:03 pm

To combine the X, Y and Z to get the total magnitude independent of direction:

Code: Select all | TOGGLE FULL SIZE
sqrt((x*x) + (y*y) + (z*z));

adafruit_support_bill
 
Posts: 77478
Joined: Sat Feb 07, 2009 10:11 am

Re: Combine accelerometer data output to one feed?

by Pwelco on Mon Apr 27, 2020 7:49 pm

Thank you!
I'm just a beginner so not sure how to use it. I will play around with it and see if I can figure it out.

Pwelco
 
Posts: 5
Joined: Thu Nov 08, 2018 2:22 pm

Please be positive and constructive with your questions and comments.