Hello Blynkers!
How can i use The Accelerometer widget and what is Number From 0 to 10 can can i calculate rotation and degrees?
You canāt.
An accelerometer senses motion (of your phone) along the three axis, not position. The range of 0-10 is the rate of acceleration.
actually, with proper coding it could be possible to measure rpm, if the rotation is perpendicular to the ground.
there are some ant+ bike computers which use the same principle. it has a wireless accelerometer / gravity sensor mounted to the hub, and every time the hub makes a full circle the value (direction) of gravity becomes 0, so one can calculate rpm. i canāt explain so well but hope this makes senseā¦
if the sensor can sense the magnetic azimuth, it can also be used in orizontal rpm measurement.
But the Accelerometer widget reads the phone sensor, and I donāt think mounting a phone to a spinning object is quite the way to go
And besides the math involved is not a Blynk Forum topic⦠is there math forums? I hope I never run into one
@Gunner
Continuing the discussion from Outputting Accelerometer Data to blynk app:
take alook on this topic and the sketch.
Serial.print("X-Axis of Rotation : ");
Serial.println(xGyro);
Blynk.virtualWrite(V4, xGyro);
Serial.print("Y-Axis of Rotation : ");
Serial.println(yGyro);
Blynk.virtualWrite(V5, yGyro);
Serial.print("Z-Axis of Rotation : ");
Serial.println(zGyro);
Blynk.virtualWrite(V6, zGyro);
What about it?.. That Topic was all about getting the data into the sketch, easily done⦠What you are asking for is something totally different.
Continuing the answer⦠While the Phoneās accelerometer does seem to detect the rough axis of rotation⦠it is really detecting the acceleration along the axis. The gyroscope is what detects the rotation, but even then the key work here is ādetectā, not easily measure or calculate accurate degrees of rotation in any form Blynk can currently read.
Get yourself a proper sensor and library, and use it. Or make something with a HALL effect or rotary encoder.
You forgot to toss in the āsirā somewhere between those titles
oh, i felt like iāve missed somethingā¦
I knew my ears were ringing as I sleptā¦
interesting article!
@sh.abar.mard we already know that the Accelerometer Widget will pull the float data from the phone⦠and how to read it
BLYNK_WRITE(V1) {
//acceleration force applied to axis x
int x = param[0].asFloat();
//acceleration force applied to axis y
int y = param[1].asFloat();
//acceleration force applied to axis y
int z = param[2].asFloat();
}
Conceptually, an acceleration sensor determines the acceleration that is applied to a device by measuring the forces that are applied to the sensor. Measured in m/s^2 applied to x, y, z axis.
The rest of the math to calculate how many times around, or how far around in degrees, your phone has spun, assuming that can be determined with this info alone, is beyond this forum.
So with that in mind, do you have further need in understanding how to grab the X/Y/Z data from this widget?