Intro to industrial control technology with PiXtend

In Control

The PiXtend extension board makes it easy to add analog I/O and PWM connections to the Raspberry Pi.

Thanks to its GPIO port, the Raspberry Pi (Rasp Pi) is suitable for industrial use, although the demands could easily push the small computer to its limits. The PiXtend board makes it possible to implement easily and conveniently small control and home automation projects that would otherwise be beyond the reach of the Rasp Pi GPIO pins.

PiXtend is a professional-grade extension board for the Rasp Pi that uses existing GPIO ports, along with an auxiliary microcontroller that adds additional functionality not otherwise available. The additional functionality includes features such as analog inputs and outputs.

In addition to the PiXtend board, the purchaser gets a cover for the top hat rails, which is used to mount the board. Thus, you have everything needed to use the board with a home circuit box. Software is also included, thus making it easy to use the board for home automation projects. Overall, this board has potential that has not yet been fully explored.

Hardware

The PiXtend board (Figure 1) comes in various configurations, ranging from the single board without components to a fully accessorized device. If you want to assemble the product by yourself, you will have to schedule some significant time to complete the process, because multiple components need to be attached to the board. All of the connections come with user-friendly spring mechanisms, thus saving you from the cumbersome task of screwing cables in manually.

Figure 1: A fully assembled PiXtend board.

LEDs display the current status of digital inputs and outputs. The relay outputs switch up to 6A at 230V. This corresponds to a switch performance of 1.3KW. Therefore, nothing stands in the way of switching devices that consume large amounts of power.

The board workmanship is very impressive, and an overview of the circuit diagram reinforces this first impression. Positive temperature coefficient (PTC) circuit protection devices protect the board from faulty operation. The advantage of these devices is that they are triggered thermically with large flows of electric current. As soon as the PTC device has cooled off, it allows the current to start flowing again, without interruption. These devices prevent components from being ruined by wiring mistakes. Moreover, the low-pass filters found on each of the outputs prevent the system from interpreting input disturbances as a signal.

All of the integrated circuits (ICs) sit on a socket, and each socket is easy to change out if a component is damaged. Generally speaking, all of the components used for the PiXtend board are also suitable for harsh conditions, such as those found in an industrial setting; this durability makes this particular Rasp Pi extension board ideal for use as a teaching aid in job training. The current PiXtend board was designed for the original Rasp Pi (models B and B+) and the Rasp Pi 2 Model B (RPi2B). The RPi2 is a good basis for the board because it has sufficient computing power to handle usage demands.

The PiXtend accepts working voltages of 12 to 24V. All of the voltage needed by the board and the Rasp Pi is generated by an efficient power supply that has only minimal energy loss; therefore, no unnecessary heat is produced. The PiXtend board carries the CE marking, an FCC label that signifies conformity with various safety regulations in the US, and also meets applicable safety directives of the European Union.

If the board is mounted in the cover provided by the manufacturer, you should take care to secure all of the jumpers beforehand and mount the flat ribbon cable on the Rasp Pi, as well. Once the cover is screwed together, these components are no longer accessible. To determine which jumper corresponds to which function, you should take a look at the PiXtend data sheet [1]. The Downloads page [2] contains all of the necessary diagrams for proper assembly of the board.

Table 1 provides an overview of the hardware found on the PiXtend. For more detailed information, you should look at the data sheet already mentioned.

Table 1

PiXtend Hardware

Digital inputs

8

Digital outputs

6

PWM/servo outputs

2

Relay outputs

4

Analog voltage inputs

2

Analog power inputs

2

Analog outputs

2

Serial interfaces

RS232, RS485, CAN 2.0B, I2C (see Table 2)

Other

Real-time clock (RTC) with battery buffer, support for up to four DHT11/DHT22 temperature and humidity sensors, 433MHz plug-in transceiver

Table 2

PiXtend Interfaces

Interface

Description

CAN

A serial bus system used primarily in the automobile industry. One of the biggest advantages of a CAN bus is that multiple vehicle functions can be controlled with a small number of copper wires, saving space, weight, and copper, which happens to be expensive.

RS232

A standard that has fallen out of favor in the PC world. On the other hand, this interface is frequently used in industry and particularly in the field of microcontrol technology. It governs the serial transmission of signals by the application of different voltage levels. In a basic configuration, the RXD, TXD, and GND lines suffice to transmit data in full duplex at data transmission rates from 300 to 115,200 baud, although speed decreases significantly with increased length of the cable.

RS485

Transfers data between several devices in a bus system. Although this interface describes the electrical properties of a serial data transmission, it does not define speed or transmission protocols. The thinking behind this approach was to achieve an uninterrupted transmission of information, which is accomplished by simultaneous transmission of an inverted and uninverted signal. This makes a connection significantly less vulnerable to interruption, with the possibility of higher data rates. An RS485 driver is often used to increase the transmission speed and range of the RS232 interface; however, other protocols, such as differential SCSI and bus systems having up to 32 participants, can be built with RS485.

I2C

A serial data bus developed for short-range communication, such as communication on a circuit board or inside devices. Data transmission occurs synchronously via two lines: SDA (data) and SCL (clock). Pull-up resistors pull both leads to a positive potential. The bus master always initiates communication. The bus has a 7-bit address field, which corresponds to 128 participants. The system reserves 16 addresses for itself, leaving 112 addresses free. The bus transmits data by byte or by word and achieves speeds of between 100Kbps bidirectionally in standard mode and 5Mbps unidirectionally in ultrafast mode.

PWM

Pulse width modulation, wherein the system generates a square wave with a constant frequency and only varies the ratio between pulse and pause times. Thus, with this method, precise adjustments can be made to the power output. Modern switching power supplies use a similar process, achieving effective rates of over 90%. A low-pass filter often ensures a clean direct current at the end of the PWM phase. Often the PWM technique is used with servomotors; the relationship between pulse and pause determines the angle of movement by the servo.

Software

Numerous software options are available for controlling the PiXtend module. One of these is Codesys, which lets you program the board like a commercial programmable logic controller (PLC), a digital device that can be digitally programmed to control or regulate a machine. The software is compatible with the IEC61131-3 standard supported by many of the well-known manufacturers of industrial control systems. The device directory [3] for Codesys confirms that this program is widely used.

If need be, you can use the WebVisu extension [4] to create conveniently an easy-to-follow visualization of the Codesys screens in a web browser (Figure 2). Other well-known manufacturers typically offer a Linux version of their software, or at the very least, they offer a platform-independent Java program in their portfolio.

Figure 2: The Codesys demo in the web browser.

Another possibility for controlling the PiXtend Board comes from the manufacturer in the form of the Pxdev (PiXtend development) package. Both the archive on the PiXtend homepage [2] and SourceForge [5] offer the software. Installation and operating instructions for the PiXtend Linux tools [6] have been tucked away in the "App-Notes" section. If you have a fast Internet connection and not much time, you can download a ready-to-go image for the Rasp Pi [7].

Pxdev lets you access the inputs and outputs on the PiXtend board via the Rasp Pi command line. Access begins with booting the Rasp Pi from the PiXtend image and opening the ~/pxdev/pixtendtool file. For an explanation of the program functions, you should start the tool from this directory with:

./pixtendtool -h

To start, you should test the relay outputs with the

./pixtendtool -rel 15

call. The dedicated LEDs for the four outputs should light up once the command is executed. As indicated in the detailed assistant, this simple test method lets you access all of the components on the PiXtend board. The command-line commands are available in all of the standard languages, and this multilingual feature enhances the flexibility of the PiXtend Board for use in projects.

In the ~/pxdev/pxauto folder, you'll find PiXtend Auto Tool (Figure 3), a small tool with a convenient text-based interface for selecting and setting values. The program proves to be very practical once the PiXtend board has been inserted into a control panel and the LEDs are no longer directly visible.

Figure 3: The straightforward Pxauto tool.

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Power to You

    Small-board computers (SBCs) are getting more and more powerful. The Raspberry Pi 3 (RPi3), which just came out in February of this year, is a case in point. This latest in the Rasp Pi line now has four cores running at 1200MHz with 1GB of RAM and on-board WiFi and Bluetooth. If you need even more power in a small computer, however, you are not left wanting. In this issue, we look at three SBCs with more cores, more memory, more ports, and more possibilities.