element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sustain The World - Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Sustain The World - Design Challenge
  • More
  • Cancel
Sustain The World - Design Challenge
Blog Blog #5 - Reading from the DPS368 Pressure Shield2Go
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dang74
  • Date Created: 15 Sep 2020 1:30 AM Date Created
  • Views 901 views
  • Likes 2 likes
  • Comments 0 comments
Related
Recommended

Blog #5 - Reading from the DPS368 Pressure Shield2Go

dang74
dang74
15 Sep 2020

This week I decided to experiment with the DPS368 Pressure Shield2Go module.

 

The module was installed onto one of two available sites for Platform2Go modules.

 

image

 

I used DAVE to assign SCL and SDA to P3.0 and P2.5 respectively.

 

image

 

The DPS368 device that is used for the air pressure measurements is fairly complicated in terms of the calculations and post processing that need to be performed to the raw pressure and temperature readings.

 

First it is necessary to convert the raw pressure reading (Praw) to a scaled format (Praw_sc).

 

For the low precision, manual measurement mode I am using this works out to:

 

Praw_sc = Praw / 524,288

 

From there, calculating pressure requires a number of coefficients.  The formula for this, which appears below, is from Infineon's DPS368 datasheet.

 

image

If you aren't interested in temperature compensation, I believe the formula's first 3 terms are sufficient.

The last two terms in the formula apply temperature compensation for increased accuracy.

 

The coefficients in the equation above, C00, C10, etc., are unique for each device and are stored in registers 0x10 through 0x21.

 

When I read back from these registers on my device this is what I got....

 

image

 

Currently I am not using temperature compensation.  The code below shows the function I use to calculate air pressure in (Pa) units.

 

image

 

So, just how accurate are the readings from the DPS368?

 

At 9:00AM the official reading for my town was 102.30kPa.

 

image

 

The value I read back from the DPS368 was 102,255Pa.

 

image

 

Greater accuracy can be achieved through temperature compensation and oversampling (i.e. programming the device to perform multiple measurements).

 

These techniques are more involved than what I am currently doing... so I may press ahead and only come back to improve accuracy if time permits.

 

 

In Closing

 

So, yeah... the DPS368 pressure formula is pretty complicated by microcontroller standards and this is the first time I used floats in a microcontroller application in like... forever....

 

.But it was really rewarding to see pressure readings that closely match those that are officially reported for my town.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube