Can I use the Bourns Rotary Encoder with an arduino as a volume knob for my car radio?

Hi everyone,

My aftermarket car radio (Pioneer DMH-W4660NEX) only has buttons to control the volume so I recently got a cheap rotary encoder + ardunio nano + digitial potentiometer setup working as a volume knob to send signals to the radio’s native volume controls.

But the cheap knob I got as a rotary encoder keeps breaking and I’m worried about longevitiy. They come in packs of 5 on amazon: https://www.amazon.com/Cylewet-Encoder-15×16-5-Arduino-CYT1062/dp/B06XQTHDRR/ref=sr_1_4?dchild=1&keywords=arduino+rotary+encoder&qid=1597186842&sr=8-4

I saw the Bourns Absolute Contacting Encoder and it looks nice and probably (?) more durable.

If that’s the case, how do I set it up like the cheap one from amazon that had like 5 pins to connect? The wiring diagram I used is here: https://imgur.com/a/7WDDaNp

I hope it will be simple to adapt the Bourns to the same purpose as the cheap one. Anyone’s help would be highly appreciated! I am a total electrical noob, just a guy with a strong desire for a knob. xD

Thanks everyone in advance. <3

Hello @wick3rman,

Welcome to RobotShop community.

We are sorry for the delayed reply.

The connection of this encoder is much easier than the one you had.

All you need is a full port D0~D7 for an example and 2 pins will be connected to the GND.

You can find all these details and how it works in the datasheet:

Here’s a link for the sample code:

Let us know if you need any further assistance.

Sincerely,

2 Likes

Awesome. Thanks so much, Ebram, for the GitHub link. I am off and running!

Hello @wick3rman,

That’s great, glad we could help.

Let us know if you needed any further assistance.

Have a lovely day, stay safe.

Sincerely,

Hi.

Would you be willing share your code?