In this project, we will create an IoT data logger using a Raspberry Pi and the MAX6675 thermocouple temperature sensor. This guide will walk you through setting up the hardware, configuring the software, and logging temperature data to a CSV file. The data will be accessible remotely, making it perfect for monitoring environments like greenhouses, server rooms, or home labs
Equipment Needed
- Raspberry Pi (any model with GPIO pins)
- MAX6675 thermocouple sensor
- Breadboard and jumper wires
- SD card (with Raspbian installed)
- Power supply for Raspberry Pi
- Internet connection
Software Requirement
- Raspbian OS (latest version)
- Python 3
- Adafruit MAX6675 library
- Git
Setting up Raspberry Pi
.sh
sudo apt update
sudo apt upgrade
-Enable SPI on Raspberry Pi:
.sh
sudo raspi-config
-Navigate to Interface options :
- Select Interface Options.
- Select SPI.
Choose Yes to enable SPI.
-Reboot your raspberry pi
.sh
sudo reboot
-Verify SPI Device
.sh
ls /dev/spidev0.*
-Install Python and Required Libraries
.sh
sudo apt install python3 python3-pip
pip3 install Adafruit_GPIO Adafruit_MCP3008
sudo apt update
sudo apt install -y python3-pip python3-dev
sudo pip3 install --upgrade setuptools
sudo pip3 install adafruit-blinka
sudo pip3 install adafruit-circuitpython-max31855
sudo pip3 install adafruit-circuitpython-max6675
Hardware Setup
-Connect the Max6675 Sensore
VCC (3.3V) to 3.3V Pin on the Raspberry Pi (Pin 1)
GND to Ground Pin on the Raspberry Pi (Pin 6)
DO (Data Out) to MISO (GPIO 9, Pin 21)
CS (Chip Select) to GPIO 5 (Pin 29)
CLK (Clock) to SCLK (GPIO 11, Pin 23)
– Ensure Consistent Indentation
In most editors, you can convert tabs to spaces automatically.
Set your editor to use spaces instead of tabs (usually found in the settings/preferences)
– Create Script:
.sh
nano max6675_data_logger.py
– Add script content
Click to Download the Python script “Consider the directories “
-Make Script Executable:
.sh
chmod +x max6675_data_logger.py
-Adjust Permissions if Necessary
.sh
chmod 755 /home/the directory where you store your python script/
-Set Write Permissions:
.sh
sudo chmod 666 /home/your directory/data_log.csv
-Run the Script Manually
.sh
python3 /home/yor directory/max6675_data_logger.py
-Check data_log.csv for Entries:
.sh
cat /home/your directory/data_log.csv
-If the MAX6675 sensor is giving inaccurate readings.
–Verify the connection by double-checking all wiring connections to ensure they are correct and secure.
–Ensure the thermocouple tip is exposed to the air and not touching any hot components.
–Ensure the sensor wires are not running parallel to power lines, which can introduce noise.
-Automate Script with Crontab
.sh
crontab -e
@reboot python3 /home/yourdirectory/max6675_data_logger.py &
-Automate Script with Crontab
To access the logged data remotely, you can set up a web server on your Raspberry Pi or use a cloud storage service to sync the CSV file.
-Access Data Remotely
To access the logged data remotely, you can set up a web server on your Raspberry Pi or use a cloud storage service to sync the CSV file. To set up cloud storage and sync the CSV file visit set up Google Drive using ‘rclone’

-Proteus Configuration
Download the Raspberry Pi library files, please VISIT THE ENGINEERING PROJECTS
Note: this Rpi3 board in Proteus won’t read the Python code. We can only upload Arduino code to it

Click here to Download the .pdsprj Proteus file
Zip password : hussamalhayek.com
-Conclusion
This project demonstrates building a simple yet effective IoT data logger using Raspberry Pi and the MAX6675 sensor, you can also monitor and log temperature data for various applications. The Python code and detailed instructions are available on GitHub.

Integrating these elements can significantly enhance the capabilities of a simple IoT system, ensuring continuous monitoring and data collection for a wide range of potential applications.