Stufin
Home Quick Cart Profile

HT12D Decoder IC

Buy Now on Stufin

Pin Configuration

  • HT12D Decoder IC Documentation
  • Overview
  • The HT12D is a 12-bit remote control decoder IC widely used in remote control systems, robotics, and IoT applications. It is a member of the 212 series of decoders and is compatible with the 212 encoder series. The HT12D decoder is capable of decoding 12-bit binary data and provides a output signal when a valid transmission is received.
  • Pin Description
  • The HT12D decoder IC has 18 pins, which are described below:
  • Pin 1: VCC
  • Description: Power Supply Pin
  • Function: Provides the power supply to the IC (typically +5V)
  • Connection: Connect to a positive power supply (e.g., VCC of the microcontroller or a battery)
  • Pin 2: D8
  • Description: Data Input Pin 8
  • Function: One of the 12-bit data input pins
  • Connection: Connect to the encoder's data output pin (e.g., D8 of the HT12E encoder)
  • Pin 3: D9
  • Description: Data Input Pin 9
  • Function: One of the 12-bit data input pins
  • Connection: Connect to the encoder's data output pin (e.g., D9 of the HT12E encoder)
  • Pin 4: D10
  • Description: Data Input Pin 10
  • Function: One of the 12-bit data input pins
  • Connection: Connect to the encoder's data output pin (e.g., D10 of the HT12E encoder)
  • Pin 5: D11
  • Description: Data Input Pin 11
  • Function: One of the 12-bit data input pins
  • Connection: Connect to the encoder's data output pin (e.g., D11 of the HT12E encoder)
  • Pin 6: D12
  • Description: Data Input Pin 12
  • Function: One of the 12-bit data input pins
  • Connection: Connect to the encoder's data output pin (e.g., D12 of the HT12E encoder)
  • Pin 7: TE
  • Description: Transmission Enable Pin
  • Function: Enables or disables the transmission of data
  • Connection: Connect to a logic high (e.g., VCC) to enable transmission and a logic low (e.g., GND) to disable transmission
  • Pin 8: VT
  • Description: Valid Transmission Pin
  • Function: Indicates whether a valid transmission has been received
  • Connection: Connect to a microcontroller's digital input pin to detect valid transmissions
  • Pin 9: D0
  • Description: Address Bit 0 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 10: D1
  • Description: Address Bit 1 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 11: D2
  • Description: Address Bit 2 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 12: D3
  • Description: Address Bit 3 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 13: D4
  • Description: Address Bit 4 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 14: D5
  • Description: Address Bit 5 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 15: D6
  • Description: Address Bit 6 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 16: D7
  • Description: Address Bit 7 Pin
  • Function: One of the 8-bit address pins
  • Connection: Connect to a logic high (e.g., VCC) or logic low (e.g., GND) to set the address bit
  • Pin 17: OSC1
  • Description: Oscillator Pin 1
  • Function: Internal oscillator pin (connected to OSC2 internally)
  • Connection: Do not connect anything to this pin
  • Pin 18: GND
  • Description: Ground Pin
  • Function: Provides the ground connection to the IC
  • Connection: Connect to the ground of the power supply (e.g., GND of the microcontroller or a battery)
  • Connecting the Pins
  • To connect the HT12D decoder IC, follow these steps:
  • 1. Connect the VCC pin (Pin 1) to a positive power supply (e.g., VCC of the microcontroller or a battery).
  • 2. Connect the GND pin (Pin 18) to the ground of the power supply (e.g., GND of the microcontroller or a battery).
  • 3. Connect the data input pins (Pins 2-6) to the encoder's data output pins (e.g., D8-D12 of the HT12E encoder).
  • 4. Connect the transmission enable pin (Pin 7) to a logic high (e.g., VCC) to enable transmission and a logic low (e.g., GND) to disable transmission.
  • 5. Connect the valid transmission pin (Pin 8) to a microcontroller's digital input pin to detect valid transmissions.
  • 6. Set the address bits (Pins 9-16) by connecting them to logic high (e.g., VCC) or logic low (e.g., GND) according to the desired address.
  • 7. Leave the oscillator pins (Pins 17 and internal connection) unconnected.
  • Important Notes
  • Ensure the power supply voltage is within the recommended operating range (typically +5V).
  • Use a suitable capacitor (e.g., 10nF) to decouple the power supply pins (VCC and GND).
  • Ensure proper address setting by connecting the address bits correctly.
  • Use a suitable microcontroller or decoder compatible with the HT12D decoder IC.
  • By following these guidelines, you can successfully connect and use the HT12D decoder IC in your remote control or IoT applications.

Code Examples

HT12D Decoder IC Documentation
Overview
The HT12D is a 12-bit decoder IC commonly used in remote control systems, robotics, and other IoT applications. It is used to decode the serial data transmitted by an RF transmitter module, such as the HT12E encoder IC, and produce a corresponding 12-bit output.
Pinout
The HT12D decoder IC has 18 pins, with the following pinout:
| Pin No. | Pin Name | Function |
| --- | --- | --- |
| 1 | VCC | Positive power supply (5V) |
| 2 | DIN | Serial data input |
| 3 | CLK | Clock input |
| 4 | DOUT1 | Data output bit 1 |
| 5 | DOUT2 | Data output bit 2 |
| ... | ... | ... |
| 12 | DOUT12 | Data output bit 12 |
| 13 | VT | Valid transmission indicator (active low) |
| 14 | OSC1 | Oscillator input 1 |
| 15 | OSC2 | Oscillator input 2 |
| 16 | GND | Ground |
| 17 | NC | No connection |
| 18 | NC | No connection |
How to Use
The HT12D decoder IC is typically used in conjunction with an RF transmitter module, such as the HT12E encoder IC, to decode the serial data transmitted wirelessly. Here are some code examples to demonstrate how to use the HT12D decoder IC in various contexts:
Example 1: Basic Decoder Example (Arduino)
In this example, we will use the HT12D decoder IC to decode the serial data transmitted by an HT12E encoder IC and display the decoded data on an LCD screen.
```c
#include <LiquidCrystal.h>
#define DATA_PIN 2  // HT12D DIN pin
#define CLK_PIN 3   // HT12D CLK pin
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
  lcd.init();
  lcd.backlight();
  pinMode(DATA_PIN, INPUT);
  pinMode(CLK_PIN, INPUT);
}
void loop() {
  int data = 0;
  for (int i = 0; i < 12; i++) {
    data |= digitalRead(DATA_PIN) << i;
  }
  lcd.setCursor(0, 0);
  lcd.print("Decoded Data: ");
  lcd.print(data, BIN);
  delay(100);
}
```
Example 2: Robot Control System (Raspberry Pi - Python)
In this example, we will use the HT12D decoder IC to decode the serial data transmitted by an HT12E encoder IC and control a robotic arm using a Raspberry Pi.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
DATA_PIN = 17  # HT12D DIN pin
CLK_PIN = 23   # HT12D CLK pin
MOTOR_PIN1 = 24  # Motor 1 control pin
MOTOR_PIN2 = 25  # Motor 2 control pin
GPIO.setup(DATA_PIN, GPIO.IN)
GPIO.setup(CLK_PIN, GPIO.IN)
GPIO.setup(MOTOR_PIN1, GPIO.OUT)
GPIO.setup(MOTOR_PIN2, GPIO.OUT)
while True:
  data = 0
  for i in range(12):
    data |= GPIO.input(DATA_PIN) << i
  if data == 0b1010:
    # Motor 1 forward
    GPIO.output(MOTOR_PIN1, GPIO.HIGH)
    GPIO.output(MOTOR_PIN2, GPIO.LOW)
  elif data == 0b1100:
    # Motor 2 backward
    GPIO.output(MOTOR_PIN1, GPIO.LOW)
    GPIO.output(MOTOR_PIN2, GPIO.HIGH)
  else:
    # Stop motors
    GPIO.output(MOTOR_PIN1, GPIO.LOW)
    GPIO.output(MOTOR_PIN2, GPIO.LOW)
  time.sleep(0.1)
```
Example 3: Home Automation System (ESP32 - MicroPython)
In this example, we will use the HT12D decoder IC to decode the serial data transmitted by an HT12E encoder IC and control a home automation system using an ESP32 board.
```python
import machine
import utime
DATA_PIN = 32  # HT12D DIN pin
CLK_PIN = 33   # HT12D CLK pin
RELAY_PIN = 25  # Relay control pin
machine.Pin(DATA_PIN, machine.Pin.IN)
machine.Pin(CLK_PIN, machine.Pin.IN)
machine.Pin(RELAY_PIN, machine.Pin.OUT)
while True:
  data = 0
  for i in range(12):
    data |= machine.Pin(DATA_PIN).value() << i
  if data == 0b1111:
    # Turn on relay
    machine.Pin(RELAY_PIN).value(1)
  else:
    # Turn off relay
    machine.Pin(RELAY_PIN).value(0)
  utime.sleep_ms(100)
```
Note: These examples are for illustration purposes only and may require additional circuitry and programming to function correctly.