MCP3008 ADC Controller
Product Information
LK-Baseboard for Raspberry Pi B+ / Pi 2
The LK-Baseboard is designed to expand the functionality of your
Raspberry Pi B+ or Pi 2 by providing additional interfaces for
UART, I2C, analog inputs, and digital GPIO.
Specifications
- UART Pinout: 1- RXD, 2- TXD, 3- V+, 4- GND
- I2C Pinout: 1- SCL, 2- SDA, 3- V+, 4- GND
- Analog Inputs: A0-A7
- Digital GPIO: D4-D6, D12-D27
- ADC Controller: MCP3008 for analog input control
Product Usage Instructions
Installation of the Needed Modules
- Ensure you are using a Raspbian OS-Image (Debian Wheezy).
- Activate the SPI-Interface of the Raspberry Pi by accessing
“Advanced Options” in the configuration settings. - Accept the necessary prompts to enable SPI functionality.
- Reboot the Raspberry Pi after configuration changes.
- Load and install the required drivers and modules by executing
specific commands in the console.
Python Example for Using the MCP3008 ADC Controller
- Create a Python script named “testadc.py” with the provided
code snippet for measuring analog voltage levels. - Use the “readadc()” function with a specified channel (0-7) to
read the actual analog value. - Run the script to output values of all ADC channels either
simultaneously or individually.
FAQ
How do I control analog inputs through the MCP3008?
To control analog inputs through the MCP3008, follow the
provided Python example in the user manual by creating and running
the “testadc.py” script.
What should I do if I encounter issues with driver
installation?
If you face problems during driver installation, ensure that
your Raspberry Pi is connected to the internet and retry running
the installation commands.
LK-Baseboard for Raspberry Pi B+ / Pi 2
Dear customer, thank you for your purchase of our product. In the next few pages we’ve
described, what you’ll need to know for operating our product:
UART 1- RXD 2- TXD 3- V+ 4- GND
I2C 1- SCL 2- SDA 3- V+ 4- GND
Analog Inputs A0-A7
Digital GPIO D4-D6 D12-D27
Control the analog inputs through the MCP3008 1. Installation of the needed modules
We recommend to use an actual Raspbian OS-Image (Debian Wheezy). In our first step we’ve to activate the SPI-Interface of the Raspberry Pi, to make the communication with the ADC of the LK- Base board possible. For this, we’re starting with the following command: There will appear a new window, where we choose ,,Advanced Options”
Then we go on ,,A6 SPI”
The next two windows have to be accepted with “Yes” and “OK”
Also the next two ones…
Finally we go on “Finish” to close the Configuration Tool…
…and reboot the Raspberry Pi with the following command: After the Reboot, we’ve to load and install the needed Drivers and Modules. For this you
have to put the following commands in the console of the Raspberry Pi and confirm each with a Press on [Enter]. In this procedure the Raspberry Pi have to be connected to the Internet:
Also after this you have to reboot:
Python-Example for using the MCP3008 ADC Controller – testadc.py
The file ,,testadc.py” shows a way, how to measure analog voltage Level with a python script; with the function readadc() and a specified Channel (0-7) you can read out the actual value. Create a file with the name ,,testadc.py” and copy the script shown above in this file (please make sure, that you don’t miss any spaces). The script can now be used in two different ways: Output the values of all ADC-Channels simultaneously:
This command causes that the values of all ADC-Channels are read out and displayed every 1.5s.
Output of values from specific Channels: You can also read out the values from individual channels specify them with their channel
number directly after the command, separated with a spacer. In this example this would be the channels [3] und [7]
Documents / Resources
![]() |
Adafruit MCP3008 ADC Controller [pdf] User Guide MCP3008 ADC Controller, MCP3008, ADC Controller, Controller |