Advertisement

Blog

Combining Accelerometers With MCUs Produces Very Useful Products

I designed an accelerometer-based inclinometer for a piece of medical diagnostic equipment (non-portable) a couple of jobs ago.

The output of the accelerometer was an analog signal that was passed to an ADC. The output of the ADC was used to provide one of several indications of angle of inclination (as opposed to a digital readout of degrees). The ADC's data went to a Windows-based computer that was running the rest of the system, so we had sufficient data crunching capability to do whatever we needed with the inclination information.

There are uses in much equipment built today for an inclinometer or an accelerometer. Most cellphones and many other portable devices use accelerometers. As with my non-portable application, the output of the accelerometer needs additional processing. The output of a typical MEMS accelerometer is a voltage proportional to acceleration (g-forces) or tilt angle. So the next stage will be an ADC, followed by a microcontroller unit (MCU). Additional functionality will likely be needed for display aspects, but more on that later.

For applications like mine where all that's needed is a rough indication, this MCU-based subsystem gets pretty simple. If you want to indicate whether the apparatus was tilted too far forward or too far backward plus how close to vertical the system was, the MCU plus suitable firmware could easily drive a few LEDs from its output ports: 1-a ways to go; 2-almost there; 3-just right; 4-almost there (but the other way), etc.

In my application, I added provisions to automatically (well, mostly) do a calibration. The idea here is that you would move the apparatus to top dead center or vertical position. You would do this with the aid of a precision inclinometer that was accurate to within a fraction of a degree. Then, with a few keystrokes, the computer running the system would zero out the data from the accelerometer. As long as the accelerometer circuit board was mounted in its proper location, it would be close enough to vertical to start with.

Extending this design methodology to the MCU-based system is easy. Replace the keyboard plus computer with a pushbutton connected to a port bit (and a couple more lines of code). Tilt, push the button, and you're done.

If we combine the accelerometer with the MCU and add an LCD interface, we'd have a part that could be used in various portable (high production volume) pieces of equipment. Now, the LCD could show the same rough measurements as described above. Or it could provide a digital readout in degrees. Or it could indicate pictorially the position with respect to vertical.

Do you have a use for such a device? Can you think of variations on this that would be useful?

Related posts:

18 comments on “Combining Accelerometers With MCUs Produces Very Useful Products

  1. Scott Elder
    August 28, 2013

    Brad, the other day I was contemplating what electronic functions need to be local in a portable product as opposed to operating in the cloud.  For example, with an integrated radio, there is no need for local processing or memory.  But navigational devices must absolutely be colocated.  Functions like inertial measurement that use accelerometers and gyroscopes can't be moved into the cloud.  We just need to get the quality of those products up to the performance level required for navigation at a consumer price point.

  2. Davidled
    August 28, 2013

    Turn by Turn function needs to be downloaded from Cloud. Once cloud get the GPS location and vehicle speed from vehicle, all location and POI (destination) should be correctly downloaded into vehicle. In some case, cloud quality is getting more important as one of quality in the connected vehicle.

  3. Scott Elder
    August 28, 2013

    @DaeJ — How do you get GPS information walking inside a big building?  How do you find assets inside a large warehouse or objects on a shelf in a store?  How does GPS keep a fast moving object on course when the update rate is a couple of times a second not milliseconds or microseconds?

    GPS is okay for periodic updates when it is available (think of it like periodic calibration).  But it can't be the only navigational aid for all applications.  What if it goes down?

  4. RedDerek
    August 28, 2013

    Brad, for your calibration you talk about using a precision calibration to validate. Why not take the current readings and then be able to calculate the difference from that point onwards? A bit more challenging with a 3-axis accelerometer, but it can be figured out.

  5. Davidled
    August 28, 2013

    For clarification, Turn-by-turn (TBT) is used in the vehicle. In the most case, inside building is for parking space. It is not necessary to update data every millisecond for this type application, because most vehicle is moving at 80 miles per hour except racing car. In the city driving, TBT is very useful for finding the location. If network is going down, they keeps the same direction for a certain time until network is back up, then route will be updated.

  6. eafpres
    August 28, 2013

    To add more  the navigation application discussion; there are several different methods available to combine things like RTK (real time kinematic) with A-GPS (Assisted GPS–using cell base station timing signals as well as GPS signals, etc.) along with other inputs like wheel speed and turn angle etc. to get a more robust and accurate solution.  As noted, you don't need millisecond turn by turn if you are in a parking garage.  The commercially deployed solutions in most smart phones are better than 1st generation handheld dedicated consumer grade GPS receivers were.  It is very feasible to get the maps from the cloud and update often enough to give turn by turn.  I use an app called Waze (now owned by Google) that uses the sensors in the iPhone and cloud based maps (plus other cool features) and works very, very, well, inside of a moving car.  The systems built into higher end cars are considerably more precise and accurate although their maps may not be any better.  They are able to do dead reckoning through tunnels reasonably well in most cases.  I'm sure some of them use the inertial data and RTK type algorithms to improve position accuracy.

  7. eafpres
    August 28, 2013

    @Brad–your calibraton routine reminded me of when “digital electronic compasses” started appearing in cars.  Did you ever have to do a calibration in one of those?  Usually involved driving in circles one way then the other way and some other steps to get the compass to tell north from south.  

    Your concept of 5 LEDs for rough, almost, and good on both sides is the same as used on electronic tuners for muscial instruments.  Works very well; sometimes better than an analog needle display.

     

  8. Brad_Albing
    August 28, 2013

    @RedDerek – but you need to calibrate it at least once in the beginning to validate. After that, it is OK on its own.

  9. jkvasan
    August 29, 2013

    @Brad,

    Positioning systems used in medical imaging have great uses for the accelerometer. In fact, we had tried this in a breast imaging system and could measure the movement in one degree resolution ( it was a large system ). Higher resolutions are also possible.

  10. Vishal Prajapati
    August 29, 2013

    –> So the next stage will be an ADC, followed by a microcontroller unit (MCU).

     

    @BA, why not the internal ADC of the MCU used?

     

    Is it because you need higher resolution that is not available from inbuilt ADC of the MCU?

  11. samicksha
    August 29, 2013

    I agree you Scott, apart from fact we now have inhouse GPS system which will help you to search but yes we still dont have answer to What if it goes down?

  12. Vishal Prajapati
    August 29, 2013

    There is another way to tracking which gives rough approximation of position. That is through GSM network. This can be used as a back up system when the GPS goes down(which is less likely to happen).

  13. Brad_Albing
    August 29, 2013

    @VP – for some applications, that might be good enough. We wanted a little higher resolution in our system.

  14. Brad_Albing
    August 29, 2013

    @eafpres – I know that cal-procedure for the compass, tho' oddly never had to do it myself. Yep, the guitar tuner is a good example of the 5-level readout with the middle one indicating “right on.”

  15. Brad_Albing
    August 29, 2013

    @Scott – Quite so regarding the cloud. The prices on the MEMS devices are creeping down slowly, so there is hope that a device combining the MEMS part with the MCU would someday be pretty inexpensive.

  16. -gt-
    August 30, 2013

    What is difference to the MMA955xL intelligent motion sensing platform produced by Freescale for some time?

  17. SunitaT
    August 31, 2013

    There is another way to tracking which gives rough approximation of position. That is through GSM network.

    @Vishal, true that is one more alternative to GPS but I find it highily unreliable especially when you are very far away from the GSM network and you tend to pick signal from stations which are very far from the location.

  18. David Maciel Silva
    August 31, 2013

    There is an idea to design vehicles to indicate their position when loaded, inclinometers are for vehicles that carry such ore.

    The equipment will be connected to the cab driver to load the truck know whether to perform tilting the risk, then you can stop the process or through a password to authorize..

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.