DF Robot Encoder Module - Vertical

This is an 8421 absolute position encoder(Vertical) 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: 2mm
  • Mounting Hole Pitch: 15 x 15mm
  • Dimension: 19 x 19mm
  • Net Weight: 9g

Pinout

54dc1bb055ab9e86f3c6304f361a73f5 96e45748f28edce5f889180eeaa070a4
   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   

Wiring Diagram

9ebd4f0bc9a2d2b7573ecf8fc277898b

Sample Code



/**************************************************************************/
/*!
 * @file DFR0721_V10_Demo.ino
 * @brief This example read and print the 8421 encoder code.
 * @copyright  Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
 * @licence     The MIT License (MIT)
 * @author [PowerLiao]([email protected])
 * @version  V1.0
 * @date  2020-07-09
 * @get from 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);
}


Resources

Shipping List

  • 1 x 8421 Encoder - Vertical
  • 1 x Knob


DF Robot Encoder Module - Vertical

  • Brand: DF Robot
  • Product Code: DFR0721
  • Weight: 0.009kg
  • Product Status : Active
  • Stock

    Warehouse Stock Status Location
    Centurion Limited Stock AA056
    Stellenbosch In Stock T21
    Bulk Location No Stock

    We ship free of charge between branches to complete your order.

  • R79.00 (Inc Tax: R90.85)


Related Products

EC11 20 Step Rotary Encoder with Switch - 20mm

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..

Centurion (In Stock)
Stellenbosch (In Stock)
Bulk Location (No Stock)
Part No: EC11-VER-20
Product Status : Active

R9.00 (Inc Tax: R10.35)

EC11 Encoder Module

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..

Centurion (No Stock)
Stellenbosch (No Stock)
Bulk Location (No Stock)
Part No: SMEC11EN
Product Status : Active

R60.00 (Inc Tax: R69.00)

DF Robot EC11 Rotary Encoder

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..

Centurion (In Stock)
Stellenbosch (In Stock)
Bulk Location (No Stock)
Part No: SEN0235
Product Status : Active

R68.00 (Inc Tax: R78.20)

EC11 Vertical Encoder - 15mm

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 ..

Centurion (In Stock)
Stellenbosch (In Stock)
Bulk Location (No Stock)
Part No: EC11-VS-15
Product Status : Active

R11.00 (Inc Tax: R12.65)

DF Robot Rotary Encoder Module

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 ..

Centurion (In Stock)
Stellenbosch (In Stock)
Bulk Location (No Stock)
Part No: SEN0502
Product Status : Active

R202.00 (Inc Tax: R232.30)

Tags: encoder, module, vertical, rotary, 8421