Build a ThingSpeak Temperature Monitor with Raspberry Pi & BrickPi
Prerequisites
- Raspberry Pi (any model with Wi‑Fi or Ethernet)
- BrickPi 2 (or BrickPi 3) expansion board
- 9 V battery or a regulated power supply to run the BrickPi and sensor
- Dexter Industries thermometer (or any compatible temperature sensor)
Step 1: Sign Up for ThingSpeak
Visit ThingSpeak.com and create a new account. If you already have one, log in.
Step 2: Create a New Channel
Once logged in, click the Channels icon. Press Create New Channel to start a fresh data stream.
Step 3: Configure Your Channel
- Name: Enter a descriptive project title, e.g., “Pi‑BrickPi Temp Log”.
- Field 1: Label the field “Temperature”. Only one field is needed because we’re logging a single sensor.
- Leave the remaining fields blank.
After editing, click Update Channel to save your settings.
Step 4: Retrieve the API Key
Navigate to the API Keys tab of your channel. Copy the value displayed under API_KEY. This key authenticates your Raspberry Pi when sending data.
Step 5: Verify the Graph (Optional)
Open the Private View tab to see the channel’s graph. At this point, no data will appear until the Python script starts running.
Step 6: Prepare Your Raspberry Pi
Clone the BrickPi Python repository and install its dependencies:
git clone https://github.com/DexterInd/BrickPi_Python.git cd BrickPi_Python sudo apt-get update sudo apt-get install python-setuptools sudo python setup.py install
Step 7: Edit the Example Script
Open the file Thermometer_Thingspeak.py located in /BrickPi_Python/Project_Examples/Thingspeak_Temperature_Logging. Replace the placeholder API key:
"key": "N71BQXDNFTABINT7"
with the API key you copied earlier. Save the file.
Step 8: Run the Script
Execute the script from the same directory:
sudo python Thermometer_Thingspeak.py
When the script runs, it will read the temperature sensor and POST the data to your ThingSpeak channel every few seconds. Check the Private View tab to confirm data appears in real time.
Step 9: Expand Your Setup (Optional)
- Configure the Raspberry Pi to start the script automatically on boot using
cronorsystemd. - Add additional sensors and fields to the channel if you want to log humidity, pressure, or other metrics.
With this setup, you now have a reliable, cloud‑connected temperature monitor that can be accessed from any device via ThingSpeak’s web interface or API.
Manufacturing process
- Raspberry Pi Temperature & Humidity Network Monitor – DIY Setup Guide
- How to Read Temperature with a DS18B20 on Raspberry Pi 2
- Professional Raspberry Pi Temperature Monitoring with DS18B20
- Measuring Temperature on Raspberry Pi with Maxim 1‑Wire Sensors and DS2482 I2C Bridge
- TMP006 Infrared Temperature Sensor with Raspberry Pi: Python Library & Setup Guide
- Build a Remote Temperature Sensor with Raspberry Pi and Python – Step‑by‑Step Guide
- Accurate Temperature Monitoring in a Server Closet with Raspberry Pi
- Monitor Your Home Temperature with a Raspberry Pi Dashboard
- Build a Raspberry Pi Home Temperature Monitor with MCP9808, InfluxDB & Grafana
- Build a Robot with Raspberry Pi and Python: A Complete Guide