Analog to Digital Converter
Piunora has an on-board analog to digital converter (ADC) so you can read analog voltages in f.e. Python (see the Getting to Blinky guide) and other programming languages. It is connected via a dedicated SPI bus.
The ADC is a MCP3008 and is connected to the CM in the following way:
- SPI bus #5
- MOSI/DIN: GPIO14
- MISO/DOUT: GPIO13
- SCLK/CLK: GPIO15
- CS/SHDN: GPIO24
You can use the Blinka/Python example we provide (see Getting to Blinky guide) or use a different programming language. There are drivers for:
- C/C++ (untested, you should probably talk to the Linux universal SPI driver instead)
- JavaScript
- Go
- Rust (depends on rpi_embedded)
You can also use the built-in Linux IIO driver to use the ADC from within Kernel features. https://github.com/torvalds/linux/blob/master/drivers/iio/adc/mcp320x.c
There are also many more options our there that are not covered here.
Last modified March 31, 2025