# Gear motor encoder gives no pulses: power, phases and pull-ups

> Fix a motor encoder that counts nothing: power the encoder from the right voltage, check the A and B wires, and use pull-ups where the outputs are open collector.

Canonical: https://roboticsengineering.in/fix/gear-motor-encoder-no-pulses-hall-power/ | Published: 2026-11-03 | Updated: 2026-11-04

**The encoder has its own power pins. Check that it has the supply voltage, then watch A and B on a pin while you turn the shaft.**

## What the message means

A Hall encoder needs its own supply and gives two pulse signals. A missing supply or a wrong wire gives no pulses at all.

## Fix it in this order

1. Check the encoder power and ground wires, and the voltage the encoder accepts.
2. Turn the shaft by hand and read A and B on two input pins.
3. Use INPUT_PULLUP, or add external pull-ups, where the outputs are open collector.
4. Use interrupt-capable pins when the speed is high.
5. Keep the encoder wires away from the motor wires.

## Why it happens

A Hall encoder is a small circuit mounted on the motor. It needs its own supply, separate from the motor wires, and it outputs two pulse signals, usually called A and B, as a magnet on the shaft passes the sensors.

With no supply or a wrong wire, the sensors do nothing and the pins read a steady level. Many encoder outputs are open collector, so the pin needs a pull-up to show a high level. Check what supply voltage your encoder accepts, because it may differ from the motor voltage.

## If you see this, do this

| You see | Do this |
| --- | --- |
| No pulses on A or B | Power or wiring. |
| Count jumps | Noise or bounce. |

## Related

[wrong encoder counts](https://roboticsengineering.in/fix/rotary-encoder-wrong-counts-bounce/), [interrupt variables](https://roboticsengineering.in/fix/arduino-interrupt-variable-not-updating-volatile/).

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

## Why this happens

A magnetic encoder on a gear motor is a small circuit board with two Hall sensors reading a ring magnet on the motor shaft. The sensors need a supply of their own. Because the two sensors are placed a quarter of a cycle apart, the A and B outputs are 90 degrees out of phase, and the order in which they change tells you the direction.

Counting every edge on both channels gives four counts per pulse cycle. As an illustration, a motor whose encoder gives 11 pulses per turn of the motor shaft yields 44 counts per motor turn, and behind a 30:1 gearbox that is 1320 counts per turn of the output shaft. Check your datasheet; the figures differ between motors.

## How to confirm the cause

- Measure between the encoder’s supply and ground pins with a multimeter while the board is powered. No voltage means a wiring or connector fault.
- Confirm the voltage the encoder accepts. Many accept 3.3 V to 5 V, but check your own motor.
- Read both pins and print every change while you turn the shaft slowly by hand. A pin that never changes is the faulty channel.
- Check the wire colours against the motor’s pin table, since the encoder wires are separate from the two motor wires.
- If the output is open collector, a pin reading that stays LOW or wanders means the pull-up is missing.

## Worked example

A reader that prints only when A or B changes, with internal pull-ups on.

```
const int A = 2, B = 3;
int la = -1, lb = -1;

void setup() {
  Serial.begin(115200);
  pinMode(A, INPUT_PULLUP);
  pinMode(B, INPUT_PULLUP);
}

void loop() {
  int a = digitalRead(A), b = digitalRead(B);
  if (a != la || b != lb) { Serial.print(a); Serial.println(b); la = a; lb = b; }
}
```

## Common mistakes

- Powering the encoder from the motor output instead of the logic supply.
- Feeding a 5 V encoder pull-up into a pin that accepts only 3.3 V.
- Swapping A and B and thinking it is broken; that only reverses the direction.
- Counting one channel only and getting a quarter of the expected resolution.
- Running the encoder wires in the same bundle as the motor wires.

## If this did not fix it

- Missed pulses at high speed because the code is polling; use interrupts or a hardware counter.
- Noise from the motor adding false pulses; add shielding, shorter wires or a small capacitor.
- A damaged cable at the connector after repeated flexing.
- The magnet ring slipped on the shaft.
