micropython-dftds


Namemicropython-dftds JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/WendelHime/micropython-dftds
SummaryMicroPython library for the TDS meter sensor
upload_time2023-07-11 20:49:07
maintainer
docs_urlNone
authorWendel Hime Lino Castro
requires_python
licenseMIT
keywords micropython electronics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # micropython-dftds

This repository reproduces the C++ implementation of the [DFRobot Gravity TDS](https://github.com/DFRobot/GravityTDS) sensor with micropython. With this repository, I hope to be able to use a TDS sensor on a Raspberry Pico W.

## Installing

```bash
micropython -m mip install github:WendelHime/micropython-dftds
```

If you're installing through thonny or developing something with another IDE, the package is also available on pypi:
```bash
pip install micropython-dftds
```

## Testing

```bash
micropython -m unittest tests/*
```

## Usage

```python
from machine import ADC

import dftds

# must be an analog pin
TDS_PIN = 28
# create TDS object remembering to set the values according to your device. On raspberry pico the ADC range is 65535.
# another thing to observe, on rasberry pico we have memory flash available, if you need this code to work on another storage device such as EEPROM you might need to create another implementation of KValueRepository. Feel free to open an PR and contribute.
tds_sensor = dftds.GravityTDS(TDS_PIN, adc_range=65535, k_value_repository=dftds.KValueRepositoryFlash('tds_calibration.json'))
tds_sensor.begin()

# you can read the temperature using a dht22 or other device
tds_sensor.temperature = 25.0
tds_value = tds_sensor.update()
print("TDS: {}ppm, EC: {} mS/cm".format(tds_value, tds_value*2))
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/WendelHime/micropython-dftds",
    "name": "micropython-dftds",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "micropython,electronics",
    "author": "Wendel Hime Lino Castro",
    "author_email": "wendelhime@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/29/c2/4e78aa859faad164e49aea0aa556e97417de2f9a01af9f42403c7d3bfa22/micropython-dftds-0.0.2.tar.gz",
    "platform": null,
    "description": "# micropython-dftds\n\nThis repository reproduces the C++ implementation of the [DFRobot Gravity TDS](https://github.com/DFRobot/GravityTDS) sensor with micropython. With this repository, I hope to be able to use a TDS sensor on a Raspberry Pico W.\n\n## Installing\n\n```bash\nmicropython -m mip install github:WendelHime/micropython-dftds\n```\n\nIf you're installing through thonny or developing something with another IDE, the package is also available on pypi:\n```bash\npip install micropython-dftds\n```\n\n## Testing\n\n```bash\nmicropython -m unittest tests/*\n```\n\n## Usage\n\n```python\nfrom machine import ADC\n\nimport dftds\n\n# must be an analog pin\nTDS_PIN = 28\n# create TDS object remembering to set the values according to your device. On raspberry pico the ADC range is 65535.\n# another thing to observe, on rasberry pico we have memory flash available, if you need this code to work on another storage device such as EEPROM you might need to create another implementation of KValueRepository. Feel free to open an PR and contribute.\ntds_sensor = dftds.GravityTDS(TDS_PIN, adc_range=65535, k_value_repository=dftds.KValueRepositoryFlash('tds_calibration.json'))\ntds_sensor.begin()\n\n# you can read the temperature using a dht22 or other device\ntds_sensor.temperature = 25.0\ntds_value = tds_sensor.update()\nprint(\"TDS: {}ppm, EC: {} mS/cm\".format(tds_value, tds_value*2))\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MicroPython library for the TDS meter sensor",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/WendelHime/micropython-dftds",
        "github": "https://github.com/WendelHime/micropython-dftds"
    },
    "split_keywords": [
        "micropython",
        "electronics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "528a0ab615e7053ea97dff8a8fdb4e50e7a6756cc230e499345b73a610880999",
                "md5": "bc0bb1a1be69bdab3314ccaf79018a82",
                "sha256": "bfdf12dac83843f3c2d68c0054cdfa4ed775b40a20c5a266762ca811919c9ee3"
            },
            "downloads": -1,
            "filename": "micropython_dftds-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bc0bb1a1be69bdab3314ccaf79018a82",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4603,
            "upload_time": "2023-07-11T20:49:06",
            "upload_time_iso_8601": "2023-07-11T20:49:06.516219Z",
            "url": "https://files.pythonhosted.org/packages/52/8a/0ab615e7053ea97dff8a8fdb4e50e7a6756cc230e499345b73a610880999/micropython_dftds-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29c24e78aa859faad164e49aea0aa556e97417de2f9a01af9f42403c7d3bfa22",
                "md5": "689e9a42eedfefc7a3943457cfa6a1af",
                "sha256": "52790f7bbb817434401d5cd5fb8e76761d121f6f3079486699d10bf5cf1daf43"
            },
            "downloads": -1,
            "filename": "micropython-dftds-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "689e9a42eedfefc7a3943457cfa6a1af",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4105,
            "upload_time": "2023-07-11T20:49:07",
            "upload_time_iso_8601": "2023-07-11T20:49:07.457573Z",
            "url": "https://files.pythonhosted.org/packages/29/c2/4e78aa859faad164e49aea0aa556e97417de2f9a01af9f42403c7d3bfa22/micropython-dftds-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-11 20:49:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "WendelHime",
    "github_project": "micropython-dftds",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "micropython-dftds"
}
        
Elapsed time: 1.41011s