Knowledge Base

The AB Electronics UK Knowledge Base provides support solutions, tutorials and troubleshooting guides.

ADC Pi Input Custom Component

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

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 to use with Raspbery Pi expansion boards from


  • Functionality to read voltages from ADC Pi

Installation for ADC Pi Plus and Zero

Copy /custom_components/sensor/ to /custom_components/sensor/ 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)


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

- platform: template
      value_template: '{{states.sensor.adcpi.attributes.input1}}'
      friendly_name: 'ADC input 1'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input2}}'
      friendly_name: 'ADC input 2'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input3}}'
      friendly_name: 'ADC input 3'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input4}}'
      friendly_name: 'ADC input 4'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input5}}'
      friendly_name: 'ADC input 5'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input6}}'
      friendly_name: 'ADC input 6'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input7}}'
      friendly_name: 'ADC input 7'
      unit_of_measurement: 'Volts'
      value_template: '{{states.sensor.adcpi.attributes.input8}}'
      friendly_name: 'ADC input 8'
      unit_of_measurement: 'Volts' 
Was this article helpful? Yes / No