element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Summer of FPGA
  • Challenges & Projects
  • Design Challenges
  • Summer of FPGA
  • More
  • Cancel
Summer of FPGA
Blog Liquid-Level Monitoring Using a Pressure Sensor #6 - Project Report Updated
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: guillengap
  • Date Created: 19 Jan 2022 6:49 PM Date Created
  • Views 1877 views
  • Likes 6 likes
  • Comments 2 comments
  • pressure sensor
  • Digilent Cmod S7
  • Liquid level monitoring
  • summer of fpga
Related
Recommended

Liquid-Level Monitoring Using a Pressure Sensor #6 - Project Report Updated

guillengap
guillengap
19 Jan 2022

Table of Contents

  1. Project Introduction
  2. Getting Started
  3. Calibrating the MPX2050DP Pressure Sensor
  4. Calculations and Noise Reduction
  5. Using Vivado and Testing the System
  6. Project Report Updated

**********************************************************************************************************************

Below, I show you the project wrap-up and lessons learned:

Project Introduction

Here I present an alternative solution to measure the water level of a container. This is an economical and accurate way. For this we use the Digilent Cmod S7 board.

image

Getting Started

In this section I show you the steps to follow for the installation of Vivado Software, Xilinx SDK, and Digilent boards.
For those of us who are starting to use this Digilent board, additionally, its necessary to do a basic test to know how the software is used and to prove that the board is in good condition. in this case I tried the blink a LED demo example.

image

Calibrating the MPX2050DP Pressure Sensor

This chapter shows us the steps to calibrate the MPX2050DP pressure sensor. For example, according to the datasheet, the pressure range that can be measured is from 0 to 40 kPa, but the voltage range is from 0 to 40 mV. So I use the LM386N-1 op amp and manage to increase this range by about 200 mV.
Finally we have to use an analog manometer to calibrate the pressure range and compare it with the millivolts measured with the programming board.

image

Calculations and Noise Reduction

When working with small voltages, any noise can cause incorrect readings. To avoid incorrect readings, take a series of measures such as the following: place a 20 picofarad capacitor between ground and Vcc, power the LM386N-1 operational amplifier with 12 vols because its gain is more stable, remove the potentiometer that feeds the MPX2050DP pressure sensor and connect it to 12 volts from the source, remove the potentiometer connected to pin 5 of the LM386N-1 operational amplifier and put a voltage divider with precision resistors, and finally solder pins to the MPX2050DP pressure sensor, as these are very thin and avoid make false contact. The final schematic diagram would look like the one below.

image

Using Vivado and Testing the System

Finally, I have used and modified the code: "Cmod S7-25 XADC Demo" to do the final tests of my project. I consider that this design with the MPX2050DP pressure sensor will be very useful to measure precise levels of water in large containers such as water tanks or swimming pools since its range of pressure values is high. For other cases of measuring smaller water levels and with good precision, perhaps I would use another pressure sensor such as the MPX5010.

image

Download code

You can obtain the modified and compiled code of the project in the download link at the end of this post: Cmod-S7-25-XADC.zip

References:

  • https://www.xilinx.com/
  • https://digilent.com/reference/programmable-logic/cmod-s7/reference-manual
  • /technologies/fpga-group/b/blog/posts/learning-verilog-with-the-digilent-cmod-s7
  • https://github.com/Digilent/Cmod-S7-25-XADC
  • https://www.xilinx.com/video/soc/rfsoc-creating-adc-system-in-ipi.html
  • https://controlautomaticoeducacion.com/arduino/medidor-de-nivel-de-agua-por-presion-con-arduino/
  • https://datasheetspdf.com/pdf-file/916537/FreescaleSemiconductor/MPX2050DP/1
Cmod-S7-25-XADC.zip
  • Sign in to reply
  • guillengap
    guillengap over 3 years ago in reply to DAB

    I hope this experience will be useful to someone... greetings

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 3 years ago

    Nice update.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
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