- ✓ What temperature offset calibration is and why it matters
- ✓ Step-by-step calibration using ice water (0°C reference)
- ✓ Step-by-step calibration using boiling water (100°C reference with altitude adjustment)
- ✓ Using a reference thermometer for single-point calibration
- ✓ How to enter and save offset values in OceanRemote dashboard
- ✓ When to re-calibrate and how offsets persist across reboots
What is Temperature Offset Calibration?
Temperature offset calibration is a simple but powerful feature in OceanRemote that lets you adjust your sensor readings by adding or subtracting a fixed value.
The Formula:
Calibrated Temperature = Raw Sensor Reading + Offset
Where:
- Raw Sensor Reading = The actual temperature from DHT22, DS18B20, or NTC
- Offset = Your calibration value (can be positive or negative)
- Calibrated Temperature = What displays in your dashboard
| Sensor Type | Specified Accuracy | Typical Uncalibrated Error |
|---|---|---|
| DS18B20 | ±0.5°C | ±0.3°C to ±0.8°C |
| DHT22 | ±0.5°C | ±0.5°C to ±1.0°C |
| NTC Thermistor | ±1% to ±5% resistance | ±1°C to ±3°C |
A 1°C error might not matter for room temperature (22°C vs 23°C). But for a refrigerator (4°C vs 5°C), aquarium (24°C vs 26°C), fermentation (18°C vs 20°C), or medical storage (2°C vs 3°C), that error is critical. Calibration fixes this!
Where to Find the Offset Field
In your OceanRemote dashboard, each device with a temperature sensor has a dedicated temperature card:
┌─────────────────────────────────────────────────┐ │ 🌡️ CALIBRATED TEMPERATURE │ │ │ │ 23.5 °C │ │ │ │ [ -0.5 ] Calibration Offset (±°C) │ └─────────────────────────────────────────────────┘ What each part means: - Large number (23.5°C) = Calibrated temperature (raw + offset) - Input field [-0.5] = Your offset value - Changes save immediately to the server
When you save an offset, OceanRemote stores it in the database. The offset is applied server-side every time you view the dashboard. This means:
- ✓ You don't need to re-flash your device to change calibration
- ✓ The offset survives device reboots, power cycles, and firmware updates
- ✓ You can change offset from any device (phone, computer, tablet)
- ✓ The raw sensor value is still stored and visible in device details
Method 1: Ice Water Calibration (0°C Reference)
This is the most accurate and reliable calibration method because 0°C is easy to create and maintain.
What You Need:
- Crushed ice (not large cubes - more surface area = better temperature uniformity)
- Distilled water (tap water works but distilled is more accurate)
- Insulated container (thermos, foam cup, or insulated mug)
- Your temperature sensor (DHT22, DS18B20, or NTC)
- Stirring utensil (spoon or stick)
Step-by-Step Procedure:
- Fill container with crushed ice: About 75% ice, 25% water. Don't use too much water - the mixture should be mostly ice.
- Add cold water: Just enough to fill the gaps between ice pieces. Use refrigerated water, not room temperature.
- Wait 5 minutes: Let the mixture reach thermal equilibrium. The ice-water mixture will stabilize at exactly 0°C.
- Stir constantly: Ice water can have temperature gradients. Stirring ensures uniform 0°C throughout.
- Submerge your sensor: Make sure the sensing element is fully in the ice/water mixture. Do not let it touch the container walls.
- Wait 2-3 minutes: Let the sensor stabilize to the ice water temperature.
- Read the raw temperature: Look at your OceanRemote dashboard or open the Serial Monitor (115200 baud).
- Calculate offset: Offset = 0°C - Raw Reading
- Enter offset: Type the calculated value in the Calibration Offset field.
Example Ice Water Calibration: Step 1: Submerge sensor in ice water Step 2: Wait 3 minutes for stabilization Step 3: Read raw temperature from dashboard: 0.8°C Step 4: Calculate offset: 0 - 0.8 = -0.8 Step 5: Enter -0.8 in calibration field Result: Calibrated = 0.8 + (-0.8) = 0.0°C ✓ Your sensor now reads exactly 0°C in ice water!
- Use crushed ice, not cubes: Cubes have less surface area and create uneven temperature. Crush ice with a hammer or blender.
- Don't use salt: Salt lowers the freezing point below 0°C, ruining your calibration.
- Keep stirring: Without stirring, the water near the sensor can warm above 0°C. Stir continuously for 1-2 minutes before reading.
- Avoid touching container walls: Plastic or glass containers aren't at 0°C on the inside surface. Keep sensor in the center.
- Wait for stabilization: The sensor needs time to cool down from room temperature. Don't rush!
- Add more ice as it melts: If ice melts completely, temperature will rise above 0°C.
Method 2: Boiling Water Calibration (100°C Reference)
Boiling water is exactly 100°C at sea level. At higher altitudes, the boiling point is lower, so you need to adjust.
Boiling Point by Altitude:
| Altitude | Boiling Point (°C) | Example Location |
|---|---|---|
| Sea Level (0m / 0ft) | 100.0°C | New York, London, Tokyo, Sydney |
| 500m (1,640 ft) | 98.3°C | Denver is 1,600m - see below |
| 1,000m (3,280 ft) | 96.7°C | Albuquerque, New Mexico |
| 1,500m (4,920 ft) | 95.0°C | Calgary, Canada; Salt Lake City |
| 1,600m (5,250 ft) | 94.7°C | Denver, Colorado |
| 2,000m (6,560 ft) | 93.3°C | Mexico City, Mexico |
| 3,000m (9,840 ft) | 90.0°C | La Paz, Bolivia |
Step-by-Step Procedure:
- Find your altitude: Check your phone's GPS or use an online altitude finder.
- Determine boiling point: Use the table above or formula: BP(°C) = 100 - (Altitude in meters / 285)
- Boil distilled water: Use a clean pot. Tap water minerals can affect readings slightly.
- Maintain a rolling boil: Gentle bubbles aren't enough - needs vigorous, rolling boil.
- Submerge your sensor: ⚠️ ONLY waterproof sensors! Encapsulated DS18B20 is safe. DHT22 and bare NTC will be destroyed.
- Wait 2-3 minutes: Let sensor stabilize at boiling temperature.
- Read raw temperature: Look at your dashboard or Serial Monitor.
- Calculate offset: Offset = Boiling Point at your altitude - Raw Reading
- Enter offset: Type the calculated value in the calibration field.
Example Boiling Water Calibration (Sea Level): Altitude: 0m (sea level) Boiling point: 100.0°C Raw reading from sensor: 99.2°C Offset = 100.0 - 99.2 = +0.8 Enter +0.8 in calibration field. Result: Calibrated = 99.2 + 0.8 = 100.0°C ✓ Example Boiling Water Calibration (Denver, 1,600m): Altitude: 1,600m Boiling point: 94.7°C Raw reading from sensor: 94.0°C Offset = 94.7 - 94.0 = +0.7 Enter +0.7 in calibration field.
Boiling water is extremely dangerous! Use caution, wear protective gloves, and keep children away. Only submerge waterproof sensors (encapsulated DS18B20 in stainless steel probe). DHT22 and bare NTC sensors are NOT waterproof and will be permanently destroyed in boiling water.
Method 3: Reference Thermometer Calibration
This is the easiest method if you have a known-accurate reference thermometer.
What You Need:
- A known-accurate reference thermometer
- Stable temperature environment (room temperature works fine)
Choosing a Reference Thermometer:
| Thermometer Type | Accuracy | Recommendation |
|---|---|---|
| Certified lab thermometer | ±0.1°C | ✅ Best (but expensive) |
| Medical fever thermometer | ±0.2°C | ✅ Good, widely available |
| High-quality digital kitchen thermometer | ±0.5°C | ✅ Acceptable |
| Cheap analog dial thermometer | ±2-3°C | ❌ Avoid - too inaccurate |
| IR gun thermometer | ±2°C (surface only) | ❌ Avoid - measures surface, not air |
Step-by-Step Procedure:
- Place sensors together: Put your reference thermometer right next to your OceanRemote sensor. They should be touching or within 1cm.
- Avoid heat sources: Keep both sensors away from sunlight, vents, electronics, and your body heat.
- Wait 10-15 minutes: Let both sensors stabilize to the same temperature.
- Read both temperatures: Note your reference value and the raw OceanRemote reading.
- Calculate offset: Offset = Reference Temperature - Raw Reading
- Enter offset: Type the calculated value in the calibration field.
Example Reference Thermometer Calibration: Reference thermometer reading: 22.3°C OceanRemote raw reading: 22.8°C Offset = 22.3 - 22.8 = -0.5 Enter -0.5 in the calibration field. Result: Calibrated = 22.8 + (-0.5) = 22.3°C ✓
For best results with reference thermometer calibration, calibrate at the temperature you care about most. If monitoring a refrigerator at 4°C, put both sensors in the refrigerator and calibrate at 4°C, not at room temperature.
Method 4: Two-Point Calibration (Most Accurate)
For critical applications or NTC thermistors, use both ice water (0°C) and boiling water (100°C) to calibrate. This corrects for both offset and gain errors.
When to Use Two-Point Calibration:
- NTC thermistors: They have non-linear response. Two-point calibration significantly improves accuracy across a wide range.
- Wide temperature range monitoring: If your sensor will see -10°C to +50°C, two-point calibration is better.
- Scientific or medical applications: When you need accuracy better than ±0.3°C across the full range.
Step-by-Step Procedure:
- Calibrate at 0°C: Use ice water method. Note the raw reading (Raw_0).
- Calculate offset at 0°C: Offset_0 = 0 - Raw_0
- Calibrate at boiling point: Use boiling water method with altitude adjustment. Note the raw reading (Raw_100).
- Calculate offset at boiling point: Offset_100 = Boiling_Point - Raw_100
- Choose an offset: For most sensors, use the average: Offset = (Offset_0 + Offset_100) / 2
- For NTC only: Consider calculating actual Beta using two known points (advanced - see Tutorial 18).
Example Two-Point Calibration (NTC Thermistor): Ice water calibration: Raw reading at 0°C: 0.8°C Offset_0 = 0 - 0.8 = -0.8 Boiling water calibration (sea level): Raw reading at 100°C: 99.2°C Offset_100 = 100 - 99.2 = +0.8 Average offset = (-0.8 + 0.8) / 2 = 0.0 Analysis: The NTC reads 0.8°C too high at 0°C but 0.8°C too low at 100°C. This suggests a gain (slope) error, not just offset. Recommendation: Adjust Beta parameter in firmware generation for better accuracy across the full range.
How to Enter and Save Offset in Dashboard
Step-by-Step Instructions:
- Log in to your OceanRemote dashboard at https://www.oceanremote.net/
- Find your device card with the temperature sensor
- Locate the temperature card - it has a 🌡️ icon and "CALIBRATED TEMPERATURE"
- Find the "Calibration Offset (±°C)" input field
- Type your calculated offset value (e.g., -0.5 or +1.2)
- Press Enter or click outside the field
- The calibrated temperature updates immediately
- The offset is automatically saved to the server
Offset Examples: Raw Reading: 23.5°C - If actual is 24.0°C → Offset = +0.5 → Calibrated = 24.0°C - If actual is 23.0°C → Offset = -0.5 → Calibrated = 23.0°C - If actual is 22.5°C → Offset = -1.0 → Calibrated = 22.5°C - If actual is 25.0°C → Offset = +1.5 → Calibrated = 25.0°C Valid offset range: -100°C to +100°C (you won't need more than ±10°C)
When you enter an offset, OceanRemote:
- Sends the value to the server via API
- Stores it in the database for your device
- Re-calculates the calibrated temperature using: Calibrated = Raw + Offset
- Updates the display immediately
- The offset persists even after device reboot, power cycle, or firmware update
Raw vs Calibrated: What's Displayed Where?
| Location | Value Shown | Notes |
|---|---|---|
| Temperature Card (large number) | Calibrated Temperature | Raw + Offset - what most users see |
| Device Details section ("Raw Temp") | Raw Temperature | Unmodified sensor reading - for debugging |
| API Response (/api/debug-data/) | Both raw and calibrated | temperature + calibrated_temperature fields |
| Serial Monitor | Raw Temperature | Offset is applied server-side only |
API Response Example (from /api/debug-data/):
{
"devices": [{
"id": "ESP_AABBCCDDEEFF",
"temperature": 23.5, // Raw sensor reading
"calibrated_temperature": 23.0, // Raw + Offset
"temperature_offset": -0.5, // Your calibration value
...
}]
}
Calibration by Sensor Type
DS18B20 Calibration
DS18B20 sensors are factory-calibrated to ±0.5°C. Most need little or no offset (±0.3°C typical). Use ice water method if you need better accuracy.
DHT22 Calibration
DHT22 sensors have ±0.5°C specified accuracy but can vary more. They also suffer from self-heating if read too frequently (OceanRemote respects the 2-second limit). Use reference thermometer method.
NTC Thermistor Calibration
NTCs need the most calibration. Use two-point calibration (ice water + boiling water) for best results. The dashboard offset works, but adjusting the Beta parameter in firmware generation is more accurate for wide temperature ranges.
For NTC thermistors:
- Offset calibration works well for narrow temperature ranges (±10°C from calibration point)
- Adjusting Beta in firmware generation is better for wide temperature ranges (-20°C to 80°C)
- If your NTC reads high at low temps and low at high temps (or vice versa), adjust Beta, not offset
Troubleshooting Calibration
Problem: Calibrated temperature doesn't change after entering offset
- Refresh the page: The offset saves immediately but the display may need a manual refresh (F5 or Ctrl+R).
- Check browser console: Press F12, look for JavaScript errors. Your offset might be invalid (letters, symbols, or outside -100 to +100 range).
- Wait for auto-refresh: The dashboard updates every 5 seconds. Wait a few seconds for the next update cycle.
- Check network tab: In browser dev tools, verify the API call to /api/set-temperature-offset/ returned success.
Problem: Offset resets after page reload
- Browser cache: Your browser might have cached an old version. Hard refresh: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac).
- Wrong account: Make sure you're logged in with the correct OceanRemote account.
- Wrong device: Offsets are per-device. Make sure you're editing the correct device card.
- API failure: Check if your offset value was rejected (e.g., text instead of number).
Problem: Different temperatures at different times of day
- Single-point limitation: A single offset works best near the calibration temperature. If you calibrated at 25°C, readings at 0°C may still be off.
- Solution for narrow range: Calibrate at the temperature you care about most. If monitoring a refrigerator at 4°C, calibrate at 4°C.
- Solution for wide range (NTC only): Use two-point calibration or adjust Beta parameter in firmware generation.
Problem: Raw temperature jumps around (noisy)
- Not a calibration issue: This is a hardware or wiring problem. Calibration won't fix noisy readings.
- Check wiring: Loose connections cause erratic readings.
- Add a capacitor: Place a 0.1μF capacitor between ADC pin and GND to filter noise.
- OceanRemote averaging: The firmware already averages 5 samples. If readings are still noisy, check your power supply.
Many users forget to stir ice water during calibration. Without stirring, the water near the sensor can be several degrees above 0°C. Always stir continuously for 1-2 minutes before taking your reading for accurate 0°C reference.
When to Re-Calibrate
- Annually: Sensors can drift over time, especially in harsh environments (high humidity, temperature extremes, vibration).
- After physical shock: If your sensor was dropped or subjected to vibration, re-calibrate.
- After extreme temperatures: If your sensor was exposed to temperatures outside its rated range, it may have shifted.
- When replacing a sensor: Each sensor has unique characteristics. Calibrate each one individually.
- When you suspect inaccurate readings: If your readings don't match your expectations, re-calibrate.
Calibration Best Practices Summary
- Calibrate at your target temperature: If monitoring a refrigerator at 4°C, calibrate at 4°C (using a reference thermometer), not at 0°C or 25°C.
- Allow stabilization time: Sensors need 2-5 minutes to reach thermal equilibrium. Don't rush the process.
- Use multiple points for NTC: NTCs are non-linear. Single-point offset works best within ±10°C of calibration point.
- Document your calibration: Keep a record of calibration dates, methods used, and offset values. Sensors drift over years.
- Re-calibrate annually: Set a calendar reminder to re-calibrate your sensors once per year.
- Use the same units: All OceanRemote temperatures are in Celsius. Convert Fahrenheit references before calculating offset.
- Test after calibration: Verify your calibration by checking a known temperature (ice water or reference thermometer).
Celsius = (Fahrenheit - 32) × 5/9 Fahrenheit = (Celsius × 9/5) + 32 Common conversions: 32°F = 0°C (freezing point of water) 68°F = 20°C (room temperature) 77°F = 25°C (typical room temperature) 98.6°F = 37°C (human body temperature) 212°F = 100°C (boiling point of water at sea level)
Next Steps
Now that you've calibrated your temperature sensor, continue with:
- Tutorial 29: WiFi Connection Troubleshooting
- Tutorial 30: FAQ and Best Practices
- Return to Dashboard: Monitor your calibrated temperatures
Temperature offset calibration corrects sensor inaccuracies using a simple formula: Calibrated = Raw + Offset. Use ice water (0°C) for the most accurate reference, a reference thermometer for convenience, or boiling water (adjust for altitude). Offsets are saved per-device and persist across reboots. For NTC thermistors, consider two-point calibration or Beta adjustment for wide temperature ranges. Re-calibrate annually or when you suspect inaccurate readings.