Stufin
Home Quick Cart Profile

Programmable Digital Timer Module

Buy Now on Stufin

Single shot mode

Generates a single pulse or signal with a user-defined duration.

Repeat mode

Produces a continuous series of pulses or signals with a user-defined interval.

Delayed start mode

Delays the start of the timing sequence by a user-defined interval.

Key Features

  • High-accuracy timing: The module features a quartz crystal oscillator, ensuring accurate timing with a deviation of 10 ppm.
  • Programmable timer intervals: Users can set timer intervals ranging from 1 second to 999 days, with a resolution of 1 second.
  • Multi-mode operation: Supports single shot, repeat, and delayed start modes, making it suitable for various applications.
  • Digital display: A built-in LCD display shows the set timer interval, making it easy to monitor and adjust the module's settings.
  • Relay output: The module features a built-in SPDT relay with a maximum current rating of 5A, allowing it to directly control devices such as lights, motors, and solenoids.
  • Power supply: Operates on a wide range of supply voltages (9V to 24V DC) and consumes low power (less than 50mA).
  • Compact design: The module's compact size (approximately 71mm x 42mm x 20mm) makes it ideal for integration into space-constrained projects.
  • Easy configuration: No programming knowledge is required; the module can be configured using a simple, intuitive interface.

Applications

The Programmable Digital Timer Module is suitable for a wide range of applications, including

Automation systems

Industrial control systems

Home automation systems

Security systems

Energy management systems

Process control systems

Specifications

Supply voltage

9V to 24V DC

Power consumption

Less than 50mA

Timer resolution

1 second

Timer range

1 second to 999 days

Relay output

SPDT, 5A maximum current rating

Operating temperature

0C to 40C

Storage temperature

-20C to 70C

Dimensions

Approximately 71mm x 42mm x 20mm

Pinouts

The module features a 7-pin interface, including

VCC (Power supply)

GND (Ground)

SET (Set button input)

INC (Increment button input)

DEC (Decrement button input)

RELAY (Relay output)

LCD (LCD display interface)

Overall, the Programmable Digital Timer Module is a versatile and reliable component that provides accurate and customizable timing capabilities for a wide range of IoT and automation applications.

Pin Configuration

  • Programmable Digital Timer Module Documentation
  • Pin Description:
  • The Programmable Digital Timer Module has a total of 6 pins, which are described below:
  • Pin 1: VCC (Power Supply)
  • Function: Power supply pin for the module
  • Voltage: Typically 5V, but can operate from 3.3V to 5.5V
  • Description: Connect this pin to a stable power source, such as a 5V output from a microcontroller or a battery.
  • Pin 2: GND (Ground)
  • Function: Ground pin for the module
  • Description: Connect this pin to the ground of your circuit or a common ground point.
  • Pin 3: CLK (Clock Input)
  • Function: Clock input pin for setting the timer interval
  • Signal Type: Digital signal ( HIGH or LOW)
  • Description: Connect this pin to a clock source, such as a 1Hz to 4Hz signal from a crystal oscillator or a clock output from a microcontroller.
  • Pin 4: DIN (Data Input)
  • Function: Data input pin for setting the timer value
  • Signal Type: Digital signal (HIGH or LOW)
  • Description: Connect this pin to a digital output from a microcontroller or a keypad interface to set the timer value.
  • Pin 5: OUT (Output)
  • Function: Output pin that indicates the timer status
  • Signal Type: Digital signal (HIGH or LOW)
  • Description: Connect this pin to a LED, buzzer, or any other device that requires a digital signal to indicate the timer status.
  • Pin 6: RST (Reset)
  • Function: Reset pin to reset the timer to its initial state
  • Signal Type: Digital signal (HIGH or LOW)
  • Description: Connect this pin to a digital output from a microcontroller or a push-button to reset the timer.
  • Connection Structure:
  • When connecting the Programmable Digital Timer Module to your circuit, ensure the following structure is followed:
  • 1. Connect VCC (Pin 1) to a stable power source (5V).
  • 2. Connect GND (Pin 2) to the ground of your circuit.
  • 3. Connect CLK (Pin 3) to a clock source (1Hz to 4Hz signal).
  • 4. Connect DIN (Pin 4) to a digital output from a microcontroller or a keypad interface.
  • 5. Connect OUT (Pin 5) to a LED, buzzer, or any other device that requires a digital signal.
  • 6. Connect RST (Pin 6) to a digital output from a microcontroller or a push-button.
  • Important Notes:
  • Ensure the power supply voltage is within the recommended range (3.3V to 5.5V) to avoid damaging the module.
  • Use a suitable clock source to set the timer interval accurately.
  • The timer value should be set using the DIN pin before applying the clock signal to the CLK pin.
  • The OUT pin will output a HIGH signal when the timer is active and a LOW signal when the timer is inactive or has expired.
  • By following this pin description and connection structure, you can effectively use the Programmable Digital Timer Module in your IoT projects.

Code Examples

Programmable Digital Timer Module Documentation
The Programmable Digital Timer Module is a versatile IoT component that enables users to schedule and control various events or actions with precision timing. This module features a programmable digital timer that can be set to trigger at a specific time, daily, or weekly, making it ideal for automation applications.
Pinout and Interfaces
The Programmable Digital Timer Module has the following pinout and interfaces:
VCC: 3.3V or 5V power input
 GND: Ground connection
 Trig: Trigger output (active low)
 SCL: I2C clock input
 SDA: I2C data input/output
 SET: Button input for setting the timer
Software Functions and Commands
The Programmable Digital Timer Module can be controlled using the following software functions and commands:
`setTime(hour, minute, second)`: Sets the timer to a specific time (HH:MM:SS format)
 `setDailyTimer(hour, minute)`: Sets the timer to trigger daily at a specified time (HH:MM format)
 `setWeeklyTimer(day, hour, minute)`: Sets the timer to trigger weekly on a specified day at a specified time (1-7 for Monday to Sunday, HH:MM format)
 `resetTimer()`: Resets the timer to its default state
 `getTimerStatus()`: Returns the current timer status (0: idle, 1: running, 2: triggered)
Code Examples
### Example 1: Basic Timer Operation using Arduino
In this example, we will use the Programmable Digital Timer Module to trigger an LED every 10 seconds.
```c
#include <Wire.h>
const int trigPin = 2;  // Trigger output connected to digital pin 2
void setup() {
  Wire.begin();  // Initialize I2C communication
  pinMode(trigPin, INPUT);
}
void loop() {
  Wire.beginTransmission(0x20);  // Address of the timer module
  Wire.write(0x01);  // Set timer mode to once
  Wire.write(0x00);  // Set timer value to 10 seconds
  Wire.endTransmission();
  
  if (digitalRead(trigPin) == LOW) {
    // Triggered, turn on the LED
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
    digitalWrite(LED_BUILTIN, LOW);
  }
  delay(1000);
}
```
### Example 2: Daily Timer using Raspberry Pi (Python)
In this example, we will use the Programmable Digital Timer Module to trigger a Python script daily at 8:00 AM.
```python
import smbus
import time
# Initialize I2C communication
bus = smbus.SMBus(1)
# Set timer mode to daily
bus.write_byte(0x20, 0x02)
# Set timer value to 8:00 AM
bus.write_byte(0x20, 0x08)
bus.write_byte(0x20, 0x00)
while True:
    # Check timer status
    status = bus.read_byte(0x20)
    if status == 2:
        # Timer triggered, execute script
        print("Daily timer triggered!")
        # Execute your Python script here
        time.sleep(1)
```
### Example 3: Weekly Timer using ESP32 (MicroPython)
In this example, we will use the Programmable Digital Timer Module to trigger an event every Sunday at 10:00 AM.
```micropython
import machine
import utime
# Initialize I2C communication
i2c = machine.I2C(scl=machine.Pin(22), sda=machine.Pin(21), freq=400000)
# Set timer mode to weekly
i2c.writeto(0x20, bytearray([0x03]))
# Set timer value to Sunday at 10:00 AM
i2c.writeto(0x20, bytearray([0x07, 0x10, 0x00]))
while True:
    # Check timer status
    status = i2c.readfrom(0x20, 1)[0]
    if status == 2:
        # Timer triggered, execute event
        print("Weekly timer triggered!")
        # Execute your MicroPython script here
        utime.sleep(1)
```
These examples demonstrate the versatility of the Programmable Digital Timer Module in various IoT applications. By using the provided software functions and commands, you can program the timer module to suit your specific needs.