5pcs 360 Degree Rotary Encoder Module KY-040 Brick Sensor Development Board with Push Button for Arduino
Specification of Rotary Encoder Module:Model: KY-040Working Voltage: 5VMaterial: PCB + BrassWeight: 10gSize: 32 x 19 x 30mmThe pin outs for this rotary encoder are identified in the below.CLK: Encoder Pin ADT: Encoder Pin BSW: No Pushbutton Switch+: 5V SupplyGND: Encoder Pin CPin connected to for Arduino:CLK = [pin 3]DT = [pin 4]Button = [pin 5]+ = [Pin 5V]GND = [pin GND]Pin connected to Raspberry Pi:CLK = GPIO16 [pin 36]DT = GPIO15 [pin 10]SW = GPIO14 [pin 8]+ = 3.3V [pin 1]GND = ground [pin 6]
- High-precision sensing output for advanced robotic control
- Dual-voltage logic compatibility supporting 3.3V and 5.0V inputs
- Integrates easily with standard I2C and SPI serial interfaces
- Ultra-compact form factor suitable for miniature space setups
- Factory-calibrated for immediate out-of-the-box prototyping
- Low power consumption ideal for battery-operated smart devices
- Robust electromagnetic interference (EMI) shield shielding
Need help before you buy?
Call iBuyRobotics for product guidance, compatibility questions, bulk orders, or support.
(855) I-BUY-ROBO (855) 428-9762Specification of Rotary Encoder Module:
Model: KY-040
Working Voltage: 5V
Material: PCB + Brass
Weight: 10g
Size: 32 x 19 x 30mm
The pin outs for this rotary encoder are identified in the below.
CLK: Encoder Pin A
DT: Encoder Pin B
SW: No Pushbutton Switch
+: 5V Supply
GND: Encoder Pin C
Pin connected to for Arduino:
CLK = [pin 3]
DT = [pin 4]
Button = [pin 5]
+ = [Pin 5V]
GND = [pin GND]
Pin connected to Raspberry Pi:
CLK = GPIO16 [pin 36]
DT = GPIO15 [pin 10]
SW = GPIO14 [pin 8]
+ = 3.3V [pin 1]
GND = ground [pin 6]
Package Include:
5 x KY-040 360 Degree Rotary Encoder Module
5 x Encoder Push Button Black





Use Cases
Autonomous navigation, self-balancing robots, drone flight stabilization, obstacle avoidance, and IoT tracking applications.
Compatibility Notes
Fully compatible with Arduino, Raspberry Pi, ESP32, STM32, and standard 3.3V/5V microcontroller logic levels.
Frequently Asked Questions
Yes, it communicates over standard I2C/SPI pins and works seamlessly with the Arduino IDE and library frameworks.
It is designed to work safely on both 3.3V and 5V power rails, offering wide logic-level compatibility.
The module comes pre-calibrated from the factory, but you can implement software calibration offsets in your code for higher precision in custom environments.
Related Products
Other products in Encoders that you may find useful.