Skip to content

MPS20N0040D #6269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed

MPS20N0040D #6269

wants to merge 16 commits into from

Conversation

4211421036
Copy link
Contributor

MPS20N0040D

Scientific Background

1. Pressure Measurement Principle

The sensor uses MEMS piezoresistive technology. The output voltage ($V_{out}$) relates to applied pressure ($P$) by:

$$ V_{out} = V_{bias} + S \cdot P + \epsilon(T) $$

Where:

  • $S$ = Sensitivity (-0.21%FS/°C, datasheet)
  • $\epsilon(T)$ = Temperature error (±0.08%FS/°C)

2. Venturi Flow Equation

Flow rate ($Q$) is calculated using Bernoulli's principle:

$$ Q = A_1 \sqrt{\frac{2\Delta P}{\rho(1-\beta^4)}} $$

Where:

  • $\beta = \frac{d_2}{d_1}$ (diameter ratio)
  • $\rho$ = Fluid density (kg/m³)

System Diagram

graph LR
  A[MPS20N0040D-S] -->|Differential mV| B[HX710 ADC]
  B -->|24-bit Data| C[Arduino]
  C --> D[Serial Monitor]
  C --> E[Control System]
Loading

Wiring Diagram

Arduino Wiring Diagram

The following is a description of the image:

  1. The sensor, designated as MPS20N0040D-S, is connected to
    • Pin 1, identified as V+. It is to be connected to a 5V Microcontroller
    • Pin 2 (GND) is to be connected to: Connects to GND Microcontroller
    • Pin 3 (Vout+): Connects to IN+ HX710
    • Pin 4 (Vout-): Connects to IN- HX710

Installation

  1. Download the ZIP and install via Arduino IDE:
    Sketch > Include Library > Add .ZIP Library
  2. Or clone to Arduino libraries folder:
    git clone https://github.com/4211421036/mps20n0040d-sensor.git

Function Documentation

Function Parameters Description
begin() - Initializes sensor and ADC pins
readPressure() - Returns pressure in Pascals (Pa)
calculateFlowRate() pressureDiff, density (optional) Computes flow rate in m³/s

Example Code

#include <MPS20N0040D.h>

// Pin definition
#define PD_SCK 3
#define DOUT 4

MPS20N0040D sensor(PD_SCK, DOUT);

void setup() {
  Serial.begin(9600);
  sensor.begin();
}

void loop() {
  float pressure = sensor.readPressure();
  float flowRate = sensor.calculateFlowRate(pressure, 1000.0); // Water density
  
  Serial.print("Pressure: "); 
  Serial.print(pressure); 
  Serial.println(" Pa");
  
  Serial.print("Flow Rate: "); 
  Serial.print(flowRate * 1000, 2); // Convert to L/s
  Serial.println(" L/s");
  
  delay(1000);
}

Calibration Procedure

  1. Apply known pressures (0-40kPa) using a dead weight tester
  2. Record ADC outputs
  3. Update these constants in MPS20N0040D.cpp:
    const float V_REF = 5.0;    // Measured reference voltage
    const float FS_OUTPUT = 0.1; // Verified full-scale output

Technical Specifications

Parameter Value Unit
Pressure Range 0-40 kPa
Accuracy ±0.25 % FS
Operating Voltage 2.6-5.5 V
Output Data Rate 10/80 SPS

Author

  1. Ana Maulida
  2. GALIH RIDHO UTOMO

@github-actions github-actions bot added the topic: modification Change existing list entry label May 4, 2025
Copy link
Contributor

github-actions bot commented May 4, 2025

Hi @4211421036.
Your pull request has been detected as something other than a Library Manager submission.
A maintainer will need to review it before it can be merged.

If you intended to submit a library, please check the instructions and update your pull request if necessary:
https://github.com/arduino/library-registry/blob/main/README.md#instructions

Copy link
Contributor

github-actions bot commented May 4, 2025

A problem was found with your submission https://github.com/4211421036/YFS201

ERROR: Submission URL is already in the Library Manager index.

Copy link
Contributor

github-actions bot commented May 4, 2025

ERROR: Arduino Lint found errors with https://github.com/4211421036/mps20n0040d:

Linting library in mps20n0040d
ERROR: Library name MPS20N0040D not found in the Library Manager index. Library names are not allowed to change after   
       being added to the index.                                                                                        
       See: https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name               
       (Rule LP018)                                                                                                     

Linter results for project: 1 ERRORS, 0 WARNINGS

-------------------

Linting sketch in mps20n0040d/examples/FlowRate

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d/examples/Pipe/DoublePipe

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d/examples/Pipe/SinglePipe

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d/examples/Pressure

Linter results for project: no errors or warnings

-------------------

Linter results for projects: 1 ERRORS, 0 WARNINGS

Copy link
Contributor

github-actions bot commented May 4, 2025

Thanks for your interest in contributing to the Arduino Library Manager index @4211421036
Please resolve the error(s) mentioned in the previous comment.

After resolving the issue, trigger this check again by doing one of the following:

  • Commit the required change to the branch you submitted this pull request from.
  • Comment here, mentioning @ArduinoBot in the comment.

NOTE: It is not necessary to open a new pull request. ❗

More information:
https://github.com/arduino/library-registry/blob/main/README.md#if-the-problem-is-with-the-pull-request

@github-actions github-actions bot requested a review from per1234 May 4, 2025 16:00
@github-actions github-actions bot removed the request for review from per1234 May 4, 2025 16:04
Copy link
Contributor

github-actions bot commented May 4, 2025

Hi @4211421036.
Your pull request has been detected as something other than a Library Manager submission.
A maintainer will need to review it before it can be merged.

If you intended to submit a library, please check the instructions and update your pull request if necessary:
https://github.com/arduino/library-registry/blob/main/README.md#instructions

Copy link
Contributor

github-actions bot commented May 4, 2025

A problem was found with your submission https://github.com/4211421036/YFS201

ERROR: Submission URL is already in the Library Manager index.

Copy link
Contributor

github-actions bot commented May 4, 2025

ERROR: Arduino Lint found errors with https://github.com/4211421036/mps20n0040d-arduino:

Linting library in mps20n0040d-arduino
ERROR: Library name MPS20N0040D not found in the Library Manager index. Library names are not allowed to change after   
       being added to the index.                                                                                        
       See: https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name               
       (Rule LP018)                                                                                                     

Linter results for project: 1 ERRORS, 0 WARNINGS

-------------------

Linting sketch in mps20n0040d-arduino/examples/FlowRate

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d-arduino/examples/Pipe/DoublePipe

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d-arduino/examples/Pipe/SinglePipe

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d-arduino/examples/Pressure

Linter results for project: no errors or warnings

-------------------

Linter results for projects: 1 ERRORS, 0 WARNINGS

Copy link
Contributor

github-actions bot commented May 4, 2025

Thanks for your interest in contributing to the Arduino Library Manager index @4211421036
Please resolve the error(s) mentioned in the previous comment.

After resolving the issue, trigger this check again by doing one of the following:

  • Commit the required change to the branch you submitted this pull request from.
  • Comment here, mentioning @ArduinoBot in the comment.

NOTE: It is not necessary to open a new pull request. ❗

More information:
https://github.com/arduino/library-registry/blob/main/README.md#if-the-problem-is-with-the-pull-request

@github-actions github-actions bot requested a review from per1234 May 4, 2025 16:04
@github-actions github-actions bot removed the request for review from per1234 May 4, 2025 16:09
Copy link
Contributor

github-actions bot commented May 4, 2025

Hi @4211421036.
Your pull request has been detected as something other than a Library Manager submission.
A maintainer will need to review it before it can be merged.

If you intended to submit a library, please check the instructions and update your pull request if necessary:
https://github.com/arduino/library-registry/blob/main/README.md#instructions

Copy link
Contributor

github-actions bot commented May 4, 2025

ERROR: Arduino Lint found errors with https://github.com/4211421036/mps20n0040d-arduino:

Linting library in mps20n0040d-arduino
ERROR: Library name MPS20N0040D not found in the Library Manager index. Library names are not allowed to change after   
       being added to the index.                                                                                        
       See: https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name               
       (Rule LP018)                                                                                                     

Linter results for project: 1 ERRORS, 0 WARNINGS

-------------------

Linting sketch in mps20n0040d-arduino/examples/FlowRate

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d-arduino/examples/Pipe/DoublePipe

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d-arduino/examples/Pipe/SinglePipe

Linter results for project: no errors or warnings

-------------------

Linting sketch in mps20n0040d-arduino/examples/Pressure

Linter results for project: no errors or warnings

-------------------

Linter results for projects: 1 ERRORS, 0 WARNINGS

Copy link
Contributor

github-actions bot commented May 4, 2025

Thanks for your interest in contributing to the Arduino Library Manager index @4211421036
Please resolve the error(s) mentioned in the previous comment.

After resolving the issue, trigger this check again by doing one of the following:

  • Commit the required change to the branch you submitted this pull request from.
  • Comment here, mentioning @ArduinoBot in the comment.

NOTE: It is not necessary to open a new pull request. ❗

More information:
https://github.com/arduino/library-registry/blob/main/README.md#if-the-problem-is-with-the-pull-request

@github-actions github-actions bot requested a review from per1234 May 4, 2025 16:09
Copy link
Contributor

github-actions bot commented May 4, 2025

Hi @4211421036
A problem was found with your pull request:

ERROR: Pull request removes newline from the end of a file.
Please add a blank line to the end of the file.

Please resolve this error. The checks will automatically run again once that is done.

More information:
https://github.com/arduino/library-registry/blob/main/README.md#if-the-problem-is-with-the-pull-request

@github-actions github-actions bot added topic: invalid Request could not be processed and removed topic: modification Change existing list entry labels May 4, 2025
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @4211421036. Due to you having established a pattern of irresponsible behavior in your activity in this repository, your Arduino Library Manager Registry privileges have been revoked:

We will not accept any further requests from you or for your libraries.

If you would like to request the restoration of your privileges, you can follow this procedure:


⚠ These instructions must be followed precisely and comprehensively. Any deviation from the instructions will result in the rejection of your request.


  1. Open a new issue in this repository's issue tracker.
    The "Create new issue" dialog will open.

  2. Select "Blank issue" from the dialog.
    The new issue composer page will open.

  3. Give the issue a title with this exact format:

    Registry privileges restoration request for <entity>
    
  4. Replace the <entity> placeholder in the title with the name of the user or organization whose registry privileges you are requesting be restored.

  5. Add the following template text to the description field of the issue:

    ## Privileges revocation reference
    
    <revocation notification URL>
    
  6. Replace the <revocation notification URL> placeholder in the description with the URL of this comment that provides notification of the revocation of registry privileges.
    You can get the URL of the comment by clicking on the date stamp on the comment header.

  7. Add the following template text to the description field of the issue:

    ## Reason for privileges revocation
    
    <description>
    
  8. Replace the <description> placeholder in the description with a detailed and clear description of the irresponsible behavior that resulting in the registry privileges being revoked. Include reference URLs for each of the irresponsible actions.

  9. Add the following template text to the description field of the issue:

    ## Behavioral modification pledge
    
    <description>
    
  10. Replace the <description> placeholder in the description with a detailed and clear description of the changes you will make to your future activity if registry privileges are restored.

  11. Carefully review the title and description to ensure you have followed these instructions exactly, that your request includes all relevant details, that your request is clearly written, and that your request does not contain any typographical errors.

  12. Submit the issue.

  13. Wait patiently for the repository maintainer to review your request.

@per1234 per1234 self-assigned this May 4, 2025
@per1234 per1234 closed this May 4, 2025
@per1234 per1234 added conclusion: declined Will not be worked on topic: submission Add library to the list and removed topic: invalid Request could not be processed labels May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: declined Will not be worked on topic: submission Add library to the list
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants