ADC Pi Input Custom Component

Created 09/08/2017 | Using the ADC Pi Input Custom Component

We have created a custom component to use the IO Pi and IO Pi Zero with Home Assistant smart home software.

Download from GitHub

Software interfaces for Home Assistant from home-assistant.io to use with Raspbery Pi expanstion boards from www.abelectronics.co.uk

Provides:

Installation for ADC Pi Plus and Zero

Copy /custom_components/sensor/adcpi.py to /custom_components/sensor/adcpi.py in Home Assistant config directory

Sensor Configuration

The adcpi sensor can be configured with the following code either in configuration.yaml or sensors.ymal:

- platform: adcpi
  name: ADCPi
  i2c_address: 0x68
  i2c_address2: 0x69
  pga: 1
  bitrate: 18
  scan_interval: 5

Configuration variables:

  • name (Required): Name that will be used in the sensor.
  • i2c_address (Required): The I2C address of the first ADC IC. Default I2C address: 0x68
  • i2c_address2 (Required): The I2C address of the second ADC IC. Default I2C address: 0x69
  • pga (Required): Set the gain of the PGA on the chip. Parameters: gain - 1, 2, 4, 8
  • bitrate (Required): Set the sample bit rate of the adc. 
    • 12 = 12 bit (240SPS max)
    • 14 = 14 bit (60SPS max)
    • 16 = 16 bit (15SPS max)
    • 18 = 18 bit (3.75SPS max)

Usage

Add the following template to your configuration.yaml or sensors.ymal to display the data from the adcpi inputs:

- platform: template
  sensors:
    adcinput1:
      value_template: '{{states.sensor.adcpi.attributes.input1}}'
      friendly_name: 'ADC input 1'
      unit_of_measurement: 'Volts'
    adcinput2:
      value_template: '{{states.sensor.adcpi.attributes.input2}}'
      friendly_name: 'ADC input 2'
      unit_of_measurement: 'Volts'
    adcinput3:
      value_template: '{{states.sensor.adcpi.attributes.input3}}'
      friendly_name: 'ADC input 3'
      unit_of_measurement: 'Volts'
    adcinput4:
      value_template: '{{states.sensor.adcpi.attributes.input4}}'
      friendly_name: 'ADC input 4'
      unit_of_measurement: 'Volts'
    adcinput5:
      value_template: '{{states.sensor.adcpi.attributes.input5}}'
      friendly_name: 'ADC input 5'
      unit_of_measurement: 'Volts'
    adcinput6:
      value_template: '{{states.sensor.adcpi.attributes.input6}}'
      friendly_name: 'ADC input 6'
      unit_of_measurement: 'Volts'
    adcinput7:
      value_template: '{{states.sensor.adcpi.attributes.input7}}'
      friendly_name: 'ADC input 7'
      unit_of_measurement: 'Volts'
    adcinput8:
      value_template: '{{states.sensor.adcpi.attributes.input8}}'
      friendly_name: 'ADC input 8'
      unit_of_measurement: 'Volts' 

 

Shop

Support

Products added to basket

Items

Total (inc shipping)

CheckoutView Basket

Free Shipping on all orders over £30

Click to contact us.
X

Have any Questions?

Send us any questions about this page or product and we will reply within 24 hours.

Submit your Message

X

Have any Questions?

Thank you for contacting us.

We will respond to your enquiry in the next 24 hours.

You can find answers to many questions and additional product support in our Knowledge Base and the Community Forum.