- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
A project comparing temperature accuracy between an LM35 analog sensor and a BMP180 barometric sensor, with pressure/altitude measurements.
Early Conclusion:
? You can find the full source code here:
? Project Overview
This project compares:
Key Findings:
LM35 Temperature Sensor
BMP180 Pinout
LM35 Pinout
Wiring Diagram
Circuit Setup:
My Wiring
? Code Explanation
The Arduino code:
Key Libraries:
Sensor Data:
LM35 Temperature: 24.44 °C
BMP180 Temperature: 26.10 °C
Temperature Difference (BMP-LM35): 1.66 °C
BMP180 Pressure: 879.85 hPa
BMP180 Altitude: 1174.28 meters
? Observations & Analysis
I wrote most of this blog by myself and a little help of AI. Thanks!
Early Conclusion:
- LM35 is more accurate for temperature.
- BMP180 is not accurate as LM35 is, but provides pressure/altitude measurements. I've also tested DHT11 sensor previously and i can tell you that LM35 is so better and more accurate than DHT11, but if you want humidity beside temperature and price is not matter for your project, DHT22 is a better choice.
? You can find the full source code here:
? Project Overview
This project compares:
- LM35 (analog temperature sensor)
- BMP180 (digital barometric sensor for temperature, pressure, and altitude)
Key Findings:
- The LM35 is more accurate for temperature (~24.44°C vs room thermometer: 24°C).
- The BMP180 reads slightly higher (~26.10°C) due to internal heat but provides useful pressure/altitude data.
LM35 Temperature Sensor
- Principle: Linear analog output (10mV/°C).
- Accuracy: ±0.5°C at 25°C.
- No calibration needed – directly outputs Celsius.
- Formula: Temp (°C) = (ADC Reading × 500) / 1023
- Pros: Simple, low-cost, reliable.
- Cons: Only measures temperature.
- Measures:
- Temperature (°C)
- Pressure (hPa)
- Altitude (meters, derived from pressure)
- Interface: I²C (SDA: A4, SCL: A5 on Arduino Uno).
- How it calculates altitude: Altitude = 44330 × (1 − (P/P₀)^(1/5.255)) Where:
- P = Measured pressure
- P₀ = Sea-level pressure (1013.25 hPa default)
- Pros: Multi-functional (pressure/altitude).
- Cons: Temperature may drift due to internal heat.
BMP180 Pinout
LM35 Pinout
Wiring Diagram
| Sensor | Arduino Uno Pin |
|---|---|
| LM35 | A0 (Analog) |
| BMP180 | I²C (SDA:A4, SCL:A5) |
Circuit Setup:
- LM35:
- VCC → 5V
- GND → GND
- OUT → A0
- BMP180:
- VCC → 3.3V or 5V
- GND → GND
- SCL → A5
- SDA → A4
My Wiring
? Code Explanation
The Arduino code:
- Reads LM35 (analog voltage → temperature).
- Reads BMP180 (temperature, pressure, altitude).
- Calculates the difference between the two sensors.
- Prints data to Serial Monitor every 10 seconds.
Key Libraries:
- Wire.h (I²C communication)
- Adafruit_BMP085.h (BMP180 sensor driver)
Sensor Data:
LM35 Temperature: 24.44 °C
BMP180 Temperature: 26.10 °C
Temperature Difference (BMP-LM35): 1.66 °C
BMP180 Pressure: 879.85 hPa
BMP180 Altitude: 1174.28 meters
? Observations & Analysis
- Temperature Difference (1.66°C):
- BMP180 tends to read higher due to internal heat from pressure sensing.
- LM35 is more reliable for ambient temperature.
- Pressure & Altitude:
- Lower pressure (879.85 hPa) indicates higher altitude (1174m).
- Useful for weather tracking or elevation-based projects.
I wrote most of this blog by myself and a little help of AI. Thanks!