Skip to content

MPS20N0040D #6179

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 12 commits into from
Closed

MPS20N0040D #6179

wants to merge 12 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/yourusername/MPS20N0040D.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

Copy link
Contributor

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

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

@github-actions github-actions bot added the topic: submission Add library to the list label Apr 10, 2025
Copy link
Contributor

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

Copy link
Contributor

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

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 review from per1234 and removed request for per1234 April 11, 2025 00:21
Copy link
Contributor

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

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

@github-actions github-actions bot added topic: modification Change existing list entry and removed topic: submission Add library to the list labels Apr 11, 2025
Copy link
Contributor

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/pressure

Linter results for project: no errors or warnings

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

Linter results for projects: 1 ERRORS, 0 WARNINGS

Copy link
Contributor

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 April 11, 2025 00:22
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.

@4211421036 you are establishing a clear pattern of making this mistake in your pull requests. I already explained to you what you need to do:

#5984 (review)

Make sure to always create a branch in your fork for each pull request. You should never make any commits directly to the main branch in your fork. The main branch should always match the main branch in this repository exactly. This way, you can use the main branch as the base for the branches you create for your pull requests. You can learn how to do that from this tutorial:

https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

Always make sure the main branch in your fork is in sync with the main branch in this repository before you make the branch for your pull request. You can learn how to sync your fork from the documentation here:

https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

Did you read what I wrote? If not, then please start paying better attention! If you did read it, then why did you make the same mistake yet again?

This is a basic skill for anyone doing software development on GitHub, which you would need for any pull requests not only for contributions to this repository. If these libraries are actually your own work and not just AI-generated slop, then clearly you are highly intelligent and competent, so surely you are capable of understanding the basics of working with GitHub forks and pull requests.

Copy link
Contributor

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

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

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/pressure

Linter results for project: no errors or warnings

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

Linter results for projects: 1 ERRORS, 0 WARNINGS

Copy link
Contributor

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 April 11, 2025 08:22
@github-actions github-actions bot removed the request for review from per1234 April 12, 2025 02:53
Copy link
Contributor

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

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

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

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

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

@github-actions github-actions bot removed the request for review from per1234 April 16, 2025 01:15
Copy link
Contributor

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

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

Linting library in MPS20N0040D
INFO: No header file found matching library name (MPS20N0040D_Venturi_Flow.h). Best practices are for primary header    
      filename to match library name.                                                                                   
      See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format            
      (Rule LS008)                                                                                                      
WARNING: library.properties name MPS20N0040D Venturi Flow contains spaces. Although supported, best practices is to not 
         use spaces.                                                                                                    
         See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format         
         (Rule LP015)                                                                                                   
ERROR: Library name MPS20N0040D Venturi Flow 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, 1 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, 1 WARNINGS

Copy link
Contributor

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 April 16, 2025 01:16
@4211421036
Copy link
Contributor Author

@ArduinoBot

Copy link
Contributor

Hello! I'm checking your submission again.

@github-actions github-actions bot removed the request for review from per1234 April 16, 2025 01:20
Copy link
Contributor

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

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

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

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 April 16, 2025 01:20
Copy link
Contributor

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

@github-actions github-actions bot removed the request for review from per1234 April 16, 2025 01:21
Copy link
Contributor

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

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

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 April 16, 2025 01:22
@per1234 per1234 self-assigned this Apr 16, 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.

Hi @4211421036. I am rejecting your submission. Although we try to make creating Arduino projects accessible to everyone, the situation is different when it comes to publishing libraries to the Arduino Library Manager. We expect a high level of competence from the maintainers of libraries published to Library Manager and your actions in this pull request and previous pull requests show that you don't meet our standards.

This is the third pull request in which you made this mistake.

The first time, I simply cleaned up your mess for you:

#5960 (comment)

The second time, I also cleaned up your mess for you, and provided detailed advice as to how to correctly use GitHub pull requests

I gave you advice about how you could easily overcome this difficulty multiple times:

#5984 (review)

But now here you are back again making the same mistakes as always. I repeated my advice:

#6179 (review)

but you simply ignored me and instead wasted your time and my time endlessly pushing pointless commits to the pull request.

You have also established a pattern of unnecessarily submitting duplicate pull requests:


⚠ Repeated irresponsible behavior will result in the revocation of your Library Manager Registry privileges. This is your last warning!


Thanks in advance for your cooperation.

@per1234 per1234 closed this Apr 16, 2025
@per1234 per1234 added conclusion: invalid Issue/PR not valid conclusion: declined Will not be worked on and removed conclusion: invalid Issue/PR not valid labels Apr 16, 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: modification Change existing list entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants