![]() |
Forum Index : Microcontroller and PC projects : Nice easy 3-axis accelerometer module....
Author | Message | ||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
I found these modules on Aliexpress today. While they are not as cheap as some accelerometer modules($3.45 each), what I really like about these ones is that all the processing is done on the module for you. You read the X, Y and Z axis directly as a linear voltage on three different pins. 880mV per g @ 1.5g sensitivity. (6g sensitivity can be selected) 400uA current consumption, and 3uA in sleep mode. Connect to three MM analog pins and you're done, essentially. If you only need one axis, you only need one analog input pin. No complicated I2C commands and corresponding complicated data calculations to get the results. All I want is tilt sensing, so I think these will do very nicely. I have ordered a couple to play with. Here is the datasheet: 2018-02-07_140154_MMA7361L_3-axis_with_XYZ_output.pdf Smoke makes things work. When the smoke gets out, it stops! |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Is this a digital alternative solution to the ball tilt/mercury switch you were looking at? I think it is a more reliable solution if it works out. My only thought is you may need to read more than 1 axis reading and a calculation to get a tilt reading on one axis (depending on the orientation of the IC). I'll have a read of the data sheet, but definitely worth a play. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Yes it is. ![]() I didn't have much luck with that, did I.... ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
I had a quick read, you need to be aware these measure acceleration (not static position) on each axis. The components XYZ outputs are relative to the IC so will depend on final chip orientation. You will need to take readings at some interval and compare it to the previous reading and I suspect do some calculation to determine if it has been 'tilted'. It is unlike a physical plumb bob tilt which can be moved with minimal accelartion in the X and Y planes and in the Z plane plane without tripping. Also unlike a mercury tilt switch which can ignore movement in 2 dimensions wihtout tripping. Just reading a single axis does not necessarily mean it has been 'tilted'. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Look at page 6 of the PDF. That shows that they do measure static acceleration - they even call it that. ![]() EDIT: Oh, I see what you mean. Not a problem anyway, as I plan to connect all three axis on the next design, so I can read all three to determine if there is a tilt. That's the plan anyway. I will run some tests once I get my hands on them. Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
The maths will be the same as the maths used on the I2C devices. This is a quick rehash of the code I posted in October 2015 I just removed the I2C stuff and the Gyro references. VK7JH MMedit |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Yes, as i said: So depending on what you call 'level' you need an initial value to determine that based on the current chip orientation 'static acceleration' and then depending on what you define as a 'tilt' the difference value from level. Generically an object can be moving and be considered level and also usually allows a certain amount of hysteresis, these values change the 'static acceleration' but do not necessarily mean it is tilted. I do not know we learnt what your specific application was to define what 'level' and 'tilt' means in reference to an accelerometer. Just trying to make sure you don't fall into a situation of reading false positives. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
[Quote]I do not know we learnt what your specific application was to define what 'level' and 'tilt' means in reference to an accelerometer.[/Quote] Huh? ![]() EDIT: @ Jim - Can you please link to that old thread of yours? Smoke makes things work. When the smoke gets out, it stops! |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
https://www.thebackshed.com/forum/forum_posts.asp?TID=8047&KW=MPU%2D6050 Read the full thread to see the errors in the code. Jim VK7JH MMedit |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Shame that lcsoft.net domain is dead. Looked on it a year or so back when I saw it on some DS18B20 modules. The site had a huge range of different devices. Phil. |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
I recall you were putting the tilt sensor onto a PCB but not sure what the intended application and use scenario was. So questions like: When sensing tilt is it initially moving (dynamic) or it is always initially still (static). Is it in a known fixed XYZ orientation. Is it normally parallel to those planes. What planes can it or do you want tilt to be senses in. When it is being setup can the XYZ resting position be zeroed to match the final position? These sort of things will effect what the 'untilted' force vectors will be like so that from them the force vectors that represent your 'tilt' can be worked out. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
@ Jim: Thanks. @ Azure: Ahhhh. Gotcha. More complicated then I thought. ![]() I thought this would be a great replacement for the ball-switch/mercury switch thing I was having so much trouble with late last year. I hope I have not overplayed my hand! ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
There are many ways to detect tilt. I used to use a weight and a microswitch, later on i used a disc with a weight on one side and a optical sensor. Nowadays these kinds are available ready made. Like a microswitch tilt sensor: http://golden-switch.manufacturer.globalsources.com/si/6008848479179/pdtl/Tilt-switch/1157835967/Tilting-micro-switch.ht m Or an optical one: http://www.goldmine-elec-products.com/prodinfo.asp?number=G16882 They both work with a steel ball as the weight, but it is not used to close a circuit by itself. It either activates a switch or blocks out light. They are used in alarm systems (that where i know them from) for instance in ATM machines and vending machines. Very reliable. Microblocks. Build with logic. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Yes, the ball-type photo-interrupter type thing is ideal. Both of those types are sold out though. I will do a search for 'Optical tilt switch' to see if that gives any more hits. MUCH prefer a simple approach over an XYZ idea - I was just trying to get away from mercury and ball-switches. If you know of any more photo-interrupter type tilt switches, this is exactly what I need. ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
I found this website that talks about using an Osram SFH7710 tilt sensor. These things look perfect, but seem to be obsolete from what little searching I have done so far proves. EDIT: This has possibilities. EDIT: So does this. This one has gold-plated contacts, and gives me the two tilt angles I need in one package. This is the current frontrunner. Smoke makes things work. When the smoke gets out, it stops! |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
@Grogster I think if you do some practical tests like you mention you will get a good result with the XYZ accelerometer. It is one of those things that the maths behind them is more complicated than they are to use in practice (if you test the outputs in the situations that appiy to your use scenario). Those other chips look good but I think with the testing you'll get the XYZ to do what you want. |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9610 |
Cool, thanks. ![]() I have my bases covered now with XYZ and various 'Authentic' tilt sensors. I will keep the forums updated. Smoke makes things work. When the smoke gets out, it stops! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |