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](powerliao.hu@dfrobot.com)
 * @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
  • Stock

    Warehouse Stock Status Location
    Centurion Out Of Stock UL124
    Stellenbosch In Stock T21

    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

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
Stellenbosch

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
Stellenbosch

R60.00 (Inc Tax: R69.00)

EC11 Rotary Encoder

EC11 Rotary Encoder

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

Centurion
Stellenbosch

R55.00 (Inc Tax: R63.25)

EC11 Rotary Encoder

EC11 Rotary Encoder

EC11 Rotary Encoder A rotary or "shaft" encoder is an angular measuring device. It is used to precisely measure rotation of motors or to create wheel controllers (knobs) that can turn infinitely (w..

Centurion
Stellenbosch

R14.85 (Inc Tax: R17.08)

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
Stellenbosch

R9.00 (Inc Tax: R10.35)

Tags: encoder, module, vertical, rotary, 8421