Stufin
Home Quick Cart Profile

PS2 Keyboard Driver Module

Buy Now on Stufin

Operating Voltage

3.3V or 5V (dependent on the host device's voltage requirements)

Current Consumption

Typically 10-20mA

Data Transfer Rate

Up to 12,000 bps (dependent on the host device's baud rate)

Interface

PS2 keyboard connector, with optional interfaces (UART, SPI, I2C) for connection to the host device

Dimensions

Varying dimensions depending on the package type (DIP or SMD)

Typical Applications

  • IoT Projects: The PS2 Keyboard Driver Module is suitable for various IoT projects, such as home automation, robotics, and industrial control systems.
  • Single-Board Computers: The module is compatible with popular single-board computers, including Raspberry Pi and Arduino boards.
  • Microcontroller-Based Projects: The module can be used with a wide range of microcontrollers, enabling keyboard input in various applications.

By providing a reliable and efficient way to connect PS2 keyboards to microcontrollers and single-board computers, the PS2 Keyboard Driver Module is an essential component for various IoT projects and applications.

Pin Configuration

  • PS2 Keyboard Driver Module Documentation
  • The PS2 Keyboard Driver Module is a compact and versatile component designed to facilitate communication between a PS2 keyboard and a microcontroller or a computer. This module is equipped with a 6-pin interface, which enables easy connection and integration with a wide range of devices. Below is a comprehensive explanation of each pin, along with instructions on how to connect them.
  • Pin Structure:
  • The PS2 Keyboard Driver Module features a 6-pin interface, with the following pinout:
  • Pin 1: VCC (Power Supply)
  • + Function: Provides power to the module
  • + Connection: Connect to a 3.3V or 5V power supply (depending on the module's specifications)
  • Pin 2: GND (Ground)
  • + Function: Provides a common ground reference for the module
  • + Connection: Connect to the ground pin of the power supply or the microcontroller
  • Pin 3: _CLK (Clock Signal)
  • + Function: Carries the clock signal from the microcontroller to the keyboard
  • + Connection: Connect to the clock pin of the microcontroller or the keyboard
  • Pin 4: DATA (Data Signal)
  • + Function: Carries the data signal from the keyboard to the microcontroller
  • + Connection: Connect to the data pin of the microcontroller or the keyboard
  • Pin 5: Reset
  • + Function: Used to reset the keyboard interface
  • + Connection: Connect to the reset pin of the microcontroller or a pull-up resistor (if not used)
  • Pin 6: _VDD (Voltage Detector)
  • + Function: Detects the voltage level of the power supply
  • + Connection: Connect to a voltage monitoring circuit or a pull-up resistor (if not used)
  • Connection Structure:
  • To connect the PS2 Keyboard Driver Module to a microcontroller or a computer, follow these steps:
  • 1. Power Supply Connection:
  • Connect Pin 1 (VCC) to a 3.3V or 5V power supply (depending on the module's specifications).
  • Connect Pin 2 (GND) to the ground pin of the power supply.
  • 2. Clock and Data Signal Connection:
  • Connect Pin 3 (CLK) to the clock pin of the microcontroller or the keyboard.
  • Connect Pin 4 (DATA) to the data pin of the microcontroller or the keyboard.
  • 3. Reset Connection:
  • Connect Pin 5 (Reset) to the reset pin of the microcontroller or a pull-up resistor (if not used).
  • 4. Voltage Detector Connection:
  • Connect Pin 6 (VDD) to a voltage monitoring circuit or a pull-up resistor (if not used).
  • Important Notes:
  • Ensure that the power supply voltage matches the module's specifications to avoid damage.
  • Use a level shifter or a voltage regulator if the microcontroller or computer operates at a different voltage level than the module.
  • Refer to the module's datasheet and the microcontroller's documentation for specific connection details and programming requirements.
  • By following these connection guidelines and understanding the pin structure, you can successfully integrate the PS2 Keyboard Driver Module into your IoT project and enable seamless communication between the keyboard and the microcontroller or computer.

Code Examples

PS2 Keyboard Driver Module Documentation
Overview
The PS2 Keyboard Driver Module is a microcontroller-compatible module designed to interface with standard PS2 keyboards. It provides a simple and efficient way to integrate PS2 keyboard functionality into IoT projects, robots, and other embedded systems.
Module Pinout
The PS2 Keyboard Driver Module has a 6-pin interface:
VCC: Power supply (3.3V or 5V)
 GND: Ground
 CLK: Clock signal from the PS2 keyboard
 DATA: Data signal from the PS2 keyboard
 INT: Interrupt signal to the microcontroller (optional)
 RST: Reset signal to the PS2 keyboard (optional)
Software Interface
The PS2 Keyboard Driver Module communicates with the microcontroller using a serial interface. The module sends keyboard scan codes to the microcontroller, which can then be interpreted to determine the pressed keys.
Code Examples
### Example 1: Basic PS2 Keyboard Interface using Arduino
This example demonstrates how to use the PS2 Keyboard Driver Module with an Arduino Uno board to read keyboard input.
```cpp
#include <PS2Keyboard.h>
const int clkPin = 2;  // Clock pin
const int dataPin = 3;  // Data pin
PS2Keyboard keyboard;
void setup() {
  Serial.begin(9600);
  keyboard.begin(clkPin, dataPin);
}
void loop() {
  if (keyboard.available()) {
    char c = keyboard.read();
    Serial.print(c);
  }
}
```
In this example, the Arduino Uno board is connected to the PS2 Keyboard Driver Module, and the `PS2Keyboard` library is used to read keyboard input. The `available()` function checks if there is any data available from the keyboard, and the `read()` function retrieves the next character.
### Example 2: PS2 Keyboard Interface using Raspberry Pi (Python)
This example demonstrates how to use the PS2 Keyboard Driver Module with a Raspberry Pi board to read keyboard input using Python.
```python
import RPi.GPIO as GPIO
import time
clkPin = 17  # Clock pin
dataPin = 23  # Data pin
GPIO.setmode(GPIO.BCM)
GPIO.setup(clkPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(dataPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
    if GPIO.input(clkPin) == 0:
        data = []
        for i in range(11):
            data.append(GPIO.input(dataPin))
            time.sleep(0.01)
        print("Scan code:", data)
    time.sleep(0.1)
```
In this example, the Raspberry Pi board is connected to the PS2 Keyboard Driver Module, and the `RPi.GPIO` library is used to read the keyboard scan codes. The code uses the clock signal to synchronize with the keyboard and reads the data signal to retrieve the scan code.
Note: These examples are for illustration purposes only and may require modifications to work with specific hardware configurations. Be sure to consult the datasheet and documentation for your microcontroller or single-board computer for specific implementation details.