The Adafruit IoT Button with NeoPixel BFF (Part ID: 5297) is a compact, programmable button designed for Internet of Things (IoT) applications. It features a built-in NeoPixel RGB LED for customizable visual feedback, making it an excellent choice for interactive projects, smart home automation, and remote event triggering. This button can be integrated into various IoT platforms to perform tasks such as sending notifications, controlling devices, or logging events with a simple press.
The IoT Button with NeoPixel BFF is designed to be compact and easy to integrate into IoT projects. Below are its key technical details:
Parameter | Specification |
---|---|
Manufacturer | Adafruit |
Part ID | 5297 |
Operating Voltage | 3.3V to 5V |
Current Consumption | ~20mA (idle), up to 60mA (with NeoPixel) |
Communication Protocol | GPIO (button press) |
LED Type | NeoPixel RGB LED |
Dimensions | 20mm x 20mm x 5mm |
The IoT Button with NeoPixel BFF has the following pin configuration:
Pin Name | Description |
---|---|
VIN | Power input (3.3V to 5V) |
GND | Ground connection |
BTN | Button output signal (active low, connects to GPIO pin on microcontroller) |
DIN | Data input for NeoPixel (connect to microcontroller GPIO for control) |
DOUT | Data output for NeoPixel (used for chaining additional NeoPixels) |
The IoT Button with NeoPixel BFF is straightforward to use in a circuit. Below are the steps to integrate and program the button:
VIN
pin to a 3.3V or 5V power source and the GND
pin to ground.BTN
pin to a GPIO pin on your microcontroller. The button is active low, meaning it outputs a low signal when pressed.DIN
pin to a GPIO pin on your microcontroller for NeoPixel control. If chaining additional NeoPixels, connect the DOUT
pin to the DIN
of the next NeoPixel.Below is an example code snippet to read the button press and control the NeoPixel using an Arduino UNO:
#include <Adafruit_NeoPixel.h>
// Define pin connections
#define BUTTON_PIN 2 // GPIO pin connected to the button (BTN)
#define NEOPIXEL_PIN 6 // GPIO pin connected to the NeoPixel (DIN)
// Initialize NeoPixel (1 LED)
Adafruit_NeoPixel pixel = Adafruit_NeoPixel(1, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP); // Set button pin as input with pull-up resistor
pixel.begin(); // Initialize NeoPixel
pixel.show(); // Turn off all pixels initially
}
void loop() {
// Check if the button is pressed
if (digitalRead(BUTTON_PIN) == LOW) {
// Button is pressed, turn NeoPixel green
pixel.setPixelColor(0, pixel.Color(0, 255, 0)); // Green color
pixel.show();
delay(200); // Debounce delay
} else {
// Button is not pressed, turn NeoPixel off
pixel.setPixelColor(0, pixel.Color(0, 0, 0)); // Turn off
pixel.show();
}
}
NeoPixel Not Lighting Up
DIN
connection and ensure the power supply can handle the current draw.Button Not Responding
INPUT_PULLUP
in your code.Flickering NeoPixel
Button Press Registers Multiple Times
Q: Can I use multiple IoT Buttons in one project?
A: Yes, you can connect multiple buttons to different GPIO pins on your microcontroller. Ensure each button has a unique pin assignment.
Q: How many NeoPixels can I chain to this button?
A: The number of NeoPixels you can chain depends on your power supply and microcontroller's memory. Each NeoPixel requires ~60mA at full brightness.
Q: Is the button waterproof?
A: No, the IoT Button with NeoPixel BFF is not waterproof. Use it in dry environments or enclose it in a waterproof case for outdoor use.
Q: Can I use this button with platforms other than Arduino?
A: Yes, the button is compatible with any microcontroller that supports GPIO and NeoPixel control, such as Raspberry Pi, ESP32, or STM32.