Stufin
Home Quick Cart Profile

XH-W1219 12V Digital Temperature Controller

Buy Now on Stufin

Power supply

12V DC

Temperature measurement range

-50C to 300C (depending on the temperature sensor used)

Accuracy

0.1C (in the range of 0C to 100C)

Display

LCD display with 3-digit temperature display and 1-digit relay status display

Relay output

10A at 12V

Dimensions

73 x 55 x 28 mm

Wiring Diagram

The XH-W1219 12V Digital Temperature Controller has the following wiring diagram

VCC

12V DC power supply

GND

Ground

T+Thermocouple or thermistor signal input
T-Thermocouple or thermistor signal input

Relay

Relay output (COM, NO, and NC terminals)

Please note that proper wiring and installation are crucial for safe and reliable operation of the XH-W1219 temperature controller. Consult the user manual or manufacturer's instructions for detailed wiring and installation guidelines.

Pin Configuration

  • XH-W1219 12V Digital Temperature Controller Pinout Explanation and Connection Guide
  • The XH-W1219 12V Digital Temperature Controller is a popular IoT component used for precise temperature control in various applications. The module has a total of 7 pins, which are explained below:
  • Pin 1: VCC (12V Power Supply)
  • Function: Power supply input for the module
  • Description: Connect a 12V DC power source to this pin. Ensure the power supply is stable and within the recommended voltage range.
  • Connection: Connect the positive wire of a 12V DC power source to this pin.
  • Pin 2: GND (Ground)
  • Function: Ground connection for the module
  • Description: Connect the ground wire of the power supply and other components to this pin.
  • Connection: Connect the negative wire of the power supply and any other ground connections to this pin.
  • Pin 3: T- (Temperature Sensor Negative)
  • Function: Connect the negative wire of the temperature sensor (e.g., DS18B20) to this pin.
  • Description: This pin is used to connect the temperature sensor's negative leg to the module.
  • Connection: Connect the negative wire of the temperature sensor to this pin.
  • Pin 4: T+ (Temperature Sensor Positive)
  • Function: Connect the positive wire of the temperature sensor (e.g., DS18B20) to this pin.
  • Description: This pin is used to connect the temperature sensor's positive leg to the module.
  • Connection: Connect the positive wire of the temperature sensor to this pin.
  • Pin 5: OUT (Output)
  • Function: Output pin for relay control
  • Description: This pin controls the relay, which can be used to switch devices on or off based on temperature thresholds.
  • Connection: Connect the output wire to a relay module or directly to a load (e.g., a heating element or fan).
  • Pin 6: SET (Set Button)
  • Function: Button input for setting temperature values
  • Description: This pin is connected to a push-button switch, which is used to set the desired temperature value.
  • Connection: Connect a push-button switch between this pin and GND (Pin 2). When the button is pressed, the module enters setting mode.
  • Pin 7: LED (LED Indicator)
  • Function: LED indicator for temperature status
  • Description: This pin is connected to an LED, which indicates the temperature status (e.g., red for above setpoint, green for below setpoint).
  • Connection: Connect an LED and a current-limiting resistor between this pin and GND (Pin 2).
  • Connection Structure:
  • To connect the XH-W1219 12V Digital Temperature Controller, follow this structure:
  • Power Supply:
  • + 12V DC power source -> VCC (Pin 1)
  • + GND -> GND (Pin 2)
  • Temperature Sensor:
  • + Negative wire -> T- (Pin 3)
  • + Positive wire -> T+ (Pin 4)
  • Output:
  • + OUT (Pin 5) -> Relay module or load (e.g., heating element or fan)
  • Set Button:
  • + SET (Pin 6) -> Push-button switch -> GND (Pin 2)
  • LED Indicator:
  • + LED -> LED (Pin 7) -> Current-limiting resistor -> GND (Pin 2)
  • Ensure proper connections and voltage levels to avoid damage to the module and other components.

Code Examples

XH-W1219 12V Digital Temperature Controller Documentation
Overview
The XH-W1219 is a 12V digital temperature controller module designed for precise temperature control and monitoring in various IoT applications. This module features a high-accuracy temperature sensor, relay output, and an LCD display for real-time temperature monitoring.
Key Features
High-accuracy temperature measurement range: -50C to 100C
 Relay output for controlling heaters, fans, or other devices
 LCD display for real-time temperature monitoring
 12V operating voltage
 Simple wiring and easy integration with microcontrollers and other devices
Pinout
| Pin | Function |
| --- | --- |
| VCC | 12V Power Input |
| GND | Ground |
| S | Signal (Temperature Sensor) |
| R1 | Relay Output 1 (Normally Open) |
| R2 | Relay Output 2 (Normally Closed) |
| LCD_VCC | LCD Display Power Input |
| LCD_GND | LCD Display Ground |
| SCL | I2C Clock (for optional I2C communication) |
| SDA | I2C Data (for optional I2C communication) |
Example Code 1: Basic Temperature Monitoring with Arduino
In this example, we'll use an Arduino Uno board to read the temperature from the XH-W1219 module and display it on the serial monitor.
```cpp
#include <Arduino.h>
#define TEMPERATURE_PIN A0 // Pin for temperature sensor signal
void setup() {
  Serial.begin(9600);
}
void loop() {
  int sensorValue = analogRead(TEMPERATURE_PIN);
  float temperature = sensorValue  0.488; // Convert analog value to temperature (approximate formula)
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" C");
  delay(1000);
}
```
Example Code 2: Temperature Control with Relay Output using Raspberry Pi
In this example, we'll use a Raspberry Pi to control a heater connected to the relay output of the XH-W1219 module. The Python script will read the temperature from the module and turn the heater on or off based on a setpoint temperature.
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
relay_pin = 17
GPIO.setup(relay_pin, GPIO.OUT)
# Setpoint temperature (e.g., 25C)
setpoint = 25
while True:
  # Read temperature from XH-W1219 module (assuming I2C communication is not used)
  temperature = read_temperature_from_module() # Implement your own function to read temperature
if temperature < setpoint:
    # Turn heater on
    GPIO.output(relay_pin, GPIO.HIGH)
  else:
    # Turn heater off
    GPIO.output(relay_pin, GPIO.LOW)
time.sleep(1)
```
Example Code 3: I2C Communication with ESP32
In this example, we'll use an ESP32 board to communicate with the XH-W1219 module over I2C and read the temperature.
```cpp
#include <WiFi.h>
#include <Wire.h>
#define I2C_ADDRESS 0x20 // Default I2C address of XH-W1219 module
void setup() {
  Serial.begin(115200);
  Wire.begin();
}
void loop() {
  byte temperature_high, temperature_low;
  Wire.beginTransmission(I2C_ADDRESS);
  Wire.write(0x00); // Write to temperature register
  Wire.endTransmission();
  Wire.requestFrom(I2C_ADDRESS, 2);
  temperature_high = Wire.read();
  temperature_low = Wire.read();
  float temperature = (temperature_high << 8) | temperature_low;
  temperature = temperature  0.01 - 50; // Convert raw temperature value to Celsius
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" C");
  delay(1000);
}
```
Note: These examples are for illustrative purposes only and may require modifications to work with your specific device and setup. Make sure to consult the datasheet and user manual for the XH-W1219 module and your microcontroller or board for detailed instructions and pinouts.