Print Friendly, PDF & Email

Difficulty level: Beginner

Approx reading time:

Components Required:

1. Raspberry Pi 3 model B

2. MicroSD card 8 or 16 GB (Class 4 and above) with Raspbian

3. Windows PC / Linux PC (Tested on Windows 10, Ubuntu 14.04 LTS)

4. Ethernet cable (Category 5 – also called Cat 5)

5. Micro USB cable

6. Breadboard

7. MCP3008 Analog to Digital Converter – 1

8. LM35 Temperature Sensor – 1

9. Jumper Wires (Male to Female, Male to Male)

Way to go ->

1. Login to your Pi using PuTTy or your Ubuntu terminal.

2. Login to your Pi GUI using VNC server (Linux / Windows).

3. In Python 3 (IDLE), create a new file.

4. The name could be:

5. In the file, write the following code with comments (line starting with “#”) for clear understanding and save (press Cntrl + S on your PC keyboard) the file.

Before running the python script do the following:

6. In the terminal type: sudo raspi-config and press Enter on your PC keyboard.

7. Go to Advanced Options.


8. Go to SPI.


9. Enable SPI Interface by clicking on <Yes>.


10. Reboot the Pi. In the terminal, type: sudo reboot

11. After it has rebooted, install Python 3 devlopment tools. In the terminal, type: 

12. Download this package. In the terminal type:

13. In the terminal type: ls to check that you have in your current working directory.

14. To unzip, in the terminal type: 

15. Remove 

16. Navigate to py-spidev-master directory(folder): 

17. Type in the terminal: ls, to view the contents of the directory(folder).

18. In the terminal run the command: 

19. Finally, run the script by clicking on Run -> Run Module in the menu bar or by pressing F5 on your PC keyboard.


Hardware Connections ->

1. Raspberry Pi 3 GPIO Header.


2. MCP3008 to Pi connections.


3. LM35 to Pi / MCP3008 connections.




Read full tutorial at

Rating widget: