Arduino UNO Q - Temperature Sensor - LCD
Want to display live temperature readings on an LCD with your Arduino UNO Q — and get Telegram alerts when it gets too hot? This tutorial combines the DS18B20 temperature sensor with an I2C LCD to create a complete temperature monitoring station.
In this tutorial, you will learn:
- How to wire the DS18B20 sensor and LCD I2C display to the Arduino UNO Q MCU
- How to program the MCU (C/C++ Arduino code) to read temperature and display it on the LCD
- How to program both the Linux side (Python) and MCU side (C/C++) to monitor temperature via Bridge
- How to receive Telegram alerts when temperature exceeds a threshold on Arduino UNO Q
- How to use OpenClaw on Arduino UNO Q with the temperature sensor and LCD

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Buy Note: Many DS18B20 sensors available in the market are unreliable. We strongly recommend buying the sensor from the DIYables brand using the link provided above. We tested it, and it worked reliably.
Buy Note: Alternatively, you can assemble the LCD I2C display using LCD 1602 Display and PCF8574 I2C Adapter Module.
Overview of the Temperature Sensor and LCD
If you are new to the DS18B20 sensor or I2C LCD display, check these tutorials first:
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
DS18B20 connections:
| DS18B20 Pin | Arduino UNO Q MCU |
|---|---|
| GND | GND |
| VCC | 3.3V or 5V |
| DATA | D4 |
LCD I2C connections:
| LCD I2C Pin | Arduino UNO Q MCU |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | A4 |
| SCL | A5 |
Arduino UNO Q Code
The Arduino UNO Q has two processors working together:
- The STM32 MCU reads the DS18B20 sensor and drives the LCD directly
- The Qualcomm MPU runs Debian Linux and handles Wi-Fi, Python, and cloud connectivity
- In this section, only the MCU is programmed — the Linux side stays idle. A later section shows how both processors work together via Bridge.
The MCU reads temperature every second and updates both the LCD display and the Serial Monitor.
※ NOTE THAT:
The I2C address for the LCD might change depending on the maker. In this code, we used 0x27, which is the address given by the manufacturer DIYables.
Detailed Instructions
First time with Arduino UNO Q? Follow the Getting Started with Arduino UNO Q tutorial before proceeding.
- Connect: Wire the DS18B20 sensor and LCD I2C to the Arduino UNO Q MCU as shown in the wiring diagram above.
- Open Arduino App Lab: Launch Arduino App Lab and wait until it detects your Arduino UNO Q.
- Create a new App: Click the Create New App button.

- Give the App a name, for example: TemperatureSensorLcd
- Click Create to confirm.

- Paste the sketch: Copy the MCU code above and paste it into sketch/sketch.ino. Keep other files as default.
- Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.

- Search for DallasTemperature created by Miles Burton
, Tim Newsome , Guil Barros , Rob Tillaart and click the Install button.
- Search for OneWire created by Jim Studt, Tom Pollard, Robin James, Glenn Trewitt, Jason Dangel, Guillermo Lovato, Paul Stoffregen, Scott Roberts, Bertrik Sikken, Mark Tillotson, Ken Butcher, Roger Clark, Love Nystrom and click the Install button.
- Search for DIYables LCD I2C created by DIYables.io and click the Install button.
- Upload: Click the Run button in Arduino App Lab.

- Hold the sensor in your hand or place it in hot/cold water — watch the temperature update on the LCD.
If the LCD shows nothing, check Troubleshooting for LCD I2C for help.
App Lab Console Output
Bridge: Linux + MCU
This section shows how to program both processors of the Arduino UNO Q so the Linux side can monitor temperature remotely via Bridge:
- The DS18B20 sensor and LCD are both connected to the MCU (STM32) — the MCU reads temperature every second and updates the LCD display automatically
- The MPU cannot access the sensor or LCD directly — it must call Bridge functions to retrieve temperature readings or clear the LCD
- The MPU has Wi-Fi — running full Debian Linux, it can log readings, publish to dashboards, or send alerts over the Internet
- Arduino_RouterBridge enables RPC communication between the two processors
- ⚠️ /dev/ttyHS1 (Linux) and Serial1 (MCU) are RESERVED by the router — never open them in user code
In short: MCU reads sensor every second and updates LCD → MPU reads temperature via Bridge → MPU publishes, logs, or alerts over Wi-Fi.
MCU Code (Bridge)
Python Code (Bridge)
Detailed Instructions
- Connect: Wire the DS18B20 sensor and LCD I2C to the Arduino UNO Q as shown in the wiring diagram.
- Open Arduino App Lab: Launch Arduino App Lab and wait for the board to be detected.
- Create a new App: Click Create New App, name it TemperatureSensorLcdBridge, then click Create.
- Paste the MCU sketch: Copy the MCU Bridge code above and paste it into sketch/sketch.ino.
- Paste the Python code: Copy the Python Bridge code above and paste it into the Python file in the App.
- Upload: Click the Run button in Arduino App Lab.

- Watch the temperature readings appear in the Python console while the LCD updates automatically.
App Lab Console Output
Telegram
Monitor temperature remotely and receive automatic Telegram alerts when temperature rises above 35°C.
MCU sketch: Keep the same MCU sketch from the previous Bridge section.
Python Code (Telegram)
Detailed Instructions
- Replace YOUR_TELEGRAM_BOT_TOKEN with your actual bot token from BotFather.
- Replace YOUR_CHAT_ID with your Telegram chat ID.
- Paste this Python code into your App's Python file (keep the same MCU sketch).
- Click the Run button. Send /temp from Telegram or hold the sensor to trigger a high-temperature alert.
App Lab Console Output
ArduinoBot
OpenClaw
...OPENCLAW
OpenClaw support for Arduino UNO Q Temperature Sensor and LCD is coming soon.
...OPENCLAW
Project Ideas
You can build many useful projects combining the temperature sensor and LCD with Arduino UNO Q:
- Smart Thermometer: A standalone LCD thermometer that automatically switches between Celsius and Fahrenheit every 5 seconds — perfect for a desk or lab
- Temperature Logger with Display: The MCU shows live temperature on the LCD while the Linux MPU logs readings to a file every minute with timestamps
- Greenhouse Controller: Use the temperature reading to control a relay fan — LCD shows current status, and Telegram receives alerts when temperature goes out of range
- Remote Temperature Station: The MPU publishes temperature to an MQTT broker every 30 seconds; the LCD always shows the current local reading while remote dashboards track history
- Two-Zone Thermometer: Connect two DS18B20 sensors on the same 1-Wire bus and display each sensor's reading on a separate LCD row, labeled "Zone A" and "Zone B"
Challenge Yourself
Ready to go further with the temperature sensor and LCD on Arduino UNO Q? Try these challenges:
- Easy: Modify the MCU sketch so the second LCD row shows a custom message — "HOT!" if temperature is above 35°C, "COLD!" if below 10°C, or "NORMAL" otherwise.
- Medium: Add a set_label(String) Bridge function that lets the Python side write a custom label on the second LCD row (e.g., the location name like "Office" or "Server Room"), while the first row continues showing temperature.
- Advanced: Build a temperature history chart: the Linux MPU reads temperature every 10 seconds for 10 minutes, stores the values, and on /report sends the min, max, and average to Telegram, along with a simple ASCII graph showing the trend.