wooziee
Posts: 8
Joined: Mon Nov 20, 2023 4:46 pm

Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 5:39 pm

Hello,

So I'm kind of new to this and I have ran into a problem. I have a simple rotary encoder:

Image

I was wondering, is it possible to hook up this encoder without using any resistors? I heard that the GPIO pins are configurable and the Raspberry has internal pulldown/up resistors. Or am I wrong?

I would like to know how and if it is possible.

Thank you in advance!

deepo
Posts: 1286
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 6:09 pm

It would probably help if you told us what type of encoder you have.
Have you searched the internet for guides?

wooziee
Posts: 8
Joined: Mon Nov 20, 2023 4:46 pm

Re: Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 6:36 pm

deepo wrote:
Sat Dec 02, 2023 6:09 pm
It would probably help if you told us what type of encoder you have.
Have you searched the internet for guides?
I don't know exactly which one I have, but it looks exactly the same as the one in the picture. I have seen guides using the encoder with pull up resistors:
Image

wooziee
Posts: 8
Joined: Mon Nov 20, 2023 4:46 pm

Re: Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 6:49 pm

I guess the question would be how should I set up the internal pull ups on the GPIO in order to connect the encoder without VCC.

User avatar
thagrol
Posts: 10963
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK

Re: Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 7:43 pm

wooziee wrote:
Sat Dec 02, 2023 6:36 pm
deepo wrote:
Sat Dec 02, 2023 6:09 pm
It would probably help if you told us what type of encoder you have.
Have you searched the internet for guides?
I don't know exactly which one I have, but it looks exactly the same as the one in the picture. I have seen guides using the encoder with pull up resistors:
Image
Those look like pull down resistors not pull ups.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

ame
Posts: 8735
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 9:07 pm

wooziee wrote:
Sat Dec 02, 2023 5:39 pm
Hello,

So I'm kind of new to this and I have ran into a problem. I have a simple rotary encoder:

Image

I was wondering, is it possible to hook up this encoder without using any resistors? I heard that the GPIO pins are configurable and the Raspberry has internal pulldown/up resistors. Or am I wrong?

I would like to know how and if it is possible.

Thank you in advance!
Yes, it's possible.

Connect the A and B rotary encoder pins (green and light blue in your photo) to two GPIOs, and the common pin (black) to GND. Then configure those two GPIOs as inputs with pull-ups. That's the encoder dealt with.

For the pushbutton do the same thing. Connect one pin of the pushbutton (orange) to a GPIO. Connect the other pin (black) to GND. Configure that GPIO as an input with pull-up.
Oh no, not again.

wooziee
Posts: 8
Joined: Mon Nov 20, 2023 4:46 pm

Re: Encoder with Raspberry Pi 3A+

Sat Dec 02, 2023 9:20 pm

ame wrote:
Sat Dec 02, 2023 9:07 pm
wooziee wrote:
Sat Dec 02, 2023 5:39 pm
Hello,

So I'm kind of new to this and I have ran into a problem. I have a simple rotary encoder:

Image

I was wondering, is it possible to hook up this encoder without using any resistors? I heard that the GPIO pins are configurable and the Raspberry has internal pulldown/up resistors. Or am I wrong?

I would like to know how and if it is possible.

Thank you in advance!
Yes, it's possible.

Connect the A and B rotary encoder pins (green and light blue in your photo) to two GPIOs, and the common pin (black) to GND. Then configure those two GPIOs as inputs with pull-ups. That's the encoder dealt with.

For the pushbutton do the same thing. Connect one pin of the pushbutton (orange) to a GPIO. Connect the other pin (black) to GND. Configure that GPIO as an input with pull-up.
Thank you so much!

Return to “Automation, sensing and robotics”