This project implements a thermometer to measure and log temperature. The initial implementation uses a graphical user interface on a display such as the Official Raspberry Pi 7" touchscreen. It measures temperature using an Adafruit RTD Sensor Amplifier to read a PT100 RTD.
This software uses a custom Raspberry Pi Hat to connect the temperature sensor to the Raspberry Pi. The schematic for the hat is documented using KiCAD; it is available for Linux, MacOS, and Windows. The KiCAD files are in a sub-folder named Temperature Logger Hat. Note that the circuit diagram is for an older RTD Sensor amplifier board; it has a different connector but uses the same amplifier chip.
-
Clone the project repository from github:
git clone https://github.com/jmgrady/rpi-thermometer -
Create a Python virtual environment
-
Install the required packages from
apt:sudo apt install python3-venv python3-pip sudo apt install --upgrade python3-setuptools
-
Create the virtual environment and install CircuitPython:
cd rpi-thermometerA reboot will probably be required when complete.
-
Synchronize the venv with the pinned drivers:
./update-venvIf
requirements.inhas been modified or to update the versions of the python dependencies, runupdate-venvwith thebuildoption. This will first updaterequirements.txtwith the new module requirements.
-
cd rpi-thermometer
. venv/bin/activate
cd app
./main.pyThere are two ways to install the software on a Raspberry Pi. The first method is to clone the repo on the host machine and use ansible to install the software on the Raspberry Pi. This is preferred if you plan to extend the project. The second method is to clone the repo to the Raspberry Pi and use ansible to install the software on localhost.
-
edit
hosts.ymlto include your target system(s). -
Run
. venv/bin/activate
ansible-playbook -i hosts.yml install-env.yaml --limit <hostname_of_rpi>
ansible-playbook -i hosts.yml install.yaml --limit <hostname_of_rpi>-
sshto your Raspberry Pi or from the console install the environment as described in Installing the Environment -
Run
. venv/bin/activate
ansible-playbook -i hosts.yml install-env.yaml --limit localhost
ansible-playbook -i hosts.yml install.yaml --limit localhost- If your Raspberry Pi requires a password for
sudo, add the-Koption to the command above.
The UI Layout was created using QtCreator. Use QtCreator to update the basic forms and widgets in the UI. If changes are made to any of the .ui files, update the UI Python files as follows:
cd <project_dir>
. venv/bin/activate
./generate_ui.shNow the project can be installed on a target system.