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

How to Use Adafruit NeoKey FeatherWing: Examples, Pinouts, and Specs

Image of Adafruit NeoKey FeatherWingDesign with Adafruit NeoKey FeatherWing in Cirkit Designer

Introduction

The Adafruit NeoKey FeatherWing (Part ID: 4979) is a versatile input device designed to integrate seamlessly with Adafruit Feather boards. It features two mechanical key switches with customizable RGB LED backlighting, making it ideal for creating compact keyboards, control interfaces, or interactive projects. The NeoKey FeatherWing simplifies the process of adding tactile input and vibrant lighting to your Feather-based designs.

Explore Projects Built with Adafruit NeoKey FeatherWing

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 Biometric and RFID Security System with Dual Adafruit Feather nRF52840 Controllers: A project utilizing Adafruit NeoKey FeatherWing in a practical application
Biometric and RFID Security System with Dual Adafruit Feather nRF52840 Controllers

This circuit features two Adafruit Feather nRF52840 microcontrollers, each interfaced with an RFID-RC522 module for RFID communication and an AT24C256 external EEPROM for additional memory storage. One of the microcontrollers is also connected to an R307 Fingerprint Sensor for biometric input, and both microcontrollers are powered by a shared power supply and a coin cell breakout for backup or RTC power. The circuit is likely designed for secure access control or identification purposes, utilizing both RFID and fingerprint authentication, with data storage capabilities.

Open Project in Cirkit Designer
Image of Solar-Powered Environmental Data Logger with Adafruit Feather M0 Express: A project utilizing Adafruit NeoKey FeatherWing in a practical application
Solar-Powered Environmental Data Logger with Adafruit Feather M0 Express

This circuit is designed for environmental data collection and logging, utilizing an Adafruit Feather M0 Express microcontroller as the central processing unit. It interfaces with a BME280 sensor for atmospheric temperature, humidity, and pressure measurements, an SGP30 sensor for monitoring air quality (eCO2 and TVOC), and a STEMMA soil sensor for detecting soil moisture and temperature. The system is powered by a solar panel and a 3.7v LiPo battery, managed by an Adafruit BQ24074 Solar-DC-USB Lipo Charger, and provides easy access to the microcontroller's connections through an Adafruit Terminal Breakout FeatherWing.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The Adafruit NeoKey FeatherWing is designed to be user-friendly and compatible with a wide range of Feather boards. Below are its key technical details:

Key Features

Pin Configuration and Descriptions

The NeoKey FeatherWing connects directly to Feather boards via its headers. Below is the pinout:

Pin Name Description
3V 3.3V Power Power input for the FeatherWing (3.3V logic level).
GND Ground Ground connection.
SCL I2C Clock Line Serial clock line for I2C communication.
SDA I2C Data Line Serial data line for I2C communication.
A0 Address Select Optional pin for configuring the I2C address (via solder jumper modification).

Usage Instructions

How to Use the NeoKey FeatherWing in a Circuit

  1. Attach the FeatherWing: Plug the NeoKey FeatherWing into the headers of your Feather board. Ensure proper alignment of the pins.
  2. Install Key Switches: Insert two mechanical key switches into the Kailh-compatible sockets. Add keycaps if desired.
  3. Connect Power: The Feather board will supply 3.3V power to the FeatherWing.
  4. I2C Communication: The FeatherWing communicates with the Feather board via the I2C protocol. Ensure no address conflicts with other I2C devices.
  5. Install Libraries: Use the Adafruit NeoPixel and Adafruit Seesaw libraries to control the RGB LEDs and read key presses.

Important Considerations and Best Practices

Example Code for Arduino UNO-Compatible Feather Boards

Below is an example of how to use the NeoKey FeatherWing with an Adafruit Feather board:

#include <Wire.h>
#include "Adafruit_NeoPixel.h"
#include "Adafruit_seesaw.h"

// Create a seesaw object for the NeoKey FeatherWing
Adafruit_seesaw neokey;

// Define the NeoPixel pin and number of LEDs
#define NEOKEY_NEOPIXEL_PIN 3
#define NUMPIXELS 2

Adafruit_NeoPixel pixels(NUMPIXELS, NEOKEY_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  Serial.begin(115200);
  while (!Serial) delay(10); // Wait for Serial Monitor to open

  // Initialize the NeoKey FeatherWing
  if (!neokey.begin(0x30)) { // Default I2C address is 0x30
    Serial.println("Failed to find NeoKey FeatherWing!");
    while (1) delay(10);
  }
  Serial.println("NeoKey FeatherWing initialized!");

  // Initialize the NeoPixel LEDs
  pixels.begin();
  pixels.setBrightness(50); // Adjust brightness (0-255)
  pixels.show(); // Turn off all LEDs initially
}

void loop() {
  // Check if a key is pressed
  uint8_t keyPressed = neokey.digitalReadBulk();
  if (keyPressed & 0x01) { // Check if key 1 is pressed
    Serial.println("Key 1 pressed!");
    pixels.setPixelColor(0, pixels.Color(255, 0, 0)); // Red for key 1
  } else {
    pixels.setPixelColor(0, 0); // Turn off LED for key 1
  }

  if (keyPressed & 0x02) { // Check if key 2 is pressed
    Serial.println("Key 2 pressed!");
    pixels.setPixelColor(1, pixels.Color(0, 0, 255)); // Blue for key 2
  } else {
    pixels.setPixelColor(1, 0); // Turn off LED for key 2
  }

  pixels.show(); // Update the LEDs
  delay(50); // Small delay for debounce
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. NeoKey FeatherWing Not Detected:

    • Ensure the FeatherWing is properly seated on the Feather board.
    • Verify the I2C address matches the one in your code (0x30 by default).
    • Check solder jumpers if you modified the I2C address.
  2. RGB LEDs Not Lighting Up:

    • Confirm the NeoPixel library is installed and correctly initialized.
    • Check the power supply; insufficient current can cause LED issues.
    • Verify the brightness setting in your code.
  3. Key Presses Not Detected:

    • Ensure the mechanical switches are fully inserted into the sockets.
    • Test the switches with a multimeter to confirm functionality.
    • Check the digitalReadBulk() function for proper key state detection.

FAQs