5v encoder (600PPR) for JOGWHEEL

Hi,

I bought this encoder https://www.amazon.fr/gp/product/B015GYY7XU.

The required Voltage is 5v. My question is Can I power with a 5v and directly connect A and B output to 5v tolerant pin ?

If not what can I put between the A/B output and teensy pin (diode, resistor ?) ?

thanks


The answer to that question is it is Teensy Model dependent.

Teensy 4.0, 4.1, Micromod and Teensy 3.6 are not 5v tolerant so you would need a level shifter. For level shifters there are several options I typically use https://www.adafruit.com/product/757. There are other options available like from sparkfun as well.

Teensy 3.5 and 3.2 the pins are 5v tolerant so you could connect 5v output from the encoder directly to the pins.
 
This Wisamic encoder [english page] has NPN outputs so you need pullup resistors connected to both output pins.
Here is diagram of a similar OMRON encoder:
Capture.PNG
Those pullups [e.g. 1K] can be connected to 3V3 and than the output signals are safe for any Teensy.

Regards,
Paul
 
Out of curiosity I purchased a very similar rotary encoder from Amazon.
Hooked it up to a Teensy 3.2 with two 1k pullups from 3V3 to pins 5 & 6. The encoder itsself was powered from the 5V pin.

IMG_20220706_222843.jpg

With this code, the encoder correctly outputted 2400 steps for 1 revolution.
Code:
#include <Encoder.h>
Encoder myEnc(5, 6);

void setup() {
}

void loop() {
  long newPosition = myEnc.read();
  Serial.println(newPosition);
  delay(10);
}

Hope this helps.
Paul
 
This Wisamic encoder [english page] has NPN outputs so you need pullup resistors connected to both output pins.
Here is diagram of a similar OMRON encoder:
View attachment 28855
Those pullups [e.g. 1K] can be connected to 3V3 and than the output signals are safe for any Teensy.
Yes, exactly. All that is needed is a pull-up resistor to 3.3V per output.

This is an "open collector" output, so named because the output is the collector from an NPN transistor (which is not connected to anywhere else).

The exact value of the pullup is not very important. At 3.3V, a 1kOhm resistor means the NPN transistor needs to sink 3.3V/1000Ohm=3.3mA, which is a tenth of the maximum (35mA) shown in the diagram. It is a strong pullup, making sure the output gets decisively high. This is good, especially if the microcontroller is not immediately next to the encoder, and you have a bit of wire in between.

If this was a battery-operated circuit, then one might save a tiny bit of power by using a weaker pull-up, maybe 2.2kOhm, 4.7kOhm, or 10kOhm.
I normally default to weaker pullups, starting at 10k, and then adjust based on what I see. With longer wires, I use stronger pull-ups.
Even though I like to simulate my circuits, I always do final adjustments based on practical measurements and observations.

In another thread I showed a circuit that can be used if the encoder output is not an open collector or open drain one. With this output, an open collector output, there is absolutely no need to use such a circuit: any additional circuitry won't make it work any better. Basically, what that circuit of mine does, is turn any output into an open collector one, using N-channel enhancement mode MOSFETs that can handle ±20V input signals, with an added inrush current limiting resistor for the MOSFET switching.
 
Back
Top