I’ve been working with both MPU6050 and 9250 for something like 2 weeks. The main purpose of my project is to detect if someone hit the car and then get the angle of the hit. I’m actually reading raw data from MPU with only the accelerometer enabled, in this way, I’m getting low noise on the results. However, I’m still getting unexploitable results, what I’m trying to say is there’s too much factors that make the mpu detect something. For example, if I Hit from the X side, I’m getting results too on the Y axis. So I would like to know if theses two MPU are suitable or not for my appliance as I’m getting out of time at this point and I don’t really want to go deep in this if it can’t work.
An accelerometer measures the instantaneous rate of change of velocity, along some axis. It is extremely unlikely that you can apply a change of velocity to the accelerometer in such a way that it affects only one axis.
Knock at the sensor from different angles, and try to find a relationship between angle and accelerations. Two accelerations (X and Y) are required for the determination of an angle, so you have to deal with two values anyhow. Eventually the sensor chip is not aligned properly, causing a shift of the axes?
PaulS:
An accelerometer measures the instantaneous rate of change of velocity, along some axis. It is extremely unlikely that you can apply a change of velocity to the accelerometer in such a way that it affects only one axis.
Considering the answer of DrDiettrich , you still think that can"t be possible ? Even if it not possible with it what woud you sugget, I thought about piezo sensor in 4 sides in the car and then get the highest value to determinate what angle it come from.
DrDiettrich:
Knock at the sensor from different angles, and try to find a relationship between angle and accelerations. Two accelerations (X and Y) are required for the determination of an angle, so you have to deal with two values anyhow. Eventually the sensor chip is not aligned properly, causing a shift of the axes?
Well , I already tried the chip without any hit on the car and I got nothing so I think it's quite good calibrated. By the way, to clarify, I don't need an precise angle. I just need 90 180 270 or 360 /0 . Have you already worked with this kind of chip ?
Anyway, already thanks to you two, I'm getting further in this !
DrDiettrich:
You are talking about a chip that already is mounted to the car?
What piezo sensors?
Confused
Nope it's an external chip . I need it to control the angle of a motor depeding on a hit on the car detected normally by the accelero. As far I know, Piezo return voltage depeding on the force of the impact.
If the chip gives you the acceleration data for each of the X. Y and Z axes can't you use simple maths to work out the angle of the impact relative to the chip?
A piezo reacts when hit directly or when bent, not when accelerated. A piezo buzzer also can act as a microphone, not very direction sensitive.
If you don't mount an acceleration sensor in the right place, it can give any sort of weird signals. E.g. 3 sensors in different places must fire before an airbag is inflated.
I'm coming back to you after some test and code taking into consideration your advices. I've succeded in configuring the accel in "Wake Motion Interrupt " Mode , I've setted up a treshold to pass to trigger the INT Pin and then I'm reading the value of X and Y axis. After that, I'm working with theses two values to get an angle with the following formula : atan2(Yaxis/Xavis)*(180/pi) and then I got the result in degres.
The problem is now that the results I receive doesn't really match with the reality or maybe 3 times ouf ot 10. I have to precise that for my tests, the board and the mpu are mounted on the car ceiling with some tape.
I'm still mistaking of the way of it's mounted on the car may cause theses problems ?
The ceiling may not be the right mounting place, and tape not the right material. As an extreme example, imagine a rod antenna with the sensor mounted to its top. The rod can swing in any direction, not necessarily related to the shock direction, and it can produce its own resonance vibrations. Even if the car ceiling is more massive, it behaves a bit like the rod.
Try screws for fixing the sensor, and a place on the floor.
DrDiettrich:
The ceiling may not be the right mounting place, and tape not the right material. As an extreme example, imagine a rod antenna with the sensor mounted to its top. The rod can swing in any direction, not necessarily related to the shock direction, and it can produce its own resonance vibrations. Even if the car ceiling is more massive, it behaves a bit like the rod.
Try screws for fixing the sensor, and a place on the floor.
Thanks for the advice, I'm gonna work on it and come back later to give my results if they're good ! However, got just one question, If I mount it on the floor with screws as you gave me the example, If I Hit from one side of the car, let's say the left one but near the top too. Do you think the force will be trasnmitted correctly to the accelero on the floor of the car ?
The reaction depends on where you hit the car, and in which direction. The car can yaw, pan and tilt around 3 axes, and it can move (a bit) in direction of these axes. Or only the deformable zones are crushed, or the bumper bar is bent, without any effect on the sensor in the car.