-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accelerometer Love #402
Comments
There is no way to get this value from the board via firmata protocol, which is why I made it a constructor option to be provided by user code. 5V seemed like a reasonable default (biased in that I was using a 5V breakout).
This is a handwavey cheat for https://code.google.com/p/mma7361-library/source/browse/AcceleroMMA7361/AcceleroMMA7361.cpp#95. When I was working on this in April/May I ordered several analog accelerometer breakout boards to refine a zero adc voltage offset algorithm. By the time they arrived I was tied up with other things—now I have them and no excuse not to work on this.
I'm trying to establish a convention where sensor devices always provide a raw ADC reading value via handler args and computed values via the instance's properties. This needs to be documented :\
Ported from: https://code.google.com/p/mma7361-library/source/browse/AcceleroMMA7361/AcceleroMMA7361.cpp#321 |
The ability to set the analog reference voltage via Firmata may be added at some point: firmata/arduino#39 |
@soundanalogous excellent :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I bought me a MMA 7361 Triple-Axis Accelerometer Breakout Board from Sparkfun and have soldered it up and wired it up. Goals being:
First, let me say that wiring things up and running the Accelerometer example generally worked fine (beside the very minor niggle that the fritzing diagram shows different pins than the example uses). I'm getting readings from all three axes.
After looking at the example, the source code, various online docs about accelerometers, and futzing around for a good while, I am left with the following questions. Low priority on all of this, of course. It's quite possible that most of these questions are more specific to how accelerometers work than how
johnny-five
works, so, bear with my naivete here...I should also mention that I'm not using any capacitors in my current setup—I don't have any near enough to the recommended values right now. FWIW, the reads seem to be stable in a relative sense.zeroV
opt: Comment in example is// volts in ADC
. Is this the expected voltage out at zero G? If so, on which axis? The datasheet for my accelerometer suggests that this voltage will be different for the x and y axes versus the z axis. By setting thezeroV
value to560
, I'm able to get very close to 0g readings on my x and y axes, but my z is an outlier. As a related aside, I'm not sure how/if AREF is supported injohnny-five
/firmata. I'm using the AREF pin on my Arduino to give it 3.3V, but the raw readings off the sensor pins are still scaled to 5V. Absolute vOut for x axis at rest is 1.62V according to my multimeter. I did see thearef
opt (not in the example, but in the source), and I did set it to3.3
. Computed values are affected by this, but not raw.sensitivity
opt? My datasheet describes sensitivity as a function of mV/g (e.g. its default sensitivity is +-1.5g, at 800mV/g), whereas the comment in the example saysmV/degree/seconds
, which is a unit I don't get. Am I looking at the "wrong kind" of sensitivity?fma
function? I mean, I don't think I need to understand the math at a granular level, but I presume it's calculating force/mass/acceleration stuff. I'm curious about the value134217729
. The baseline at-rest values for me tend to be around2
, so again I wonder if my inability to get things properly calibrated is problematic here.orientation
returns an int between-3
and3
. But what do these values mean :)?The text was updated successfully, but these errors were encountered: