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

How to Use Adafruit NeoKey 1x4 QT I2C: Examples, Pinouts, and Specs

Image of Adafruit NeoKey 1x4 QT I2CDesign with Adafruit NeoKey 1x4 QT I2C in Cirkit Designer

Introduction

The Adafruit NeoKey 1x4 QT is a versatile and compact key switch module that features four individual keys. Each key is equipped with a NeoPixel RGB LED, allowing for customizable color feedback. The module communicates over I2C, making it simple to integrate into projects with limited GPIO availability. It also includes STEMMA QT connectors for quick and solderless connections. This component is ideal for creating custom keyboards, input devices, or interactive projects that require user input with visual feedback.

Common applications include:

Explore Projects Built with Adafruit NeoKey 1x4 QT I2C

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Nano-Based Dual 4x4 Keypad Interface with LCD Display and NRF24L01 Wireless Communication: A project utilizing Adafruit NeoKey 1x4 QT I2C in a practical application
Arduino Nano-Based Dual 4x4 Keypad Interface with LCD Display and NRF24L01 Wireless Communication

This circuit features an Arduino Nano microcontroller interfaced with two 4x4 membrane matrix keypads, an NRF24L01 wireless module, and a 20x4 I2C LCD display. The keypads are connected through resistors to the Arduino for input detection, while the NRF24L01 module enables wireless communication, and the LCD display provides visual output. The setup and loop functions in the Arduino code are placeholders for further development.

Open Project in Cirkit Designer
Image of Arduino Mega 2560-Based Smart Home Control System with LCD Display and Flame Sensor: A project utilizing Adafruit NeoKey 1x4 QT I2C in a practical application
Arduino Mega 2560-Based Smart Home Control System with LCD Display and Flame Sensor

This circuit is a multi-functional embedded system featuring an Arduino Mega 2560 microcontroller that interfaces with a 4x4 membrane keypad, a 20x4 I2C LCD, an 8x8 LED matrix, a DS3231 RTC module, a passive buzzer, and a KY-026 flame sensor. The system is powered by a 5V PSU and is designed to provide real-time clock functionality, user input via the keypad, visual output on the LCD and LED matrix, and flame detection with an audible alert.

Open Project in Cirkit Designer
Image of Arduino UNO R4 WiFi Controlled Access System with I2C LCD and Keypad: A project utilizing Adafruit NeoKey 1x4 QT I2C in a practical application
Arduino UNO R4 WiFi Controlled Access System with I2C LCD and Keypad

This circuit features an Arduino UNO R4 WiFi connected to an I2C LCD 16x2 Screen and a 4x4 Membrane Matrix Keypad. The Arduino controls the LCD to prompt for and display a password input from the keypad, granting or denying access based on the correctness of the entered password. The keypad's rows and columns are interfaced with the Arduino's digital pins, while the LCD uses I2C communication via the Arduino's analog pins configured for SDA and SCL.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 VCC Power supply (3.3V to 5V)
2 GND Ground connection
3 SDA I2C Data Line
4 SCL I2C Clock Line
5-8 K1-K4 Key inputs (not directly accessible, used internally)

Usage Instructions

Integrating with a Circuit

  1. Powering the Module: Connect the VCC pin to a 3.3V or 5V power supply, and the GND pin to the ground.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding SDA and SCL pins on your microcontroller (e.g., Arduino UNO).
  3. Address Configuration: If using multiple NeoKey modules, set unique I2C addresses using the solder jumpers on the back of the PCB.

Best Practices

Example Code for Arduino UNO

#include <Wire.h>
#include <Adafruit_NeoPixel.h>
#include <Adafruit_NeoKey_1x4.h>

// Define the I2C address for the NeoKey 1x4
#define NEOKEY_I2C_ADDRESS 0x30

// Create the NeoKey object
Adafruit_NeoKey_1x4 neokey = Adafruit_NeoKey_1x4();

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);

  // Initialize the NeoKey 1x4
  if (!neokey.begin(NEOKEY_I2C_ADDRESS)) {
    Serial.println("Failed to find NeoKey, check wiring!");
    while (1) delay(10);
  }
}

void loop() {
  // Read the key states
  uint8_t keyState = neokey.read();

  // Check each key and set the color accordingly
  for (int i = 0; i < 4; i++) {
    if (keyState & (1 << i)) {
      // If key is pressed, set to red
      neokey.setPixelColor(i, 255, 0, 0);
    } else {
      // If key is not pressed, set to green
      neokey.setPixelColor(i, 0, 255, 0);
    }
  }

  // Update the NeoPixels
  neokey.show();

  // Small delay to debounce
  delay(10);
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips

FAQs

Q: Can I use the NeoKey 1x4 with a 3.3V microcontroller? A: Yes, the NeoKey 1x4 is compatible with both 3.3V and 5V logic levels.

Q: How do I chain multiple NeoKey 1x4 modules together? A: Connect the STEMMA QT connectors from one module to the next, ensuring that each module has a unique I2C address.

Q: What type of key switches can I use with the NeoKey 1x4? A: The NeoKey 1x4 is designed to be compatible with Cherry MX style mechanical key switches.

Q: How do I change the color of the NeoPixels? A: Use the neokey.setPixelColor(index, red, green, blue) function, where index is the key number (0-3) and red, green, blue are the color values (0-255).