

The Grove-LED Button is a versatile electronic component that combines a push-button switch with an integrated LED indicator. This dual-functionality design allows users to control circuits while providing visual feedback when the button is pressed. The component is part of the Grove ecosystem, which simplifies prototyping and development with its plug-and-play modular design.








The Grove-LED Button is designed for ease of use and compatibility with a wide range of microcontrollers, including Arduino, Raspberry Pi, and others.
The Grove-LED Button uses a 4-pin Grove connector. The pinout is as follows:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply for the LED and button (3.3V-5V) |
| 2 | GND | Ground connection |
| 3 | Signal | Button signal output (HIGH when pressed) |
| 4 | LED | LED control pin (connect to microcontroller) |
The Grove-LED Button is straightforward to use in a circuit. Follow the steps below to integrate it into your project:
Hardware Setup:
Signal pin to a digital input pin on your microcontroller.LED pin to a digital output pin on your microcontroller.Circuit Example:
Signal pin to digital pin 2 and the LED pin to digital pin 13.Below is an example Arduino sketch to use the Grove-LED Button. The LED will light up when the button is pressed.
// Define pin connections
const int buttonPin = 2; // Signal pin connected to digital pin 2
const int ledPin = 13; // LED pin connected to digital pin 13
void setup() {
pinMode(buttonPin, INPUT); // Set button pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
digitalWrite(ledPin, LOW); // Ensure LED is off initially
}
void loop() {
int buttonState = digitalRead(buttonPin); // Read the button state
if (buttonState == HIGH) {
// If button is pressed, turn on the LED
digitalWrite(ledPin, HIGH);
} else {
// If button is not pressed, turn off the LED
digitalWrite(ledPin, LOW);
}
}
The LED does not light up:
LED pin is connected to a digital output pin on the microcontroller.The button press is not detected:
Signal pin is connected to a digital input pin on the microcontroller.The button or LED behaves erratically:
Q: Can I use the Grove-LED Button with a Raspberry Pi?
A: Yes, the Grove-LED Button is compatible with Raspberry Pi. Use the GPIO pins for the Signal and LED connections, and ensure the power supply is 3.3V.
Q: Can I change the LED color?
A: The LED color is fixed and depends on the specific model of the Grove-LED Button. Choose the appropriate variant (e.g., red, green, or blue) for your project.
Q: Do I need a resistor for the LED?
A: No, the Grove-LED Button has an integrated resistor for the LED, making it ready to use without additional components.
Q: How do I debounce the button?
A: Use a software debounce technique, such as adding a small delay (e.g., 50ms) after detecting a button press, to filter out noise.
By following this documentation, you can effectively integrate the Grove-LED Button into your projects and troubleshoot any issues that arise.