Encoder with RC filter


Well-known member
The Teensys inputs for the encoder are operated via built-in pullup resistors.

Pullup resistors are switchable resistors in the IC that switch an input pin to operating voltage.
This means that the input pin is 'active low', so it switches when the input is pulled to ground via the encoder switch.
We determined the pullup to be 25 KOhm.

That means we have 2 pullups. Once the 10 K (R26) and the pullup at the input internally in the IC.
The encoder switches the input via the 10 K to (presumably) ground.
But since we have an internal pullup that is pulled to ground with 10K, a residual voltage of 0.912 V remains.
And that seems to be the problem. The inputs have a hysteresis of 0.9...1.2 volts at 3.2 V voltage.

That means:
If 0.9 volts are already present and small interference pulses occur, then the Schmidt trigger switches much earlier. Signal/noise ratio
is much worse. So we turned off the internal pullups. It's going great so far...


GPIO signal with intern pullup


Teensy GPIO pin without int pullup


To deactivate the internal pull-up resistors in the Teensy, simply follow the command after initializing the encoder function

// Disabled Pullup Encoder inputs (Pin4/5 my encoder connection)
pinMode(4, INPUT);
pinMode(5, INPUT);

Encoder noise without RC filter


Greetings from germany. Rolf
Last edited:
You've not said which encoders you are using. Most encoders switch to ground with low impedance, so pull-ups are a sensible default.
We use good BOURNS type PEC11L Series encoders. They have 100,000 cycles. The manufacturer recommends an external RC filter (see data sheet). The RC filter already has a pullup. Therefore internal pullup resistance is not necessary.



  • pec11l-777793.pdf
    346.9 KB · Views: 24
The RC filter should be followed by Schmitt-trigger circuit otherwise it can cause issues - logic level inputs should never be slowly varying voltages, this can lead to oscillations and/or excess dissipation on the input buffer. Fast CMOS logic like the teensy expect logic voltages to switch cleanly in a few tens of nanoseconds - if that's not the case add 74HC14 Schmitt-trigger buffers on the inputs.
You'll probably be just fine without the RC filters, there is no need for them with a quadrature encoder.