Skip to main content

This API provides functions for the configuration and operation of the Parallax 555-28027 PIR sensor and the Omron D6T-1A-02 temperature sensor. The data read from these modules may then be relayed via TCP protocols, from many clients to a single server, using a simplified rendition of the integrated Python Socket package.

Project description

OmlaxTCP

https://img.shields.io/pypi/v/omlaxtcp.svg https://img.shields.io/travis/AadamAbrahams/omlaxtcp.svg Documentation Status

This Raspberry Pi-Python API provides functions for the configuration and operation of the Parallax 555-28027 PIR sensor and the Omron D6T-1A-02 temperature sensor. The data read from these modules may then be relayed via TCP protocols, from many clients to a single server, using a simplified rendition of the integrated Python Socket package.

Features

Basic configuration and operation of:
  • The Parallax 555-28027 PIR motion sensor.

  • The Omron D6T-1A-02 temperature sensor using I2C communication protocols.

  • TCP network protocols using a simplified rendition of the integrated Python Socket package.

Additional functionality includes:
  • Speed detection through the use of two PIR motion sensors seperated by a specified distance.

  • Direction detection through the use of two PIR motion sensors opposing one another, such that one is triggered prior to the other.

  • Fever detection through the use of a single temperature sensor and a given maximum temperature boundary. (Can be used to determine if anything produces a temperature above a given maximum, not specifically human temperatures.)

Hardware and Software Prerequisites

A majority of the functions contained within this API may require a certain hardware module attached and/or a specific set of python libraries installed to operate as intended. However, in all instances that a hardware module is required, a Raspberry Pi (Any version) is necessary.

To make use of any of the functions contained in motionSensor.py, a Parallax 555-28027 PIR motion sensor is required and may be connected to a GPIO pin of choice. However, it would be possible to use any PIR motion sensor that has a single output pin, and that outputs 1 when triggered and 0 while untriggered. Note: Functions direc_detect_with_BuzzandTemp(motion_out, motion_in) and def init_trig_with_BuzzandTemp(motion) require that an Omron D6T-1A-02 temperature sensor is connected as well as a buzzer.

To make use of any of the functions contained in tempSensor.py, an Omron D6T-1A-02 temperature sensor is required and must be connected to the relevant I2C specific pins to allow for complete communication. The python packages pigpio, smbus2 and crcmod are essential and needed to be installed as follows:

pip install pigpio smbus2 crcmod

It is also required, on Linux-based machines, that when a program that makes use of these functions is executed for the first time, the following line is asserted in the command line:

sudo pigpiod

The functions defined in TCP.py do not require any additional hardware modules, it merely requires that the device implementing the subpackage be connected to a router. Such that, at a minimum, devices may communicate over the Local Area Network. If the user wishes to exchange data between devices over the internet, the device acting as the server is required to have its router port forwarding, on the relevant socket port, to the device in question.

Quick Install

To install the API package, assert the following in the python environment command line:

pip install omlaxtcp

Sample Usage

Illustrated below, is a sample usage of motionSensor.py, which can be applied to any of the files contained within the OmlaxTCP API package:

from omlaxtcp import motionSensor

motionSensor.setup(1)
motionSensor.direc_detect_with_BuzzandTemp(0, 1)

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2020-10-30)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omlaxtcp-0.1.3.tar.gz (15.9 kB view details)

Uploaded Source

File details

Details for the file omlaxtcp-0.1.3.tar.gz.

File metadata

  • Download URL: omlaxtcp-0.1.3.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for omlaxtcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c7cfeaa0982230e12eba77427aa06d506cb146614b258475700c87c8d3834b0d
MD5 52fcb02f2f367e6ad0324ff4c8ff6d09
BLAKE2b-256 1a1585518ea8f5416e3a39d3f960e5203980db54c01e37445fbdc63f560b3eb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page