Go Down

Topic: Tilt sensor question (Read 1 time) previous topic - next topic


Mar 22, 2013, 06:28 pm Last Edit: Mar 25, 2013, 01:56 am by jd.steinberger Reason: 1
I am considering buying one of these little smokies...


I need a tilt sensor that can measure within 1/10 of a degree of accuracy.  Everything looks good, however I noticed that the information from the chip is sent via SPI in 11-bit.  It's my understanding that the ADC on my Arduino Pro Mini 328 is only capable of 10-bit.  It appears to me, if you look at the chart on pg. 13, that the 10-bit capability of the Arduino will limit me to only half the resolution of the sensor, as 1024 is at 0 degrees.  Therefore, I can only read positive x, but not negative x; positive y, not negative y.

I hope I'm just not understanding something correctly.  I've had a tough time finding a low-g accelerometer that will mate nicely w/ my 5v Arduino.  Thanks in advance.


The A/D resolution is irrelevant, the data gets transferred through SPI, which is purely digital.


Thanks Mike.  I have no experience with SPI, but a wiring diagram is provided at the bottom of the datasheet.  Would you recommend using the 5v output of the Arduino to power the device, or would it be too noisy?  Or, is that only an issue in an analog setup?  I reckon I can figure out the rest of the connections to Arduino from the playground.


The analogue output from this chip is only an option, there is no need to use it. You can read the output from the SPI interface using the RDAX and RDAY commands as shown on page 11 of the data sheet.

Would you recommend using the 5v output of the Arduino to power the device, or would it be too noisy?

That would be fine. Add a decoupling capacitor between 5V and ground as close to the device as you can get.


I appreciate the help.

This part is one piece of the puzzle.  I am having to build my own IMU which will include a magnetometer and gyroscope.  If I'm understanding pg.10 of the datasheet correctly, each of these devices can share the data in, data out, and serial clock lines, right?  The chips would be SS0, SS1, and SS2.  Is this how SPI is intended to function?



Is this how SPI is intended to function?

No, chaining data like this is just something you can do with some chips but doing it with mixed chips you will have to study the data sheet closely to see if it is on.
Normally using SPI each chip has its own select line. The input, output and clock signals are common to all chips and you hold the chip select line low on the chip you want to talk to.


OK, so I would still only need 6 I/O pins from Arduino to talk with 3 sensor via SPI?  I would just have to check the data sheets to get the addresses of the devices programmed correctly.  Very good.

I'm also trying to decide if I need a gyro at all.  I've read and read about gyro's and can't seem to understand why you would need one with an accelerometer...for my application where I am measuring the angle of inclination in a static situation.

If I just want to know angle of inclination and which direction that angle is, can't I get it done w/ a low-g accelerometer and magnemometer?



can't I get it done w/ a low-g accelerometer

That sensor is an accelerometer isn't it?


That sensor is an accelerometer isn't it?

Yes sir, and that's my point.  If I used the accelerometer we've been discussing teamed up with say a HMC5883L, I should be able to read inclination up to 15 or 30 degrees and know which direction the tilt is.

I could also use the accelerometer to tilt compensate the HMC5883L.



That's a pretty cool device, impressive resolution and accuracy at small tilt angles.  It should more than exceed your stated requirements at least at small angles.  I have an ARM development board here that has an inexpensive accelerometer on it.  It can resolve the difference made by slipping a piece of paper under one corner of the board.

If you know the orientation of your device, you'll know the tilt direction from the sensor readings.
Experience, it's what you get when you were expecting something else.



It can resolve the difference made by slipping a piece of paper under one corner of the board.

As small as this device is, it better be capable of that if I'm hoping for 1/10th degree resolution. :D

It probably doesn't belong in this section of the forum, but I'm currently reading to try and figure out if my Arduino Pro Mini 328 has enough on-board memory to log a few shots from the magnetometer and tilt sensor.  I'm trying to fit all of this hardware into a tiny space.  It's not impossible, just more design consideration and machine work on my part.  I was planning on mounting all of this in a Delrin housing I will machine on my lathe and mill, and then cartridge that into 316 stainless steel housing that will be water-tight (That's right, going underwater, Jack ;)).

I'd like my apparatus to be able to go into an obscure area (under-water), take about 3 samples from each sensor, and store it to the "satellite" arduino.  I'll retrieve the data from the "satellite" arduino via a "mother" arduino or computer when I get it back to the surface.

Reading about storage is like a different language to me, but I'm learning (slowly).  Can this amount be stored on the Arduino Pro Mini 328, or do I need to implement a micro-SD portion as well.  Thanks for the help.  I'm sure it would save me hours.

I'm real excited to get this project into building mode, and I sure appreciate the help I've received thus far.  Good day.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131