How to Design a Precise Inclinometer on a Custom PCB

January 08, 2019 by Mark Hughes

Learn the design steps for creating your own custom inclinometer PCB.

This project describes how to design a custom inclinometer subsystem capable of measuring angles accurately down to three-thousandths of a degree.

This is one of the projects and subsystems we design on AAC to attempt to expose you to new thoughts, ideas, and techniques.

This project creates an inclinometer subsystem that might be used in precision instruments. With this design, I can record an angle down to one-hundredth of a degree and know it’s accurate. I can look at it down to one-thousandth of a degree and know with 99.999999% confidence that it is within three-thousandths of a degree of the actual inclination value.


The final build of the project


This project creates a 1-axis digital and mechanical inclinometer for use in scientific instruments or machinery. The circuit board utilizes ICs from a variety of manufacturers and demonstrates several different techniques that you might incorporate into your designs.


A very simple block diagram of the project


This article is the first in a series that shows some of the mechanical and electrical considerations needed to create a precision inclinometer circuit using the muRata SCA103T-D04, a ±15° MEMS-based inclinometer IC. Future articles will cover the schematic design, PCB layout considerations, and analysis of the device's operation in more detail.

1. Choosing Components

Here's a simplified BOM of the major components you'll need to copy my design:

  • SCA103T-D04 ±15° inclinometer
  • MSP430 microcontroller
  • AD8244 unity-gain amplifier
  • LT1027LS8 precision voltage reference
  • CP2102N UART-to-USB converter


How Does the Design Work?

The design is centered around the SCA103T-D04 ±15° inclinometer IC. In the interest of disclosure, let me mention that muRata sent me this inclinometer for free for the purposes of this article. Regrettably, I learned (too late) that this particular component is set to be discontinued. The muRata website currently states that the SCA103T-D04's "Last Time Buy Date" is 6/15/2019. 

Sensor output from the inclinometer is sent through an Analog Devices AD8244 unity-gain amplifier to an LTC2380IDE successive approximation register (SAR) analog-to-digital converter (ADC) from Linear Technology (now part of Analog Devices). I chose a 24-bit SAR ADC instead of a 16-bit device, knowing full well that it is physically and practically impossible to resolve down to 0.00000001°. I made my target 17-18 bits, or 0.0001°. This is a somewhat expensive choice, so if anyone wants to re-create this design later with a 16-bit ADC, you will be glad to know that I chose one with an available pin-compatible 16-bit version.  

However, I am only ever going to make one of these boards, so I would prefer to have more bits of resolution than I suspect I will be able to use than to have too few. Additionally, the ADC I chose has an integrated digital averaging filter, so it should be possible to statistically tease more than 16 bits of resolution from the inclinometer through repeated measurement.

The ADC value is read by the TI MSP430 microcontroller. TI’s MSP430 microcontrollers have been my MCUs of choice for the last several projects. I could have chosen the MSP430FR2433 to have access to additional GPIO lines, but no other pins were required for this project. The MSP430FR2633 has capacitive touch pin capability that would allow an external calibration button to be implemented on a future control board.

That value is then passed to the Silicon Labs CP2102N UART-to-USB converter.

About the Inclinometer

The muRata SCA103T-D04 ±15° analog high-performance differential 1-axis inclinometer has an analog resolution of 0.001° (16-bit), with 0.0004°/√Hz output noise density and an offset temperature dependency of ±0.002°/°C.  


The SCA103T-D04. Image from muRata


An integrated 11-bit ADC provides direct digital conversion for output through the SPI pins. Each internal sensing element provides single-ended output in the range of 0.5-4.5VDC, with 0-0.5VDC and 4.5-5.0VDC reserved to indicate an error condition.


A functional block diagram of the SCA103T-D04, from the datasheet


Inside the IC are two identical accelerometers arranged along the same axis and pointing in opposite directions. The outputs are meant to feed a differential amplifier or differential-input ADC. This differential measurement technique helps to reduce noise and removes common-mode measurement errors.

muRata’s datasheet states that the device is capable of discerning angular displacement with a resolution of 0.001°, which corresponds to ~14 bits. The low temperature dependency (correctable) and low noise density (not correctable), along with muRata’s policy of publishing their worst specifications over the entire operating range of the device, led me to believe that performance might be better than specified in certain circumstances.  

Being “Hard-Way-Hughes,” I wanted to push the upper limits if possible.

2. Schematic Design

The first step in a successful project is creating a functional schematic design. This involves studying the pinouts of the ICs involved and making the appropriate connections.

I approached my board on a component-by-component basis.

  • Power: Issues include current sourcing, the use of LDOs, and capacitors.
  • Inclinometer: Because of the way that the SCA103T-D04's self-test functionality is set up, I added another IC to the BOM to prevent both pins from being active at the same time. 
  • Signal Buffer and Analog-to-Digital Converter: I needed to consider how to route signals through various filters and amplifiers to ensure signal integrity.
  • Microcontroller: Assigning pins with the MSP430 will occur in the firmware-writing stage.

You can read a more detailed explanation of this part of the design process in this article on how to design a functional schematic.

3. Laying Out the PCB

There are multiple factors to take into consideration when turning a schematic into a board layout. In this case, I particularly needed to ensure that the voltage reference IC was isolated both mechanically and thermally. I also decided to implement a guard ring in order to minimize leakage current.


The top layer of the board


Determining the placement of components, the length and path of traces, and designing for noise exclusion are all important for this design.

I created a 4-layer board with the two exterior layers for components and signals, one layer for ground, and one layer for mixed power.


The board layers in sequence


Components that were likely to generate significant heat (LDOs, MCU) were placed on the bottom of the board where the tops of the components could mechanically connect to protrusions on the aluminum PCB carrier. The idea is to dissipate excessive heat from the ICs through the metal before it has a chance to spread to other parts of the PCB.

I go over the specific considerations that went into designing this PCB in a separate article. If you'd like to hear more about this process, including how my board cut-outs serve to isolate the interior of the board from thermal and stress damage, please read about how I turned my schematic into a PCB layout.

4. Writing Firmware

One of the first steps in programming a custom board is thinking about which pins are connected to which devices.

In the interest of providing myself with as much information as possible, I added an ASCII connection diagram into the code. This step isn't necessary but I find it helpful to have the diagram as a reference in the source code.


A representation of my pinout I included in my code for reference


Turning our attention to the MSP430, you cannot do anything with your microcontroller until you configure it. For that, you have to identify pins, clock sources, power modes, etc. This is where working with a high-quality evaluation kit can be worth every minute and every dollar you put into it. In my case, I had enough prior experience with the MSP430 to get the program close to correct, and some assistance by a forum contributor allowed me to quickly complete the task.

Beyond pin assignments, etc., I also needed to consider how to manage data, given how much this subsystem is capable of gathering. To accomplish this, I chose to view the data in my serial monitor as binary values for a quick assessment of whether my device has encountered noise. 

If you'd like to learn more about this subject, including information such as what registers are and how to use them, check out my article on firmware design for the MSP430.

5. Mechanical Considerations: Designing Housing 

A resolution of 0.001° translates to changing the elevation of one edge of the PCB by approximately 1 µm (the distance between contact points is ~9.5 cm). This is an exceedingly small displacement and essentially guarantees that digital calibration must be performed after each adjustment of the board inside the board holder.

Rather than adjust the board inside the board holder, I elected to rigidly fix the board to the board holder and adjust the holder.


Shown above is an exploded render of the PCB holder, alignment pins, PCB, and PCB clamps


If I chose to use simple digital calibration as the datasheet suggests, I might lose the nickname “Hard-way Hughes” around the office. With my “street-cred” at stake, I chose to incorporate a mechanical adjustment into the board holder by means of a differential-drive screw mechanism mounted at one end of the board, with two additional M3 polished acorn nuts at the opposite end of the board holder.

You can see my full breakdown of the mechanical considerations of designing my housing in a future article.

6. Off to Manufacture

Bear in mind that AAC boards are for educational purposes, so we usually only make a single spin of each board. Your experiences with manufacturing requirements and placing an order for your prototype will vary.

You can download my design files below:

7. Characterizing the Device

Now that we have our inclinometer back from fabrication, we can begin characterizing our device. 


Our shiny new board (shown in its board holder)



The part of the circuit that I’m most concerned about is the voltage reference, so that’s the measurement I focused on first. This is the part of the circuit that I would redesign if I remade the PCB. I hooked my board up to my oscilloscope and began testing.

In the course of my testing, I found a "hiccup"—a repeating anomaly.


An oscilloscope capture showing the sneaky "hiccup" in question


If this board were intended for mass manufacture, this is a problem I would certainly need to solve, especially since it's impossible for me to tell at this point whether the noise is benign or an indication of something more serious. However, this particular noise event did not appear to negatively affect the performance of the device.

This is an excellent example of a situation where the next iteration of a design would include more test points, including a coaxial test connection, for more complete test and measurement.

For more information on how I created my testing environment and how noise density affects component selection, check out my future article on the subject.

8. Data Analysis

When all is said and done, I'll need a way to view and analyze the data that my inclinometer is gathering. I mentioned a bit of this in the firmware section, but the next step is to process the data. I chose to use Mathematica to create this setup:



I then conducted trials to determine if I could interpret and represent data sets.

If you're into statistics and data modeling, you can read more about my adventures in data analysis in my upcoming article in which I describe the trials.

Closing Thoughts: More Precision Than I'll Ever Realistically Need

I set out to create an incredibly precise inclinometer. I didn’t reach my absurd goal, but I did create a subsystem with a precision higher than I’ll ever need to use in my lifetime. Realistically, if a company needs a resolution that is greater than the resolution of this board design, they are going to hire someone who specializes in metrology to design it.  

And, while I would redesign my voltage reference section, the device performed adequately. I’ll call this project a win.

That’s not to say that there isn’t more work to be done. The device’s temperature compensation equation needs to be added, and the device should be calibrated and specified over its entire operating range. But those activities are time-consuming and don’t add much to this article, so I’ll put them off for now.

If you have suggestions for future projects, please leave a comment below. Thanks!

  • C
    ColdPixel January 11, 2019

    I love the idea of a series of articles designing, prototyping, and testing a project. I am really looking forward to the next articles in the series.

    Like. Reply
    • Mark Hughes January 11, 2019
      @coldPixel, You don't have to wait long. We're posting them at the rate of about an article a day :)
      Like. Reply
  • D
    Davidelvig January 11, 2019

    I wonder if this solves a problem for me.  I don’t need this precision, but I need an “angle detector” for a hand-held device (a musical MIDI wind controller).  I can use 3-axis accelerometers to determine the angle at which the instrument is held still, but the angle numbers are dwarfed by any accelerations (e.g. minor shaking of the instrument).  I want to know the angles without the acceleration.  e.g.  I am holding the instrument 10 degrees down off of horizontal, and am shaking it a bit for vibrato, but not changing the angle from 10 degrees.

    Does your inclinometer approach solution change the game in my favor?

    Like. Reply
    • Mark Hughes January 11, 2019
      @Davidelvig, You might post your project details in our forums. I believe you might simply need to filter your data. Try a 3 or 5-tap finite impulse response filter on the acceleration for your "pitch", and use a gyroscope for "Vibrato". BTW -- you likely only need a 1-axis acc, and 1-axis gyro for your purpose. But post in the forums so we have a clearer problem description. Thanks! Mark
      Like. Reply
  • T
    tmbarton January 18, 2019

    “... someone who specializes in meteorology to design it.”

    Not sure that knowledge of atmospheric sciences is going to help much!  Probably better off with someone who specialises in metrology?  😛

    Like. Reply
  • J
    jwhitten January 18, 2019

    I have thought about this problem before and my low-tech solution is to turn the board upside down and affix it to whatever is being measured using the surface of the in lino meter (or whatever) chip itself. That neatly avois many of the “this mounted on that soldered to this glued to that” stack-up of errors and eliminates it to just one (or two depending on how you count) being the manufactured surface of the chip and whatever adhesive is used to attach it with.

    Like. Reply
    • J
      jwhitten January 18, 2019
      Sorry, looks like my post got "auto-corrected"... Was supposed to be inclinometer.
      Like. Reply
    • Mark Hughes January 18, 2019
      @jwhitten, That is a clever solution. I don't know enough about what's going on at the die level to know what flipping the IC would do to it -- but that wouldn't stop someone from just mounting it on the underside of something. Thanks for chiming in! Mark
      Like. Reply
      • J
        jwhitten January 19, 2019
        Well I actually looked it up on the manufacturer's data sheet and while I don't have it in front of me to quote from, it turns out that that they discuss their various package designs and give tolerance specs for the packages and they're pretty good. So turning them upside down seem like a reasonable solution and eliminates all (most) of the various misalignments which can occur. Though your fixture method definitely permits it to be dialed-in to a much better degree. I have been designing and building automated / cnc tools for my workshop and was wrangling with trying to figure out methods to ensure "flatness" and perpendicularity in my machines. Turning them upside down seemed the easiest solution for dealing with the problem. As well as the additional follow-on problem of "compared to what?" with respect for deciding upon the overall "true (level) plane" for reference. Thanks very much for posting your article. It was very informative and I found it interesting and enjoyable to read. John
        Like. Reply
        • Mark Hughes January 19, 2019
          @jwhitten, I'd love to know more about your home-built CNC tools. I tinker around -- but never in a serious way. If you ever post your projects in the forums, please ping me. Also -- this is just one of a whole series of articles about the thing. From what I've seen of rock-solid, last word fixtures that have crazy accuracy -- the solution always seems to be granite. Check out this guy's machines:
  • Mark Hughes January 22, 2019

    This clip was recently brought to my attention:

    Like. Reply
    • J
      jwhitten February 04, 2019
      It wouldn't let me add another reply to the thread above so I'll put it here. Here is a link to a couple of my cnc router projects.
      Like. Reply
      • Mark Hughes February 06, 2019
        @jwhitten that's quite the workshop you've got there. Where did you find all of that 80/20 aluminum? It's usually ridiculously expensive.
        Like. Reply
        • J
          jwhitten February 13, 2019
          Um... It's ridiculously expensive :-) I often buy it from Openbuilds when they have it on sale. Another place I buy it is off of ebay. There are some decent sellers there who part out return shipments, used and cutoffs. You never know exactly what you'll find from day to day but if you keep your eyes open and ready to buy in between projects you can usually find good deals here and there to make it more affordable. What I * wish * I could find at better prices is all the Actobotics stuff. I sure would like to win an "all-you-can-grab" contest with a day's head start! LOL that stuff ain't cheap! So that's our "messy" workshop, where we can make a mess as needed. We do most of our fab work and painting and such out there. We have our "project room" in the basement where we do all of the less messy stuff, electronics, programming, cad work, 3d printing, general tinkering, and "daddy school" where my kids and I learn about various engineering and related subjects. My goal is to keep my kids immersed in "making things" so it becomes second nature for them.
  • Fatah Shaikh February 12, 2019

    How to control any robotics?

    Like. Reply
    • Mark Hughes February 14, 2019
      Hi @Fatah Shaikh, I have a microcontroller with additional GPIO pins on the board and a FFC connector. You'd change the code to control those GPIO pins and have the GPIO pins connect to your "robotics." Does that make sense? You wouldn't necessarily need the USB output -- you'd communicate with the robotics via I2C, SPI, PWM, etc....
      Like. Reply
  • Vigor Technology April 02, 2019

    Wonderful article.

    Like. Reply
    • Mark Hughes April 02, 2019
      @Vigor Technology, Glad you enjoyed it! This is actually one of about 6 articles that talk about the various aspects of design. You can see all of them here: (you might have to scroll down a bit).
      Like. Reply
  • C
    cecep July 01, 2019

    Do you have sort of pdf for this article

    Like. Reply
    • Mark Hughes July 01, 2019
      Sorry, I don't have that. You might be able to copy/paste into Microsoft word or google docs and save it from there. Also, just an FYI, this is one of six articles on the project.
      Like. Reply