Why in the world is capslock led so tiny?!? Here is a minimal project to get a capslock-notifier as big as you want!
You can use any container you like for the caps-lock led:
Just puth the led inside it and connect it to pin 17 of Arduino Micro (or any Arduino equipped with ATmega32u4)
#include "HID-Project.h"
const int statusLed = 17; // "alive" status LED
const int warningLed = 3;
void setup() {
pinMode(statusLed, OUTPUT);
pinMode(warningLed, OUTPUT);
// Sends a clean report to the host. This is important on any Arduino type.
BootKeyboard.begin();
}
void loop() {
digitalWrite(statusLed, HIGH); // Inform user that loop is running
if (BootKeyboard.getLeds() & LED_CAPS_LOCK) {
digitalWrite(warningLed, HIGH);
} else {
digitalWrite(warningLed, LOW);
}
}
That's all.
(See reference code)
This project relies on various libraries, depending on the board:
- Arduino Pro Micro: HID library by NicoHood, you need to install it in Arduino IDE (minimum 1.6.7) before compiling the project.
- ESP32:
- Waveshare RP2040 zero: keyboard.h (pre-included in IDE?)
- All: Adafruit Neopixel (for RGB LED control).
- Arduino Pro Micro due to very small form factor but other models are compatible with HIDlibrary (Leonardo, Zero, any mounting 32u4).
- RP2040-zero (Raspberry PI) (9,00) (How to program it with Arduino IDE)
- ESP32-S2-mini (8,00 euro)
- Uno (requires HoodLoader2)
- Mega (requires HoodLoader2)
- AtTiny85 (9,00 euro)
- RP2040-one (Raspberry PI) (12,00, no USB cable) (How to program it with Arduino IDE)
- ESP32-S3-mini (12,00 euro)
Keyboard is not just an input device, it's also an output device! You can verify it by yourself: if you connect two keyboards to same PC, upon enabling CAPSLOCK on one keyboard, the CAPSLOCK on the other keyboard will light up!
This sketch enables the Arduino board to behave like a keyboard, receiving input from the "actual" keyboard connected to the PC: upon detecting CAPSLOCK press, it lights up a big led which you can't miss.
Some of the sketches support setting up led color using command R,G,B from serial (ex: 0,0,255 will set led to blue). Usa free+portable Tera Term for Windows.





