DF Robot Encoder Module - Horizontal
This is an 8421 absolute position encoder (Horizontal) with 16-gear code(0-F). The mechanical position determines the uniqueness of each position of the encoder. Compared to a potentiometer, it doesn't require memory, reference point and constant counting. Whenever you need the position, you can just easily read it. In this case, the anti-interference of the encoder and the reliability of the data are greatly improved. And because of the absolute uniqueness of each position, the anti-interference ability, and no power-off memory function required, this product is widely used in many kinds of industrial systems for device status controlling.
Quick Spec
- Operating Current: 150mA, 42V
- 8421 Encode: 16-gear(0-F)
- Service Life: 10000 steps
- Operating Temperature: -40 ~ +85°C
- Mounting Aperture: 2.0mm
- Mounting Hole Pitch: 15mm
- Dimension: 14 x 19mm
- Net Weight: 9g
Pinout

Pin Number | Label | Description |
---|---|---|
1 | 8 | 8421 BCD code 8 port |
2 | 4 | 8421 BCD code 4 port |
3 | 2 | 8421 BCD code 2 port |
4 | 1 | 8421 BCD code 1 port |
5 | C | Common Port-Connect to VCC |
6 | X | Common Port-Connect to GND |
Truth Table

Wiring Diagram

Sample Code
/**************************************************************************/
/*
@file DFR0722_V10_Demo.ino
@author PowerLiao (DFRobot)
@version V1.0
@date 2020-07-09
@copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
@licence The MIT License (MIT)
@breif This example read and print the 8421 encoder code.
This demo and related libraries are for [DFR0722]8421 Encoder-Horizontal(V1.0)
Check out the links below for tutorials and connection diagrams
Product(CH): http://www.dfrobot.com.cn/
Product(EN): https://www.dfrobot.com/
*/
/**************************************************************************/
#define setbit(data,b) (data|=(1<<b)) //set the b bit of data to 1
#define clrbit(data,b) (data&=~(1<<b)) //set the b bit of data to 0
uint8_t code8421 = 0;
const uint8_t code8Pin = 5;
const uint8_t code4Pin = 4;
const uint8_t code2Pin = 3;
const uint8_t code1Pin = 2;
void setup() {
Serial.begin(115200);
Serial.println("8421 Encoder Starts up!");
pinMode(code8Pin, INPUT);
pinMode(code4Pin, INPUT);
pinMode(code2Pin, INPUT);
pinMode(code1Pin, INPUT);
}
void loop() {
//According to the pin level and set the corresponding bit to 0 or 1
if (digitalRead(code8Pin) == HIGH){
setbit(code8421, 3);
}else{
clrbit(code8421, 3);
}
if (digitalRead(code4Pin) == HIGH){
setbit(code8421, 2);
}else{
clrbit(code8421, 2);
}
if (digitalRead(code2Pin) == HIGH){
setbit(code8421, 1);
}else{
clrbit(code8421, 1);
}
if (digitalRead(code1Pin) == HIGH){
setbit(code8421, 0);
}else{
clrbit(code8421, 0);
}
//Output the code in hexadecimal
Serial.print("Now code8421 is: ");
Serial.println(code8421, HEX);
delay(1000);
}
Resourcees
Shipping List
- 1 x 8421 Encoder - Horizontal
- 1 x Knob
DF Robot Encoder Module - Horizontal
- Brand: DF Robot
- Product Code: DFR0722
- Weight: 0.009kg
- Product Status : Active
Stock
Warehouse | Stock Status | Location |
---|---|---|
Centurion | Limited Stock | B82 |
Stellenbosch | No Stock |
We ship free of charge between branches to complete your order.
-
R78.00 (Inc Tax: R89.70)
Related Products
EC11 20 Step Rotary Encoder with Switch - 20mm
EC11 20 Step Rotary Encoder with Switch - 20mm Rotary encoders has full rotation without limits. They output gray code so that you can tell how much and in which direction the encoder has been t..
R9.00 (Inc Tax: R10.35)
EC11 Encoder Module
EC11 Encoder Module This is an incremental rotary encoder that encodes the rotation by electronic pulse, each output encodes clockwise and counterclockwise with 20 pulses per circle. Unlike rotary po..
R60.00 (Inc Tax: R69.00)
DF Robot EC11 Rotary Encoder
DF Robot EC11 Rotary Encoder The DFRobot 360 degree rotary encoder module is based and designed on the EC11 rotary encoder button. The module has three signal terminals: terminals A & B are encod..
R68.00 (Inc Tax: R78.20)
EC11 Vertical Encoder - 15mm
EC11 Vertical Encoder - 15mm Rotary encoders has full rotation without limits. They output grey code so that you can tell how much and in which direction the encoder has been turned. Pressing down ..
R11.00 (Inc Tax: R12.65)
DF Robot Rotary Encoder Module
DF Robot Rotary Encoder Module This looks like a potentiometer, but it’s an encoder switch. It is a cascadable 360 ° rotary encoder switch with 20 pulses per revolution, and each pulse corresponds ..
R202.00 (Inc Tax: R232.30)
Tags: encoder, module, horizontal, rotary, 8421