Arduino UNO Q - LM35 Temperature Sensor
The LM35 is a simple analog temperature sensor that outputs a voltage proportional to temperature. On Arduino UNO Q, the MCU's 12-bit ADC delivers higher precision than standard 10-bit boards. This tutorial shows you how to wire and program the LM35 — and monitor it remotely via Telegram.
In this tutorial, you will learn:
- What the LM35 temperature sensor is and how it works
- How to wire the LM35 to the Arduino UNO Q MCU analog pin
- How to program the MCU (C/C++ Arduino code) to read temperature from the LM35 using 12-bit ADC
- How to program both the Linux side (Python) and MCU side (C/C++) to read LM35 data 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 LM35 sensor

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 .
Overview of the LM35 Temperature Sensor
Pinout
The LM35 has three pins:
- GND: Connect to GND (0V)
- VCC: Connect to 5V (the LM35 requires at least 4V supply)
- OUT: Analog output — connect to an analog pin on the Arduino UNO Q MCU

How It Works
The LM35 outputs a voltage that increases linearly with temperature: each 1°C rise increases the output by 10mV. To read temperature, measure the output voltage and divide by 10.
On Arduino UNO Q, the MCU (STM32U585) uses a 12-bit ADC (values 0–4095) with a 3.3V reference. This gives better resolution than standard 10-bit Arduino boards.
Wiring Diagram

This image is created using Fritzing. Click to enlarge image
| LM35 Pin | Arduino UNO Q MCU |
|---|---|
| GND | GND |
| VCC | 5V |
| OUT | A0 |
※ NOTE THAT:
Connect LM35 VCC to the 5V pin, not 3.3V — the LM35 requires at least 4V to operate. The analog output will still be within the 3.3V ADC range of the MCU.
How To Program For LM35
- Read the ADC value from the analog pin:
- Convert ADC value to voltage in millivolts (using 3.3V reference and 12-bit resolution):
- Convert millivolts to Celsius:
- Convert Celsius to Fahrenheit:
Arduino UNO Q Code
The Arduino UNO Q has two processors working together:
- The STM32 MCU reads the LM35 analog output directly via its 12-bit ADC — all sensor reading and conversion runs on the MCU
- 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 the LM35 every second and prints temperature to the Serial Monitor.
Detailed Instructions
First time with Arduino UNO Q? Follow the Getting Started with Arduino UNO Q tutorial before proceeding.
- Connect: Wire the LM35 sensor to the Arduino UNO Q MCU as shown in the wiring diagram.
- 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: Lm35TemperatureSensor
- Click Create to confirm.

- Paste the sketch: Copy the MCU code above and paste it into sketch/sketch.ino. Keep other files as default.
- No library required — the LM35 uses only the built-in analogRead() function.
- Upload: Click the Run button in Arduino App Lab.

- Hold the sensor in your hand — watch the temperature rise in the console.
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 read LM35 temperature via Bridge:
- The LM35 sensor is connected to the MCU (STM32) analog pin — the MCU reads and converts the ADC value every second
- The MPU cannot access the analog pin directly — it must call Bridge functions to retrieve readings
- The MPU has Wi-Fi — running full Debian Linux, it can log data, 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 LM35 every second via 12-bit ADC → MPU reads temperature via Bridge → MPU publishes or alerts over Wi-Fi.
MCU Code (Bridge)
Python Code (Bridge)
Detailed Instructions
- Connect: Wire the LM35 sensor 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 Lm35TemperatureSensorBridge, 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.
- Install the library: Click the Add sketch library button (the open book icon with a + sign) in the left sidebar.

- Search for Arduino_RouterBridge created by Arduino and click the Install button.
- Upload: Click the Run button in Arduino App Lab.

- Watch temperature readings appear in the Python console every second.
App Lab Console Output
Telegram
Monitor LM35 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 the high-temperature alert.
App Lab Console Output
ArduinoBot
OpenClaw
...OPENCLAW
OpenClaw support for Arduino UNO Q LM35 Temperature Sensor is coming soon.
...OPENCLAW
Project Ideas
You can build many useful projects with the LM35 and Arduino UNO Q:
- Analog Temperature Monitor: The LM35's continuous analog output and the MCU's 12-bit ADC give smooth, high-resolution readings — log every second and identify micro-temperature trends
- Overheating Protector: Use the LM35 to monitor a device (motor, circuit) — the MCU triggers a relay via Bridge when temperature exceeds a safe limit, and Telegram notifies you
- Multi-Zone Temperature Survey: Connect multiple LM35 sensors to different analog pins — the Python side queries each via Bridge and displays a side-by-side temperature comparison
- Calibrated Thermometer: Use the LM35's factory accuracy (±0.5°C) to build a precise digital thermometer with Telegram commands for on-demand readings
- Temperature-Based Fan Speed Controller: Map the LM35 ADC reading directly to a PWM output value on the MCU to control fan speed — the Python side can monitor the fan duty cycle via Bridge
Challenge Yourself
Ready to go further with the LM35 on Arduino UNO Q? Try these challenges:
- Easy: Add a moving average filter in the MCU sketch that averages the last 10 ADC readings before computing temperature — this reduces noise in the output.
- Medium: Compare LM35 and DS18B20 readings side by side: connect both sensors and add a compare_sensors(String) Bridge function that returns both readings in a single response for easy comparison.
- Advanced: Build a calibration tool: take 100 LM35 readings over 10 seconds, compute mean and standard deviation, and return them as a JSON string via a get_stats(String) Bridge function — Python displays and logs the calibration results.