bmx280-spi


Namebmx280-spi JSON
Version 1.0.4 PyPI version JSON
download
home_page
SummaryPython module to use the SPI bus to read bmp280/bme280 sensors
upload_time2023-08-12 05:40:00
maintainer
docs_urlNone
author
requires_python>=3.6
license
keywords bmp280 bme280 spi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BMP280 / BME280 over SPI

Homepage: https://www.learningtopi.com/python-modules-applications/bmx280_spi/

BMP280/BME280 python3 driver using the SPI bus to control and read data.

General GPIO Pin (NOT an SPI CS) used to pull the signal pin low.  The SPI CS pins do not operate properly with the SPI kernel driver.

BMP280 datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf

BME280 datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf

BMP280/BME280 Pinout:
    SCL = SCK (SPI Clock)
    SDO = MISO (sensor out to board in)
    SDA = MOSI (sensir in to board out)
    CSB = CS (select)

### Parts:
- BMP280 (Temp and pressure) - https://amzn.to/3YVwblE
- BME280 (Temp, pressure and humidity) - https://amzn.to/3JIxtMr

## Usage:


    # Import bmx280 SPI class
    from bmx280_spi import Bmx280Spi, MODE_NORMAL

    # initialize device
    # cs_chip and cs_pin from "gpioinfo".  gpiod used for platform compatibility.
    bmx = Bmx280Spi(spiBus=0, cs_chip=0, cs_pin=26)
    bmx.set_power_mode(MODE_NORMAL)
    bmx.set_sleep_duration_value(3)
    bmx.set_temp_oversample(1)
    bmx.set_pressure_oversample(1)
    bmx.set_filter(0)
    reading = bmx.update_reading() # returns instance of Bmx280Readings
    print(reading)
    # --or--
    print(reading.temp_c, reading.temp_f, reading.pressure_psi)

## Testing
Included in the module is a basic test script that can be executed with the following:

    python3 -m dht11_spi [gpio]

Additional test options are available for interval, run time, dht22.  Documentation is available using the "--help" option.

### Example Output

    DHT11: 105/105 (100.0%): Temps (min/avg/max): 73.54/75.2/75.34 deg FHumidity (min/avg/max): 17.0/17.0/17.0 %
    DHT22: 112/112 (100.0%): Temps (min/avg/max): 74.48/74.51/74.66 deg FHumidity (min/avg/max): 14.1/14.21/16.0 %

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "bmx280-spi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "bmp280,bme280,spi",
    "author": "",
    "author_email": "Thomas Dunteman <git@learningtopi.com>",
    "download_url": "https://files.pythonhosted.org/packages/44/9a/d3ae557b4f3c5178bc0a5fd030b5309f49085c20dff0cd3fca371e9c7c5b/bmx280_spi-1.0.4.tar.gz",
    "platform": null,
    "description": "# BMP280 / BME280 over SPI\n\nHomepage: https://www.learningtopi.com/python-modules-applications/bmx280_spi/\n\nBMP280/BME280 python3 driver using the SPI bus to control and read data.\n\nGeneral GPIO Pin (NOT an SPI CS) used to pull the signal pin low.  The SPI CS pins do not operate properly with the SPI kernel driver.\n\nBMP280 datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf\n\nBME280 datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf\n\nBMP280/BME280 Pinout:\n    SCL = SCK (SPI Clock)\n    SDO = MISO (sensor out to board in)\n    SDA = MOSI (sensir in to board out)\n    CSB = CS (select)\n\n### Parts:\n- BMP280 (Temp and pressure) - https://amzn.to/3YVwblE\n- BME280 (Temp, pressure and humidity) - https://amzn.to/3JIxtMr\n\n## Usage:\n\n\n    # Import bmx280 SPI class\n    from bmx280_spi import Bmx280Spi, MODE_NORMAL\n\n    # initialize device\n    # cs_chip and cs_pin from \"gpioinfo\".  gpiod used for platform compatibility.\n    bmx = Bmx280Spi(spiBus=0, cs_chip=0, cs_pin=26)\n    bmx.set_power_mode(MODE_NORMAL)\n    bmx.set_sleep_duration_value(3)\n    bmx.set_temp_oversample(1)\n    bmx.set_pressure_oversample(1)\n    bmx.set_filter(0)\n    reading = bmx.update_reading() # returns instance of Bmx280Readings\n    print(reading)\n    # --or--\n    print(reading.temp_c, reading.temp_f, reading.pressure_psi)\n\n## Testing\nIncluded in the module is a basic test script that can be executed with the following:\n\n    python3 -m dht11_spi [gpio]\n\nAdditional test options are available for interval, run time, dht22.  Documentation is available using the \"--help\" option.\n\n### Example Output\n\n    DHT11: 105/105 (100.0%): Temps (min/avg/max): 73.54/75.2/75.34 deg FHumidity (min/avg/max): 17.0/17.0/17.0 %\n    DHT22: 112/112 (100.0%): Temps (min/avg/max): 74.48/74.51/74.66 deg FHumidity (min/avg/max): 14.1/14.21/16.0 %\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python module to use the SPI bus to read bmp280/bme280 sensors",
    "version": "1.0.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/LearningToPi/bmx280_spi/issues",
        "Homepage": "https://www.learningtopi.com/python-modules-applications/bmx280_spi/",
        "Source Code": "https://github.com/LearningToPi/bmx280_spi"
    },
    "split_keywords": [
        "bmp280",
        "bme280",
        "spi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c3611a59c45e478ae5b26be368e91f510a95daf781779694cd6596a0b6fc13f",
                "md5": "dd18a0a4ab16b872ef3877cf623d1b95",
                "sha256": "770859e80874a669357a079ab0adbbcf64fbe20cd4095dfd8b11cb19a0b32483"
            },
            "downloads": -1,
            "filename": "bmx280_spi-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dd18a0a4ab16b872ef3877cf623d1b95",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14377,
            "upload_time": "2023-08-12T05:39:59",
            "upload_time_iso_8601": "2023-08-12T05:39:59.066840Z",
            "url": "https://files.pythonhosted.org/packages/6c/36/11a59c45e478ae5b26be368e91f510a95daf781779694cd6596a0b6fc13f/bmx280_spi-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "449ad3ae557b4f3c5178bc0a5fd030b5309f49085c20dff0cd3fca371e9c7c5b",
                "md5": "9146c9eb5e77f257dd73cf1aba1a9b3a",
                "sha256": "f792f9f78a6cd3d4791899c718831522c5d6d250af4edb72a7baa8d53d22f59e"
            },
            "downloads": -1,
            "filename": "bmx280_spi-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "9146c9eb5e77f257dd73cf1aba1a9b3a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13499,
            "upload_time": "2023-08-12T05:40:00",
            "upload_time_iso_8601": "2023-08-12T05:40:00.656090Z",
            "url": "https://files.pythonhosted.org/packages/44/9a/d3ae557b4f3c5178bc0a5fd030b5309f49085c20dff0cd3fca371e9c7c5b/bmx280_spi-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-12 05:40:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "LearningToPi",
    "github_project": "bmx280_spi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bmx280-spi"
}
        
Elapsed time: 1.69944s