Software development
All features of Iono Pi are easily accessible from any programming language or framework
by simply reading/writing the sysfs files created by the Kernel Module (see above).
Additionally:
A C language library, released as open source software under the LGPL license and free
to use also for commercial applications, is available on GitHub:
https://github.com/sfera-labs/iono-pi-c-lib
A simple Java library, released as open source software under the LGPL license and free
to use also for commercial applications, is also available on GitHub:
https://github.com/sfera-labs/iono-pi-java-lib
You can use the above mentioned resources to develop your application software, but you
can also write your low-level code in any language. All of Iono Pi’s digital input and output
pins are directly controlled using the corresponding GPIO lines from the Raspberry Pi
boards (see the “Input/Output mapping” table above).
Only the analog inputs are connected to an analog to digital converter chip, using the SPI
protocol.
Analog inputs notes
The AI1 and AI2 analog inputs on the terminal block, and the AI3 and AI4 pins on the on-
board analog inputs expansion header, are connected to a Microchip MCP3204 4-channel
12-Bit A/D converter. The MCP3204 is connected to the Raspberry Pi via the SPI interface.
AI1, AI2, AI3, and AI4 are respectively connected to channel 1, 0, 2, and 3.
The MCP3204 is a very well supported chip, particularly easy to use from software on the
Raspberry Pi.
The MCP3204 data sheet contains all the information you need to control the operations of
the A/D converter. You should also take into account the effects of the analog front-end
circuitry to convert the values read from the A/D converter to the actual voltage values.
Our libraries and utilities use a 0.007319 conversion factor for the A/D values
corresponding to the AI1 and AI2 inputs with a 0÷30V range, and 0
.
000725 for AI3 and AI4
inputs with a 0÷3V range.
The SPI clock speed is set to 50kHz. A significant increase in the clock speed will affect
the reliability of the A/D conversion.
26
Iono Pi User Guide