Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help to understand an accelerometer

Status
Not open for further replies.

kyru27

New Member
I'm using accelerometer ADXL203 (https://www.electro-tech-online.com/custompdfs/2012/10/ADXL103_203.pdf) and it's working in a way I don't understand.

I thought it was going to measure in fact how much acceleration it takes but it looks to work more as if it were some sort of inclination sensor (if the accelerometer is totally paralell to the desk shown on video (in 30092012.zip) it gives the equivalent to what would the zero g bas shown on datasheet.

But I want to measure acceleration and by checking the datasheet I get even more confused, it says it measures mV/g so I guess it should in fact be measuring acceleration on its own, which is something that clearly doesn't do, as if I keep the accelerometer quiet in a certain position it stays there.

It's not that big of a deal that it doesn't measure acceleration directly as long as I can know the difference between the initial position and the one it's later as time can be calculated on code rather easily, but... I'd need to know how the output variates according to the position, and I just don't see it on datasheet and I don't think it would make much good to try to measure it as it seems to change with very little movement.

Regards.
 
Last edited:
Are you forgetting that there is a static 1g acceleration vector pointing straight down? Hint, it's called Gravity.
 
Last edited:
To elaborate on MikeMl's post, the force of gravity and the force from acceleration are indistinguishable from each other (that fact led Einstein to conclude that gravity will bend light). Thus the accelerometer measures the force from gravity as well as any force from acceleration of the chip. To get the acceleration value you need to subtract the value caused by gravity to get the acceleration signal.
 
It's not that I hadn't taken gravity into consideration the problem is that I understand it should return to the gravity bias once it's not moving for a while, and the point is that it keeps on an higher value if I lift it and keep it still with it being inclined, I haven't received physics education for a long time, but if I'm not mistaken gravity should be in any point of the space g (9,8 m/s^2), but it looks like it would be telling me that g grows up the higher you are on earth and the more inclined you are, which I don't think makes a sense.

In fact this only occurs if I incline the accelerometer, if I lift it in a paralell way as it is originally, value keeps aproximately the same, I guess there's some vibration from my hand as I'm mantaining it quiet.

Guess I could first check if the actual value is the same as the one that was previously measured, as it would be too much of a coincidence that the actual acceleration (counting gravity + acceleration for vibration or the like) would be the same as the one shown when it was quiet, but... I'd prefer to know how exactly it works if possible.
 
Last edited:
If it has no incline the reading will be 1G. If it was at 45 degrees and you were somehow adding readings from two axes (like a software bug?) it would read almost 1.5G from the two axes added together.

If you are only reading the value from one axis, it will be 1G when flat, and as you inline it the value will reduce <1G.
 
If it has no incline the reading will be 1G. If it was at 45 degrees and you were somehow adding readings from two axes (like a software bug?) it would read almost 1.5G from the two axes added together.

Looks like it's in fact doing something like adding the readings, I've measured the other axe and it decreases in the same amount the other increases if I keep it still into an inclined position.

I'm actually into knowing total acceleration from the two axes, not the one from each one, so I can work with it, at least by now, but it's a weird way to work, seriously. And... I think it cannot be truly known what is the dinamic one produced from each axe, as you'd need to know how inclined the axe is so you could know how much of the reading is due to gravity, but maybe I'm missing something. Anyone has an idea about how could this be dealed?
 
Last edited:
Hello,


Are you saying that when you lift the device the reading goes up? That's strange already.

When you lift the device the reading should go down. That's because the acceleration going up should subtract from that going down (gravity). You should have to move it pretty quickly to see the change though unless it is very sensitive.
However, once the device stops and remains still again the reading should again return to the previous reading before it was moved. In fact, once the device is kept moving with a constant speed the reading should go back to the original reading...as long as the speed does not change at all.

The device should also have an orientation associated with it. If it measures in all three directions then it should have a forward/backward, left/right, and up/down orientation, so that there should be some markings that indicate how it should be oriented for taking measurements.
This means that if the device was oriented correctly to begin with and you tilt the device, it will read a different value because it will think it is being accelerated on an angle now rather than just 'down'.
So if this was installed in say a model airplane and the airplane was sitting on the ground it should read acceleration in only one direction (down) but if the airplane nose was tilted upward it would read acceleration in two directions. So the up/down reading would go down while the forward/backward reading would go up (or down).

How many outputs does this device have? We first have to establish how it tells the outside world what it is actually measuring.

[ADDED]

I just took a look at the data sheet. What format is that video though?

I see that the chip either has one direction or two direction sensitivity. I'll assume you have the two direction unit.

If the chip is laying flat it should not read anything or at least not much, with maybe a small error due to the non perfect axis symmetry. So lets just say it reads very low with the chip flat. Now if one side of the chip is raised up (so the chip is at an angle relative to the floor) it will sense gravity as an acceleration in the direction which that side senses. So the two direction unit chip has four sides and a top and bottom. But lets call the two sides in the Y direction left and right, and the X direction front and back, and the top and bottom of the chip we dont have to worry about for now. If the chip is laying on the desk and the desk is horizontal, then if we lift the front of the chip such that the back is still touching the desk, we will (ideally) see the reading of the X output go more negative (it might go positive depending on the chip). That's because the acceleration is a vector and the chip will no longer be aligned by 90 degrees from that vector.

So how to deal with this...

The gravity vector would look like: <0,0,-9> but since the chip is reading <x,y,0> the chip reads nothing when flat <0,0,0>. When tilted with the x axis upward at an angle of 45 degrees, the reading would change to: <-6.4,0,0> because the x axis would sense part of that -9z vector component.
Now if the chip is ALSO moving forward and changing it's speed so that it experiences a front/back acceleration, that is going to add to the previous measurement so the reading will go up. If it was moving with the right change in speed, we might see <0,0,0> even though it was accelerating quite a bit.
 
Last edited:
Hello,


Are you saying that when you lift the device the reading goes up? That's strange already.

When you lift the device the reading should go down. That's because the acceleration going up should subtract from that going down (gravity). You should have to move it pretty quickly to see the change though unless it is very sensitive.
However, once the device stops and remains still again the reading should again return to the previous reading before it was moved. In fact, once the device is kept moving with a constant speed the reading should go back to the original reading...as long as the speed does not change at all.

The device should also have an orientation associated with it. If it measures in all three directions then it should have a forward/backward, left/right, and up/down orientation, so that there should be some markings that indicate how it should be oriented for taking measurements.
This means that if the device was oriented correctly to begin with and you tilt the device, it will read a different value because it will think it is being accelerated on an angle now rather than just 'down'.
So if this was installed in say a model airplane and the airplane was sitting on the ground it should read acceleration in only one direction (down) but if the airplane nose was tilted upward it would read acceleration in two directions. So the up/down reading would go down while the forward/backward reading would go up (or down).

How many outputs does this device have? We first have to establish how it tells the outside world what it is actually measuring.

Yeah, when I lift it it goes up, anyway you gave me the idea it could be bad orientated so I tried to inline it in a downwards way and it went down, so it looks like that I was making it go down when I wanted to make it up as I was in the opposite orientation, so I guess this problem is solved.

Anyway it keeps on the last measure, although, as I've said, the difference is "taken" from the other axis, in the video I upload I'm showing that in a more clear way, when the voltage goes down I'm lifting it in a similar way as the first time.

To clarify, the accelerometer just measures in 2 directions, there's no need for more in my application.

It has 2 outpus, one for x axis and one for y axis, and according to datasheet I guess it should give a voltage proportional to the acceleration it has in each of its axes.
 
Last edited:
Hi,

I had asked what format the video was in. Can you post it in a more common format like mpg or avi ?
I cant read that format.

Also, if the units stays flat relative to the ground then you dont have any problems. It's only when it has to tilt that you need to measure the vertical axis as well and do a little trig to get the right acceleration in the x direction. I guess you've resolved this issue already.

But it would be nice to see the videos if you can post in a more common format or something.
 
Here's a new video in avi, I even showed a pair more of things on this one, I mean on this video is shown:

How it keeps the value even if it's still.

How it aproximately keeps the same value if lifted in a parallel way as it was originally.

How the other axe "loses" value when moved in a similar way.
 
Hi,


It's very hard to tell what you are doing in that video. I would need to see the device and the meter in the same picture, and it wouldnt hurt to use the audio track to state what you are doing at the time.

It looks like when you tilt the device the reading goes up, but then when you place it back flat the reading you got does not go down. So when you lift the device up and keep it parallel to the plane of the table, it doesnt do anything and it shouldnt. But i dont believe that it should 'keep' the original reading when laying flat again after a tilt sequence. If it is keeping the reading then maybe it has to be cleared some how or there is something else going on that you'll have to investigate.

Perhaps another video showing both the meter and the device (in the same frame) as it is being moved would help.
 
...
Are you saying that when you lift the device the reading goes up? That's strange already.

When you lift the device the reading should go down. That's because the acceleration going up should subtract from that going down (gravity). ...

Sorry to contradict MrAL but it is the opposite; 1g stationary, >1g when accelerating upward. At least that was true the last time I was in an elevator. ;)

But you're right of course about it would need to be lifted very fast. Lifting it at any speed less than a "fast jerk" would have very little effect on the 1g reading.
 
Hi,

Perhaps another video showing both the meter and the device (in the same frame) as it is being moved would help.

Here's the video, as my spoken english is very poor I'm better telling what I'm basically doing on this message, hope you don't mind.

On 0:00- 0:22 I'm lifting the accelerometer with inclination measuring on the axis it decreases when lifted this way, it can be seen how the voltage reading goes down.

On 0:23-0:45, I'm lifting it in the same way as previous, but measuring the other axis, it can be seen how the voltage measuring goes up, and I kept it quiet it still keeps the same.

On the rest of the video I lift in a more or less paralell way as it was at first, voltage increases, but it looks like it doesn't increase as much as if lifted with inclination.

Whatever the case if you finally are able to help to solve this thing or not, I'd like to thank you as you are giving me a lot of attention with this thing.
 
Hello again,

Ok i see what is happening now. The sensor reads 0 when flat, and when tilted it reads around 300mv. But when it is returned to the flat position, it retains the 300mv output when it should go back down to 0. So the only thing we can do is do a little troubleshooting and see if anything helps.

First, are you running it at 5v or some other voltage?
Second, i dont seen any output filter caps on the plug board. Do you have any caps on the two outputs? A trial value might be 0.1uf on both outputs.
Third, the output *may* require some resistive load, but it would have to be fairly high, like 100k on each output.
Fourth, there is a self test input. Tying that to V+ should produce some output.
Also, where did you buy this particular device and do you have another second unit to test?

You could try #2 above first as that might be all that is causing this problem. If nothing solves this problem you might have to contact the manufacturer.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top