Coder Social home page Coder Social logo

nthnn / ph4502c-sensor Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 508 KB

Comprehensive and easy-to-use Arduino library for PH4502C pH level and temperature sensor.

Home Page: https://nthnn.github.io/PH4502C-Sensor/

License: MIT License

C++ 100.00%
arduino arduino-library arduino-sensor embedded-systems

ph4502c-sensor's Introduction

PH4502C Sensor Arduino Library

Arduino Lint GitHub Pages Arduino Release License: MIT

This Arduino library provides a convenient and easy-to-use interface for the PH4502C sensor, allowing you to effortlessly integrate it into your Arduino projects. The PH4502C sensor is a high-precision pH sensor capable of accurately measuring pH levels in various applications.

Features

  • Simple and intuitive API for interacting with the PH4502 sensor.
  • Supports pH measurement with high precision and accuracy. Automatic temperature compensation for more accurate readings.
  • Flexible calibration options to ensure optimal performance.
  • Lightweight and efficient implementation for resource-constrained Arduino boards.

Installation

To use the PH4502 Sensor Arduino Library, follow these steps:

Installation on Arduino IDE

Just type "PH4502C-Sensor" on the Library Manager of the Arduino IDE.

Alternatively you can follow the steps below:

  1. Download the library by clicking on the "Download" button or clone it using Git:

    git clone https://github.com/nthnn/PH4502C-Sensor.git
  2. Place the downloaded library folder into the Arduino libraries directory on your computer. In Windows, the default location is usually:

    [Arduino Documents Folder]/libraries/
  3. Launch the Arduino IDE. Then, click on "Sketch" and then navigate to Include Library. You should see the newly added "PH4502-Sensor" option. Click on it to include the library in your sketch.

Now you are ready to use the PH4502 Sensor Library in your Arduino projects.

Installation on PlatformIO

Type "PH4502C-Sensor" on the PlatformIO library registry, and click "Add Project." And that's it!

Getting Started

To begin using the PH4502 Sensor Library, follow these simple steps:

  1. Connect your PH4502C sensor to your Arduino board. Make sure to connect the appropriate VCC, GND, and data pins based on your Arduino model and pin configuration.

  2. In your Arduino sketch, include the PH4502C Sensor Library by adding the following line at the top of your code:

    #include <ph4502c_sensor.h>

    Create an instance of the PH4502C_Sensor class:

    PH4502Sensor ph4502c(A0, A1);
    
    // Analog Pin 0 - pH level pin
    // Analog Pin 1 - temperature pin

    Initialize the sensor in the setup() function of your sketch:

    void setup() {
        // Initialize the sensor
        ph4502c.init();
    }

    Read the pH value from the sensor using the readpH() function:

    void loop() {
        // Read pH value
        float pHValue = ph4502c.read_ph_level();
    
        // Do something with the pH value
        // Delay before next reading
        delay(1000);
    }

    Optionally, you can calibrate the sensor for better accuracy. Refer to the library documentation for more information on calibration.

Documentation

For detailed information on the library functions, classes, and usage examples, please refer to the PH4502 Sensor Library Documentation.

Contributing

Contributions to this library are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features, please feel free to submit a pull request or open an issue on the GitHub repository.

Before submitting a pull request, please ensure that your code follows the existing coding style and that relevant tests have been added or updated.

License

Copyright 2023 - Nathanne Isip

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ph4502c-sensor's People

Contributors

nthnn avatar tomcat-42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tomcat-42

ph4502c-sensor's Issues

Dallas temperature sensor request

Hi, thanks for the ph library. Would you be so kind as to add functionality for the Dallas external temp sensor to compensate ph from temp please? I want to use the ph probe in the pipe and measure the temperature using dallas. Thank you.

Temperature?

Nathanne,

I'm trying to understand converting the TO pin voltage to a human readable celsius or fahrenheit. I see in your example you are calling ph4502c.read_temp(). However, when I look at that function, it seems like it just returns the straight pin value, not any sort of conversion.

int PH4502C_Sensor::read_temp() {
    return analogRead(this->_temp_pin);
}

For example, I'll just get a value of 752.00. I can't find any datasheet explaining what the equation should be for temperature.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.