Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Temperature-Controlled Water Pump and Fan System with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Temperature-Controlled Water Pump and Fan System with LCD Display

Circuit Documentation

Summary

This circuit is designed to control a 12V PWM fan and a mini diaphragm water pump based on temperature readings from a thermocouple. The temperature data is displayed on a 16x2 LCD screen. The circuit uses an Arduino UNO as the main microcontroller, interfacing with a MAX6675 thermocouple module, an L298N motor driver, a 12V PWM fan, a mini diaphragm water pump, a 3xAA battery pack, an NTC thermistor, a potentiometer, and a 16x2 LCD display.

Component List

  1. Arduino UNO

    • Description: Main microcontroller for the circuit.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. MAX6675 Module

    • Description: Thermocouple interface module.
    • Pins: GND, VCC, SCK, CS, SO, -, +
  3. 12V PWM Fan (120mm)

    • Description: Cooling fan with PWM control.
    • Pins: GND, +12V, TACH, PWM
  4. Mini Diaphragm Water Pump

    • Description: Water pump for liquid circulation.
    • Pins: Positive (+), Negative (-)
  5. 3xAA Battery

    • Description: Power supply for the circuit.
    • Pins: VCC, GND
  6. L298N DC Motor Driver

    • Description: Motor driver for controlling the water pump.
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  7. NTC

    • Description: Thermistor for temperature sensing.
    • Pins: A0, A1
  8. 16x2 LCD

    • Description: Display module for showing temperature and fan status.
    • Pins: VSS, VDD, V0, RS, RW, E, D1, D0, D2, D3, D4, D6, D5, D7, A, K
  9. Potentiometer

    • Description: Variable resistor for adjusting LCD contrast.
    • Pins: GND, Output, VCC

Wiring Details

Arduino UNO

MAX6675 Module

12V PWM Fan (120mm)

Mini Diaphragm Water Pump

3xAA Battery

L298N DC Motor Driver

NTC

16x2 LCD

Potentiometer

Code Documentation

sketch.ino

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

documentation.txt

#include <Adafruit_MAX31855.h>
#include <LiquidCrystal.h>

// Thermocouple Pins
#define thermoDO 12
#define thermoCS 10
#define thermoCLK 13
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

// L298N Pump Control Pins
#define PUMP_IN1 8
#define PUMP_IN2 9
#define PUMP_ENA 11

// 4-Wire Fan Control Pins
#define FAN_PWM 10
#define FAN_TACH 2

// LCD Configuration
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // RS, E, D4, D5, D6, D7

// Fan RPM Variables
volatile int tachCounter = 0;
unsigned long lastRPMCheck = 0;
int rpm = 0;

// Temperature Variables
float temperature = 0.0;

// Tachometer Interrupt Function
void countTach() {
  tachCounter++;
}

void setup() {
  // Serial Communication
  Serial.begin(9600);

  // LCD Initialization
  lcd.begin(16, 2);
  lcd.print("System Initializing");
  delay(2000);
  lcd.clear();

  // Pump Control Pins
  pinMode(PUMP_IN1, OUTPUT);
  pinMode(PUMP_IN2, OUTPUT);
  pinMode(PUMP_ENA, OUTPUT);

  // Fan Control Pins
  pinMode(FAN_PWM, OUTPUT);
  pinMode(FAN_TACH, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(FAN_TACH), countTach, FALLING);

  // Initial State: Turn off pump and fan
  digitalWrite(PUMP_IN1, LOW);
  digital