Volume discounts:
  • +100 4 % $0.48
  • +500 6 % $0.47
  • +1000 8 % $0.46
  • +5000 10 % $0.45
  • +10000 12 % $0.44
Shop with confidence Learn More
Availability: 3873 items
Ships in 2-3 business days, then:
Free delivery in 10-15 days by YunExpress on orders over $35.
Free delivery in 5-7 days by DHL on orders over $200.
More shipping info

The KY-040 Rotary Encoder Module with Push Switch is a versatile electronic component designed for precise rotary motion and push-button functionality. It's commonly used in a variety of projects including DIY electronics, robotics, 3D printers, and more. This module combines a rotary encoder with a push switch, offering users a compact and efficient input solution for their projects.

Specifications of E38S6G5 360PPR 2-Phase Optical Incremental Rotary Encoder

  • Size: 3.1mm x 1.8mm
  • Input Voltage: 5V DC.
  • Output Type: Digital signals (quadrature-encoded) for rotation and a digital signal for the push-button switch.

Key features of KY-040 Rotary Encoder Module with Push Switch

  • Push Switch: The integrated push-button switch offers additional functionality and user interaction, allowing for selection or confirmation actions in various applications.
  • Incremental Encoding: The rotary encoder employs incremental encoding, providing accurate feedback on rotational movement.
  • Compact Design: With its small form factor, the KY-040 module can be easily integrated into various electronic projects without taking up much space.
  • Compatible with Various Platforms: It is compatible with popular microcontroller platforms such as Arduino, Raspberry Pi, and others, making it easy to incorporate into existing projects.
  • Durable Construction: The module is built with durable materials, ensuring longevity and reliability even in demanding applications.


Avoid applying excessive force when rotating the encoder or pressing the push button to prevent damage to the module.

Pinout of KY-040 Rotary Encoder Module with Push Switch

  • CLK (Clock Pin): Connects to the microcontroller's digital input pin to receive A channel signals from the rotary encoder.
  • DT (Data Pin): Connects to the microcontroller's digital input pin to receive B channel signals from the rotary encoder.
  • SW (Switch Pin): Connects to the microcontroller's digital input pin to detect the state of the push-button switch.
  • + (Positive Pin): Connects to the microcontroller's positive power supply (5V typically).
  • - (Ground Pin): Connects to the microcontroller's ground (GND) pin for reference.
  • SEN-23-002-Pinout.jpg

What is the difference between brush encoders like KY-040 and optical encoders like HN3806?

The main differences between brush encoders like the KY-040 and optical encoders like the HN3806 lie in their working principles, construction, accuracy, and environmental robustness:

Working Principle:

  • Brush Encoders (KY-040): Brush encoders use brushes or contact points to make electrical connections as the encoder shaft rotates. They rely on physical contact between the conducting surfaces to detect movement and provide feedback.
  • Optical Encoders (HN3806): Optical encoders, on the other hand, use light beams and sensors to detect changes in position. They typically consist of a light source, a disc with transparent and opaque segments, and sensors that detect the light passing through the disc. As the disc rotates, the sensors detect changes in the pattern of light, providing position feedback.


  • Brush Encoders (KY-040): Brush encoders usually have a simpler construction with fewer components. They often consist of a rotary encoder and a push-button switch integrated into a single module, as seen in the KY-040.
  • Optical Encoders (HN3806): Optical encoders tend to have more complex constructions due to the inclusion of light sources, optical discs, and sensors. They require careful alignment of these components to ensure accurate position detection.

Accuracy and Resolution:

  • Brush Encoders (KY-040): Brush encoders typically offer lower resolution and accuracy compared to optical encoders. They are suitable for applications where moderate precision is sufficient.
  • Optical Encoders (HN3806): Optical encoders provide higher resolution and accuracy due to their precise optical detection mechanism. They are used in applications requiring fine positional control and accuracy.

Environmental Robustness:

  • Brush Encoders (KY-040): Brush encoders may be more susceptible to wear and tear over time due to the physical contact between the brushes and conductive surfaces. They may also be affected by factors such as dust and debris.
  • Optical Encoders (HN3806): Optical encoders are generally more robust in harsh environments because they do not rely on physical contact for operation. They are less affected by factors like dust, dirt, and vibrations, making them suitable for demanding industrial applications.

In summary, while both brush encoders like the KY-040 and optical encoders like the HN3806 serve similar purposes of providing position feedback, they differ significantly in their working principles, construction, accuracy, and environmental robustness. The choice between them depends on the specific requirements and constraints of the application.

You can see more encoders on this link.



Can the KY-040 Rotary Encoder Module be used with an Arduino board?


Yes, the module is fully compatible with Arduino boards. It can be easily connected and programmed using Arduino IDE.


What is the purpose of the push switch on the module?


The push switch allows users to trigger actions or events within their projects with a simple press, adding versatility to the module's functionality.


How precise is the rotary encoder's feedback?


The rotary encoder provides high precision feedback, typically with a resolution of 20 pulses per revolution, enabling accurate measurement of rotational movement.


Is the module suitable for use in industrial applications?


While the module is primarily designed for hobbyist and DIY projects, its durable construction and reliable performance make it suitable for certain light-duty industrial applications.


Brush encoders and optical encoders, which one is suitable for long-term use?


While both brush encoders and optical encoders serve similar functions of providing position feedback, optical encoders generally offer greater durability due to their non-contact operation, resistance to environmental factors, and lower maintenance requirements. Brush encoders may still be suitable for certain applications but may require more frequent maintenance and have a shorter lifespan compared to optical encoders.

Write Your Own Review
You're reviewing:KY-040 Rotary Encoder Module with Push Switch
Your Rating
Customer Questions
No Questions
Did you find what you were looking for?