The Pi Hut Building Automation Card for Raspberry Pi User Guide

June 9, 2024
The Pi Hut

BUILDING AUTOMATION Card for RASPBERRY Pi
USER’S GUIDE VERSION 4.1
SequentMicrosystems.com

GENERAL DESCRIPTION

The Pi Hut Building Automation Card for Raspberry Pi -
fig

The second generation of our Building Automation Card brings to the Raspberry Pi platform all the inputs and outputs required for Building Automation Systems. Stackable  to 8 levels, the card works with all Raspberry Pi versions, from Zero to 4.
Two of the Raspberry Pi’s GPIO pins are used for I2C communication. Another pin is allocated for the interrupt handler, leaving 23 GPIO pins available for the user.
Eight universal inputs, individually selectable, let you read 0-10V signals, count contact closures, or measure temperatures using 1K or 10K thermistors. Four 0-10V  programmable outputs can control light dimmers or other industrial devices. Four 24VAC triac outputs can control AC relays or heating and cooling equipment. LED  indicators show status of all outputs. An RS485/MODBUS port permit almost unlimited expandability. Last but not least, a new 1-WIRE port can be used to read the  temperature from DS18B20 sensor.
TVS diodes on all inputs protect the card for external ESD. Onboard resettable fuse protects it from accidental shorts. Single 24V AC or DC power source can supply 5V/3A for Raspberry Pi.

FEATURES

  • Eight jumper settable universal, analog/digital inputs
  • 0-10V Inputs or
  • Contact Closure Counter Inputs or
  • 1K/10K Temperature Sensor Inputs
  • Four 0-10V Outputs
  • Four TRIAC Outputs with 1A/48VAC drivers
  • Four General Purpose LED’s
  • RS485/MODBUS port
  • Real time clock with battery backup
  • On-board push-button
  • 1-WIRE interface
  • TVS protection on all inputs
  • On-board Hardware Watchdog
  • 24VAC/DC power supply

All inputs and output use pluggable connectors which permit easy wiring access when multiple cards are stacked. Up to eight Building Automation Cards can be stacked on  top of one Raspberry Pi. The cards share a serial I2C bus using only two of the Raspberry Pi’s GPIO pins to manage all eight cards.
The four general purpose LED’s can be associated with the analog inputs or other controlled processes.
An on-board push button can be programmed to cut inputs, override outputs or shut down the Raspberry Pi.

WHAT IS IN YOUR KIT

  1. Building Automation Card for Raspberry PiThe Pi Hut Building Automation Card for Raspberry Pi - Fig

  2. Mounting hardware a. Four M2.5x18mm male-female brass standoffs
    b. Four M2.5x5mm brass screws
    c. Four M2.5 brass nuts

  3. Two jumpers. You do not need the jumpers when using only one Building Automation Card. See STACK LEVEL JUMPERS section if you plan to use multiple cards.

  4. All the required female mating connectors.The Pi Hut Building Automation Card for Raspberry Pi - Fig3

QUICK START-UP GUIDE

  1. Plug your Building Automation Card on top of your Raspberry Pi and power up the system.

  2. Enable I2C communication on Raspberry Pi using raspi-config.

  3. Install the software from github.com:
    a. ~$ git clone https://github.com/SequentMicrosystems/megabas-rpi.git
    b. ~$ cd /home/pi/megabas-rpi
    c. ~/megabas-rpi$ sudo make install

  4. ~/megabas-rpi$ megabas
    The program will respond with a list of available commands.

BOARD LAYOUT

The Pi Hut Building Automation Card for Raspberry Pi - BOARD
LAYOUT

Four General Purpose LEDs can be controlled in software. The LEDs can be activated to show the status of any input, output or external process.

STACK LEVEL JUMPERS

The left three position of the connector J3 are used to select the stack level of the card:The Pi Hut Building Automation Card for Raspberry Pi -
Fig4

INPUT SELECTION JUMPERS

The eight universal inputs can be individually jumper selected to read 0-10V, 1K or 10K thermistors or contact closure/event counters. The maximum frequency of event counters is 100 Hz.

The Pi Hut Building Automation Card for Raspberry Pi -
Fig5

RS-485/MODBUS COMMUNICATION

The Building Automation Card contains a standard RS485 transceiver which can be accessed both by the local processor and by Raspberry Pi. The desired configuration is set  from three bypass jumpers on configuration connector J3.

If jumpers are installed, Raspberry Pi can communicate with any device with an RS485 interface. In this configuration the Building Automation Card is a passive bridge which  implements only the hardware levels required by the RS485 protocol. To use this configuration, you need to tell the local processor to release control of the RS485 bus:
~$ megabas [0] wcfgmb 0 0 0 0
If jumpers are removed, the card operates as MODBUS slave and implements the MODBUS RTU protocol. Any MODBUS master can access all the card’s inputs, and set all  the outputs using standard MODBUS commands. A detailed list of commands implemented can be found on GitHub:
https://github.com/SequentMicrosystems/megabas-rpi/blob/master/Modbus.md
In both configurations the local processor needs to be programmed to release (jumpers installed) or control (jumpers removed) the RS485 signals. See the command line  online help for further information.

RASPBERRY PI HEADER

The Pi Hut Building Automation Card for Raspberry Pi -
Fig7

POWER REQUIREMENTS

The Building Automation Card requires an external 24VDC/AC regulated power supply. Power is supplied to the board through the dedicated connector in the upper right  corner (see BOARD LAYOUT). The boards accepts either DC or AC power source. If a DC power source is used, polarity is not important. A local 5V regulator supplies up  to 3A power to Raspberry Pi, and a 3.3V regulator powers the digital circuits. Isolated DC-DC converters are used to power the relays.

WE RECOMMEND USING ONLY THE 24VDC/AC POWER SUPPLY
TO POWER THE RASPBERRY PI CARD
If multiple Building Automation Cards are stacked on top of each other, we recommend using a single 24VDC/AC power supply to power all the cards. The user must split  the cable and run the wires to each card.
POWER CONSUMPTION:
• 50 mA @ +24V

UNIVERSAL INPUTS

The Building Automation Card has eight universal inputs which can be jumper selected to measure 010V signals, 1K or 10K thermistors or contact closure/event counters up to 100Hz.The Pi Hut Building Automation Card for
Raspberry Pi - Fig8The Pi Hut Building
Automation Card for Raspberry Pi - Fig9

EVENT COUNTER/CONTACT CLOSURE CONFIGURATION The Pi Hut Building Automation
Card for Raspberry Pi - Fig10

TEMPERATURE MEASUREMENT CONFIGURATION WITH 1K THERMISTORS The Pi Hut
Building Automation Card for Raspberry Pi - Fig11

TEMPERATURE MEASUREMENT CONFIGURATION WITH 10K THERMISTORS

0-10V OUTPUTS CONFIGURATION. MAX LOAD = 10mA The Pi Hut Building Automation
Card for Raspberry Pi - Fig13

HARDWARE WATCHDOG

The Building Automation Card contains a built-in hardware watchdog which will guarantee that your mission-critical project will continue running even if Raspberry Pi  software hangs up. After power up the watchdog is disabled, and becomes active after it receives the first reset.
The default timeout is 120 seconds. Once activated, if it does not receive a reset from Raspberry Pi within 2 minutes, the watchdog cuts the power and restores it after 10 seconds.
Raspberry Pi needs to issue a reset command on the I2C port before the timer on the watchdog expires.
The timer period after power up and the active timer period can be set from the command line. The number of resets is stored in flash and can be accessed or cleared from  the command line. All the watchdog commands are described by the online help function.

ANALOG INPUTS/OUTPUTS CALIBRATION

All the analog inputs and outputs are calibrated at the factory, but firmware commands permit the user to re-calibrate the board, or to calibrate it to better precision. All  inputs and outputs are calibrated in two points; select the two points as close to possible to the two ends of scale. To calibrate the inputs, the user must provide analog signals.  (Example: to calibrate 0-10V inputs, the user must provide a 10V adjustable power supply). To calibrate the outputs, the user must issue a command to set the output  to a desired value, measure the result and issue the calibration command to store the value.
The values are stored in flash and the input curve is assumed to be linear. If a mistake is made during calibration by typing the wrong command, a RESET command can be  used to reset all the channels in the corresponding group to factory values. After RESET calibration can be restarted.
The board can be calibrated without a source of analog signals, by calibrating first the outputs and then routing the calibrated outputs to corresponding inputs. The following  commands are available for calibration:

CALIBRATE 0-10V INPUTS: megabas cuin
RESET CALIBRATION OF 0-10V INPUTS: megabas rcuin
CALIBRATE 10K INPUTS: megabas cresin
RESET 10K INPUTS: megabas rcresin
CALIBRATE 0-10V OUTPUTS: megabas cuout
STORE CALIBRATED VALUE IN FLASH: megabas alta_comanda
RESET CALIBRATION OF 0-10V OUTPUTS:| megabas rcuout

HARDWARE SPECIFICATIONS

ON BOARD RESETTABLE FUSE:  1A

0-10V INPUTS:

• Maximum Input Voltage: 12V
• Input Impedance: 20KΩ
• Resolution: 12 bits
• Sample rate: tbd

CONTAC CLOSURE INPUTS

  • Maximum count frequency: 100 Hz

0-10V OUTPUTS:

  • Minimum Output Load: 1KΩ
  • Resolution: 13 BITS

TRIAC OUTPUTS:

  • Maximum Output Current: 1A
  • Maximum Output Voltage: 120V

LINEARITY OVER FULL SCALE

Analog inputs are processed using 12 bit A/D converters internal to the on- board processor. The inputs are sampled at 675 Hz.
Analog outputs are PWM synthesized using 16 bit timers. PWM values range from 0 to 4,800.
All inputs and outputs are calibrated at test time at the end points and values are stored in flash.
After calibration we checked the linearity over full scale and obtained the following results:

Channel Max Error %
0-10V IN 15μV 0.15%
0-10V OUT 10μV 0.10%

MECHANICAL SPECIFICATIONS

The Pi Hut Building Automation Card for Raspberry Pi -
Fig14

SOFTWARE SETUP

  1. Have your Raspberry Pi ready with the latest OS.
  2. Enable I2C communication: ~$ sudo raspi-config
    1. Change User Password| Change password for default user
    ---|---
    2. Network Options| Configure network settings
    3. Boot Options| Configure options for start-up
    4. Localisation Options| Set up language and regional settings to match..
    5. Interfacing Options| Configure connections to peripherals
    6. Overclock| Configure overclocking for your Pi
    7. Advanced Options| Configure advanced settings
    8. Update| Update this tool to the latest version
    9. About raspi-config| Information about this configuration
    P1| Camera| Enable/Disable connection to the Raspberry Pi Camera
    ---|---|---
    P2| SSH| Enable/Disable remote command line access to your Pi
    P3| VNC| Enable/Disable graphical remote access to your Pi using…
    P4| SPI| Enable/Disable automatic loading of SPI kernel module
    P5| I2C| Enable/Disable automatic loading of I2C kernel module
    P6| Serial| Enable/Disable shell and kernel messages to the serial port
    P7| 1-Wire| Enable/Disable one-wire interface
    P8| Remote GPIO| Enable/Disable remote access to GPIO pins
  3. Install the megabas software from github.com: ~$ git clone https://github.com/SequentMicrosystems/megabas-rpi.git
  4. ~$ cd /home/pi/megabas-rpi
  5.  ~/megaioind-rpi$ sudo make install
  6. ~/megaioind-rpi$ megabas

The program will respond with a list of available commands.
Type “megabas -h” for online help.
After installing the software, you can update it to the latest version with the commands:
~$ cd /home/pi/megabas-rpi
~/megabas-rpi$ git pull
~/megabas-rpi$ sudo make install

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals