Skip to Content


info@hub360.com.ng 07044715478

SMART POOL TEMPERATURE MONITORING SYSTEM

February 22, 2025 by
SMART POOL TEMPERATURE MONITORING SYSTEM
My Company (Chicago), Hub360
| No comments yet

The Smart Pool Temperature Monitoring System offers a simple yet highly effective solution by continuously measuring the water temperature and displaying the data in real time. Whether for personal pools or larger public ones, this system ensures you can always monitor the water temperature with ease, allowing for precise adjustments when needed. The idea behind this project is to combine accuracy with convenience, giving users the ability to maintain their pool at the perfect temperature without any hassle.

The system utilizes a temperature sensor to track the water's temperature, while a display unit shows the current readings. This real-time feedback helps ensure that the pool is always at the desired warmth, making it perfect for swimmers and pool owners who value consistency. Moreover, the simplicity and functionality of the system make it an essential tool for effective pool management.

Components Required

  • Arduino Uno
  • Waterproof Temperature Sensor (e.g., DS18B20)
  • LCD Display
  • 10kΩ Resistor
  • Jumper Wires
  • Breadboard
  • Power Supply

Circuit Diagram

Component Connections

1. Connecting the Temperature Sensor to Arduino

A temperature sensor measures the surrounding temperature and sends the data to the Arduino. In this setup, we use a waterproof temperature sensor to monitor pool water temperature. The sensor requires three connections: power (VCC), ground (GND), and data (DATA).

Wiring the Temperature Sensor:

  • VCC (Power): Connect this pin to the 5V pin on the Arduino to supply power to the sensor.
  • GND (Ground): Connect this pin to the GND pin on the Arduino to complete the circuit.
  • DATA (Signal): Connect this pin to D2 on the Arduino.

Important: Use a 10kΩ pull-up resistor between the DATA pin and 5V.

Why use a 10kΩ resistor?

  • It helps stabilize the sensor’s signal.
  • Without the resistor, the sensor may send unreliable data.

2. Connecting the LCD Display to Arduino

An LCD (Liquid Crystal Display) allows us to see real-time temperature readings. This LCD uses an I2C communication interface, meaning it requires only two data pins instead of multiple connections.

Wiring the LCD Display:

  • VCC (Power): Connect this pin to the 5V pin on the Arduino to provide power.
  • GND (Ground): Connect this pin to the GND pin on the Arduino to complete the circuit.
  • SDA (Serial Data): Connect this pin to A4 on the Arduino.
  • SCL (Serial Clock): Connect this pin to A5 on the Arduino.

Why use I2C for the LCD?

  • It reduces the number of required connections, making the wiring simpler.
  • It allows multiple devices to communicate using just two pins (SDA and SCL).

3. Installing the Temperature Sensor in the Pool

  • Place the waterproof temperature sensor in a strategic location where it can measure an accurate representation of the pool’s water temperature.
  • Avoid placing the sensor near heating elements or direct sunlight, as this could cause incorrect readings.

4. Setting Up the LCD Display

  • Mount the LCD display in a visible location where the temperature readings can be easily monitored.
  • Make sure the display is not exposed to water to prevent damage.

5. Powering the System

To keep the Arduino running, it needs a stable power source. You can power it in two ways:

  1. USB Power (Recommended for Continuous Use)
    • Plug the Arduino into a USB power adapter or a power bank.
  2. External Power Supply (Standalone Mode)
    • Use a 5V adapter or connect a battery.
    • If using a 9V battery, connect the positive terminal to VIN and the negative terminal to GND.

Do NOT connect a 9V battery directly to the 5V pin, as it can damage the Arduino.

6. Uploading the Code to Arduino

  • Open the Arduino IDE on your computer.
  • Copy and paste the provided code into a new sketch.
  • Connect the Arduino to your computer using a USB cable.
  • Select the correct board type and port in the Arduino IDE.
  • Click the Upload button to transfer the code to the Arduino.

Once uploaded, the system will start displaying real-time temperature readings on the LCD.

CODE

#include <OneWire.h>

#include <DallasTemperature.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>


#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);


LiquidCrystal_I2C lcd(0x27, 16, 2);


void setup() {

  Serial.begin(9600);

  sensors.begin();

  lcd.begin(16, 2);

  lcd.print("Pool Temp Monitor");

  delay(2000);

}


void loop() {

  sensors.requestTemperatures();

  float tempC = sensors.getTempCByIndex(0);


  lcd.clear();

  lcd.setCursor(0, 0);

  lcd.print("Water Temp: ");

  lcd.print(tempC);

  lcd.print(" C");

  delay(2000);

}

CODE EXPLANATION

1. Including Necessary Libraries

#include <OneWire.h>

#include <DallasTemperature.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

  • OneWire.h: This library enables communication with devices connected to a single data line, in this case, the temperature sensor.
  • DallasTemperature.h: This library is used specifically to interface with Dallas Semiconductor's temperature sensors, like the DS18B20.
  • Wire.h: This library facilitates communication with I2C devices, such as the LCD display.
  • LiquidCrystal_I2C.h: This library allows control of an LCD display over I2C, simplifying wiring and use.

2. Defining Pins and Initializing Components

#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

LiquidCrystal_I2C lcd(0x27, 16, 2);

  • ONE_WIRE_BUS: Defines the digital pin (pin 2) to which the temperature sensor is connected.
  • OneWire oneWire(ONE_WIRE_BUS): Initializes the OneWire object for communication with the temperature sensor using the defined pin.
  • DallasTemperature sensors(&oneWire): Initializes the DallasTemperature library to interact with the temperature sensor.
  • LiquidCrystal_I2C lcd(0x27, 16, 2): Sets up the LCD display with the I2C address 0x27 and dimensions 16 characters by 2 rows.

3. Setup Function (Runs Once at the Start)

void setup() {

  Serial.begin(9600);

  sensors.begin();

  lcd.begin(16, 2);

  lcd.print("Pool Temp Monitor");

  delay(2000);

}

  • Serial.begin(9600): Initializes serial communication at a baud rate of 9600 for debugging (if needed).
  • sensors.begin(): Initializes the temperature sensor.
  • lcd.begin(16, 2): Initializes the LCD display with 16 columns and 2 rows.
  • lcd.print("Pool Temp Monitor"): Displays the initial message "Pool Temp Monitor" on the LCD.
  • delay(2000): Waits for 2 seconds before continuing, allowing users to see the initial message.

4. Loop Function

void loop() {

  sensors.requestTemperatures();

  float tempC = sensors.getTempCByIndex(0);

  lcd.clear();

  lcd.setCursor(0, 0);

  lcd.print("Water Temp: ");

  lcd.print(tempC);

  lcd.print(" C");

  delay(2000);

}

  • sensors.requestTemperatures(): Requests the temperature from the sensor.
  • float tempC = sensors.getTempCByIndex(0): Retrieves the temperature of the first (and only) sensor connected to the system in Celsius.
  • lcd.clear(): Clears the LCD screen to prepare for the new temperature display.
  • lcd.setCursor(0, 0): Positions the cursor at the top-left corner of the LCD (row 0, column 0).
  • lcd.print("Water Temp: "): Displays the label "Water Temp: " on the LCD.
  • lcd.print(tempC): Displays the current temperature reading.
  • lcd.print(" C"): Appends the unit "C" (for Celsius) to the temperature.
  • delay(2000): Pauses for 2 seconds before repeating the process, allowing the display to update at intervals.

How It Works Together

  1. The temperature sensor continuously monitors the water temperature in the pool.
  2. The LCD display updates in real-time, showing the current temperature.
  3. The system operates automatically, providing a hassle-free way to keep track of the water temperature, ensuring it is always within the desired range for pool activities.

OBSERVING FUNCTIONALITY

  1. Normal Mode: The system displays the current pool water temperature.
  2. Temperature Display: The real-time data is shown on the LCD for easy monitoring.

COMMON PROBLEMS AND SOLUTIONS

1. Sensor Not Reading Correctly:

  • Cause: The sensor is not properly connected.
  • Solution: Check the wiring of the temperature sensor and ensure it’s correctly placed in the water.

2. Display Not Showing Data:

  • Cause: Wiring issue or incorrect LCD initialization.
  • Solution: Verify the I2C connections to the LCD and check the address used in the code.​

Conclusion

The Smart Pool Temperature Monitoring System is an excellent solution for pool owners and enthusiasts who wish to maintain optimal water conditions effortlessly. With real-time data provided on an easy-to-read LCD display, it ensures that pool temperatures are always monitored, promoting a comfortable and enjoyable swimming experience.


Comments

Share this post
Tags
Archive
Sign in to leave a comment