+ 353 21 48 98 333
sales@irishelectronics.ie


EDHHD Trading Ltd t/a Irish Electronics

The Burren, Lackaroe,

Glenbrook, Passage West,

Co Cork. T12 WD8E

0

Irish Distributors for Velleman & Kitronik 

Please Click Here to leave a review on TRUSTPILOT after your purchase and delivery

Kitronik LAB:bit educational platform for BBC micro:bit  REDUCED FROM €47.97 to €36.00     CLICK HERE

See our reduced prices on our LAB Bench Power Supplies   CLICK HERE


See our digital gift card. After the purchase, you will receive an email with the gift card and instructions on how to use it. The card can be used as payment for any products we have. CLICK HEREļ»æ

Our Store

KY-040 Rotary Encoder Module Brick Sensor

€2.76
In stock: 9 available
Product Details

KY-040 Rotary Encoder Module Brick Sensor Development For Arduino

The Keyes KY-040 rotary encoder is a rotary input device (as in knob) that
provides an indication of how much the knob has been rotated AND what
direction it is rotating in.
Its a great device for stepper and servo motor control. You could also use it to
control devices like digital potentiometers.

Product information

By rotating the rotary encoder can be counted in the positive direction and the reverse direction during rotation of the output pulse frequency, unlike rotary potentiometer counter, which species rotation counts are not limited. With the buttons on the rotary encoder can be reset to its initial state, that starts counting from 0.

How it works: incremental encoder is a displacement of the rotary pulse signal is converted to a series of digital rotary sensors. These pulses are used to control angular displacement. In Eltra angular displacement encoder conversion using a photoelectric scanning principle. Reading system of alternating light transmitting window and the window is not consisting of radial indexing plate (code wheel) rotating basis, while being an infrared light source vertical irradiation light to the code disk image onto the receiving on the surface. Receiver is covered with a diffraction grating, which has the same code disk window width. The receiver's job is to feel the rotation of the disc resulting changes, and change the light into corresponding electrical changes. Then the low-level signals up to a higher level, and generates no interference square pulse, which must be processed by electronic circuits. Reading systems typically employ a differential manner, about the same but the phase difference of the two waveforms different by 180°compared to the signal in order to improve the quality and stability of the output signal. Reading is then the difference between the two signals formed on the basis,thus eliminating the interference.

USEFUL INFORMATION

Arduino Sketch

int pinA = 3Ķ¾ // Connected to CLK on KY­040
int pinB = 4Ķ¾ // Connected to DT on KY­040
int encoderPosCount = 0Ķ¾
int pinALastĶ¾
int aValĶ¾
boolean bCWĶ¾
void setup() {
pinMode (pinA,INPUT)Ķ¾
pinMode (pinB,INPUT)Ķ¾
/* Read Pin A
Whatever state it's in will reflect the last position
*/
pinALast = digitalRead(pinA)Ķ¾
Serial.begin (9600)Ķ¾
}
void loop() {
aVal = digitalRead(pinA)Ķ¾
if (aVal != pinALast){ // Means the knob is rotating
// if the knob is rotating, we need to determine direction
// We do that by reading pin B.
if (digitalRead(pinB) != aVal) { // Means pin A Changed first ­ We're Rotating Clockwise
encoderPosCount ++Ķ¾
bCW = trueĶ¾
} else {// Otherwise B changed first and we're moving CCW
bCW = falseĶ¾
encoderPosCount­ Ķ¾
}
Serial.print ("Rotated: ")Ķ¾
if (bCW){
Serial.println ("clockwise")Ķ¾
}else{
Serial.println("counterclockwise")Ķ¾
}
Serial.print("Encoder Position: ")Ķ¾
Serial.println(encoderPosCount)Ķ¾
}
pinALast = aValĶ¾
}

Save this product for later
Share this product with your friends
KY-040 Rotary Encoder Module Brick Sensor

Product out of stock? Contact us today for more information on restock dates and information!

Get in touch
Share by:
Privacy Policy Cookie Policy Privacy Policy