Skip to main content

Automation HAT Driver

Project description

Automation HAT

Build Status Coverage Status PyPi Package Python Versions

Automation HAT is a home monitoring and automation controller featuring relays, analog channels, powered outputs, and buffered inputs (all 24V tolerant). This library will also work with Automation HAT's smaller siblings - Automation pHAT and Automation HAT Mini.

Where to buy

Installing

Full install (recommended)

We've created an easy installation script that will install all pre-requisites and get your Automation HAT, pHAT or HAT Mini up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal on your Raspberry Pi desktop, as illustrated below:

Finding the terminal

In the new terminal window type the command exactly as it appears below (check for typos) and follow the on-screen instructions:

curl https://get.pimoroni.com/automationhat | bash

Alternatively, on Raspbian, you can download the pimoroni-dashboard and install your product by browsing to the relevant entry:

sudo apt-get install pimoroni

(you will find the Dashboard under 'Accessories' too, in the Pi menu - or just run pimoroni-dashboard at the command line)

If you choose to download examples you'll find them in /home/pi/Pimoroni/automationhat/.

Manual install

Library install for Python 3

on Raspbian:

sudo apt-get install python3-automationhat

other environments:

sudo pip3 install automationhat

Library install for Python 2

on Raspbian:

sudo apt-get install python-automationhat

other environments:

sudo pip2 install automationhat

Development

If you want to contribute, or like living on the edge of your seat by having the latest code, you should clone this repository, cd to the library directory, and run:

sudo python3 setup.py install

(or sudo python setup.py install whichever your primary Python environment may be)

In all cases you will have to enable the i2c bus.

Documentation & Support

FAQ

What is the accuracy and resolution of the Automation HAT

The ADS1015 is a 12-bit ADC, but since the 12th bit is the sign-bit there are only 11-bits of resolution available for positive voltage readings. The input voltage for 24v channels is scaled from 0-25.85v (25.85 rather than 24 due to how the resistor divider is set up) to 0-3.3v.

Since the full-scale range of the ADC is set to 4.096v, this means that 0-3.3v gives only ~1649 possible usable values making the input measurement granularity somewhere around 0.015v (25.85 / 1649) for the 24v inputs and 0.002v for the 3.3v input.

More information on this topic can be found here: https://forums.pimoroni.com/t/automation-hat-accuracy/7252/3

Changelog

0.4.1

  • Update for SN3218 v2.0.0

0.4.0

  • Switch to ADS1X15 library

0.3.0

  • Switch to setup.cfg
  • Switch to markdown based README
  • Support for ADS1115 board variant

0.2.3

  • 0.2.2 + bump for newer examples

0.2.2

  • Had ST7789 on the brain, swapped for ST7735

0.2.1

  • Add dependency on ST7789 for AMH

0.2.0

  • Fix: Fix thread interleaving and race conditions leading to spurious ADC readings
  • Fix: Switch to non-deprecated alias of thread.isAlive

0.1.0

  • Fix: Defer setup to avoid import side effects
  • Fix: Slowed LED update rate
  • Improvement: Switched to warnings to notify about unsupported features on pHAT

0.0.4

  • Fix for HAT/pHAT detection

0.0.3

  • Fix for Python 3 support

0.0.2

  • Added pHAT support
  • Rounded ADC output to 2 decimal places
  • Set initial state for outputs and fixed toggling
  • Fixed light toggling

0.0.1

  • Initial Release

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

automationhat-0.4.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

automationhat-0.4.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file automationhat-0.4.1.tar.gz.

File metadata

  • Download URL: automationhat-0.4.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for automationhat-0.4.1.tar.gz
Algorithm Hash digest
SHA256 cea0b4186a6447f4a95480350d17476d98c3ef203ecc2914537d669f50521996
MD5 f2f71794be1e8755a14bb5aea0025968
BLAKE2b-256 6724b96532004d91782fd41a47dd05c1f0fd70da67b6c74298907300ec6d8364

See more details on using hashes here.

File details

Details for the file automationhat-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: automationhat-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for automationhat-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 420af9c48aa0a327a6264a48a9bf5f9e15cb464a487e11df1d76945fb414e6d5
MD5 c16b5cbb1b618360fd3c28c2a3b96bf2
BLAKE2b-256 9f5aae12cf4a416d65f0cf607379e1d83f996a52d842daef8a788b45c8de306f

See more details on using hashes here.

Supported by

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