Skip to main content

Driver for the Pimoroni Automation HAT

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 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:

git clone https://github.com/pimoroni/automation-hat
cd automation-hat
./install.sh

Note Libraries will be installed in the "pimoroni" virtual environment, you will need to activate it to run examples:

source ~/.virtualenvs/pimoroni/bin/activate

Development:

If you want to contribute, or like living on the edge of your seat by having the latest code, you can install the development version like so:

git clone https://github.com/pimoroni/automation-hat
cd automation-hat
./install.sh --unstable

In all cases you will have to enable the I2C bus (and SPI for Automation HAT Mini):

sudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_spi 0

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

1.0.0

  • Refactor to gpiod/gpiodevice.
  • Repackage to hatch/pyproject.toml.

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-1.0.0.tar.gz (114.0 kB view hashes)

Uploaded Source

Built Distribution

automationhat-1.0.0-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

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