Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›Optical, Magnetic and Absolute Rotary Encoders

Comparison · Intermediate · 3 min read

Optical, Magnetic and Absolute Rotary Encoders

PPR, Output Types and Wiring

By Geekobot Learning Team · Updated 29 Oct 2026

On this page
Short answerIncremental, absolute, optical, magneticPPR, CPR and what you really getOutput types and wiringMagnetic encoders such as the AS5600Using one with a microcontrollerTry itCommon mistakesFAQsParts and next steps
Short answer

An incremental encoder gives pulses and counts movement from a start point. An absolute encoder reports the exact angle at power-up. Optical types are accurate and common in machines; magnetic types such as the AS5600 are compact and tolerate dust. Match the supply voltage, output type (NPN open collector, push-pull or SSI/I2C) and PPR to your controller before buying.

Key specs at a glance

Types
Incremental (A/B/Z), absolute (binary, SSI, I2C, SPI), magnetic and optical
Resolution
20 to 10,000+ PPR; absolute parts 10 to 12+ bits
Output
NPN open collector, push-pull/line driver, SSI, I2C, PWM
Supply
5 V, or 5 to 24 V on industrial housings
Shaft
Solid 6 to 8 mm, or hollow bore
Protection
Often IP50 to IP54; check the datasheet
01

Incremental, absolute, optical, magnetic

Pick the sensing method first, then the resolution.

TypeBest forWatch out for
Incremental optical (A/B/Z)Motors, conveyors, lathes, handwheelsLoses position when power is lost; homing needed
Absolute optical (parallel or SSI)Robot joints, positioning that must survive power-offMore wires or a serial protocol to read
Magnetic (AS5600, MT6816)Hobby servos, gimbals, knobs, compact buildsNeeds a magnet centred and at the right gap; stray fields hurt
Hand-wheel pulse generatorCNC and DIY jog wheelsLow PPR; not for precise control
Slot disc plus photo-interrupterCheap speed sensingCounts speed well, direction needs two sensors
Incremental optical (A/B/Z)
Best for:
Motors, conveyors, lathes, handwheels
Watch out for:
Loses position when power is lost; homing needed
Absolute optical (parallel or SSI)
Best for:
Robot joints, positioning that must survive power-off
Watch out for:
More wires or a serial protocol to read
Magnetic (AS5600, MT6816)
Best for:
Hobby servos, gimbals, knobs, compact builds
Watch out for:
Needs a magnet centred and at the right gap; stray fields hurt
Hand-wheel pulse generator
Best for:
CNC and DIY jog wheels
Watch out for:
Low PPR; not for precise control
Slot disc plus photo-interrupter
Best for:
Cheap speed sensing
Watch out for:
Counts speed well, direction needs two sensors
02

PPR, CPR and what you really get

A 600 PPR encoder read in quadrature gives 2,400 counts per turn. For a motor driving a lead screw or belt, divide the counts by the travel per turn to get the step size; the encoder resolution calculator does this. Higher PPR means finer resolution but also a higher pulse rate, so check the controller can count fast enough. See rotary encoders for the basic knob-style parts.

03

Output types and wiring

  • ✓NPN open collector (for example the HS-S32 family): the output pulls to ground. Add a pull-up resistor to your logic voltage, or use the controller's internal pull-up if the current is low.
  • ✓Push-pull / line driver: drives high and low; connect it directly if the voltage levels match.
  • ✓5 V parts on a 3.3 V board: use a level shifter or a divider; see logic-level shifting.
  • ✓Connect shield to ground at one end and keep the cable away from motor wires.
  • ✓A, B and Z (index) go to three input pins. Use hardware interrupts or a timer in encoder mode on STM32 and ESP32 rather than polling.
04

Magnetic encoders such as the AS5600

A magnetic encoder reads the angle of a diametric magnet fixed to the shaft. The AS5600 gives 12-bit angle over I2C, PWM or analog output, so it needs no counting at all. Keep the magnet centred within about a millimetre of the chip and at the gap in the datasheet. Check the reading for the whole turn before trusting it in a control loop. See Hall effect sensors for how the sensing works.

05

Using one with a microcontroller

  1. 1
    Read the datasheet for supply, output type and pin colours.
  2. 2
    Connect A and B to interrupt-capable pins, and Z to any input.
  3. 3
    Count edges with a library or hardware peripheral; the ESP32 has a pulse counter and STM32 timers have an encoder mode.
  4. 4
    Check direction by turning the shaft clockwise and watching the sign of the count.
  5. 5
    Reset the count on the index pulse for a repeatable zero.
  6. 6
    For a motor loop, see motor encoders.
06

Try it: Encoder resolution calculator

Change the values and the diagram and results update as you type.

07

Common mistakes to avoid

  • !Feeding a 24 V encoder output into a 3.3 V pin.
  • !Forgetting the pull-up resistor on an NPN open-collector output.
  • !Reading A/B by polling and missing pulses at speed.
  • !Mounting a magnet off-centre on a magnetic encoder.
  • !Running encoder cables beside motor power wires without a shield.
08

Frequently asked questions

What is the difference between PPR and CPR?

PPR counts the cycles on one channel per turn. CPR is the count after decoding both channels and all edges, which is 4 times PPR.

Do I need an absolute encoder?

Only if the position must be known after power loss without homing, for example a robot joint.

Can I use a 5 V encoder with an ESP32?

Only with level shifting or a divider on the signal lines, since ESP32 inputs are 3.3 V.

What does the Z or index pulse do?

It gives one pulse per turn at a fixed angle, used to reset the count or find home.

Optical or magnetic?

Optical gives high resolution in clean machines; magnetic is more compact and tolerates dust but needs correct magnet placement.

Parts for this guide

  • Rotary Encoder 1000PPR/4000CPR with Index – Optical, IP54, NPN Open Collector, 2m Cable
    ₹3,939View
  • HS-S32A Rotary Encoder – 600 PPR, NPN Open Collector, 5-24V DC
    ₹149View
  • Hengstler AC58 Series 0566003 Absolute Rotary Encoder – Optical, Binary Output, Horizontal, IP64
    ₹1,47,959View
  • AS5600 Magnetic Encoder Sensor Module – 12-bit, I2C/PWM/Analog Output
    ₹144View
  • XJX-135 MT6816 Magnetic Rotary Encoder Module – I2C/ABZ/PWM/SSI, 256 PPR
    ₹339View
Shop Encoders & Rotary Position Sensors

Calculators

Encoder resolution calculatorLead screw calculator

Terms in this guide

Quadrature outputTwo square-wave signals 90 degrees apart (A and B). Which one changes first tells the direction of rotation.PPR and CPRPulses per revolution (PPR) is the number of cycles on one channel per turn. Counts per revolution (CPR) is what a controller counts after decoding both channels and all edges, normally 4 times PPR.Absolute encoderAn encoder that reports the exact shaft angle as a code, so the position is known immediately after power-up with no homing.Open-collectorAn output that can only pull LOW; it needs a pull-up resistor to go HIGH. Many sensor modules and the LM393 comparator work this way.Hall effectThe small voltage produced across a conductor or sensor in a magnetic field. Hall sensors use it to detect magnets or measure current without electrical contact.

Projects that use it

Put this into practice: 9 step-by-step builds in our project library use parts from this guide.

Beginner · 1 hourValve and gate angle indicatorView projectBeginner · 1 hourWind vane direction meterView projectBeginner · 1 hourWindow and door opening angle meterView project
Browse all 9 projects

Keep learning

How-toBeginnerRotary EncodersA rotary encoder is a knob that turns endlessly and outputs two square-wave signals, A and B, a quarter step apart.3 min read · Switches, Relays & InputConcept explainerIntermediateMotor Encoders and Speed FeedbackA motor encoder reports how far and how fast a shaft has turned.3 min read · Motors & MotionComponent guideBeginnerHall Effect Sensors and Reed SwitchesA Hall effect sensor detects a magnetic field with no contact.3 min read · SensorsHow-toIntermediate3.3 V vs 5 V LogicYou need level shifting when a 5 V device sends signals to a 3.3 V board such as an ESP32 or Raspberry Pi Pico, because 5 V on their pins can damage them.4 min read · Prototyping & WiringComponent guideBeginnerSolenoids and Linear ActuatorsA solenoid is a coil that pulls an iron plunger in when powered, giving a short, fast push or pull.3 min read · Motors & Motion

Sources

  • AMS AS5600 datasheet
  • Encoder manufacturer datasheets
  • ESP32 pulse counter documentation

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerIncremental, absolute, optical, magneticPPR, CPR and what you really getOutput types and wiringMagnetic encoders such as the AS5600Using one with a microcontrollerTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide5 items · ₹1,52,530

Rotary Encoder 1000PPR/4000CPR with Index – Optical, IP54, NPN Open Collector, 2m Cable · HS-S32A Rotary Encoder – 600 PPR, NPN Open Collector, 5-24V DC · Hengstler AC58 Series 0566003 Absolute Rotary Encoder – Optical, Binary Output, Horizontal, IP64 · AS5600 Magnetic Encoder Sensor Module – 12-bit, I2C/PWM/Analog Output · XJX-135 MT6816 Magnetic Rotary Encoder Module – I2C/ABZ/PWM/SSI, 256 PPR

Ask the Community

Ask a question