0
\$\begingroup\$

Hey all I bought a Chinese double din radio in order to modify it to my liking. The main reason why i went with this one is that it had a few buttons and turn knobs on the front and i wanted to use an Arduino in order to "read" this inputs in order to do stuff within my software program.

However, I am not quite sure what I need to check in order to find out how to go about hooking up the rotary dial knob buttons to the arduino so that i can read each "click" that it makes. They also have a push button mode when you press on the front of the rotary dial.

As a side note I will be supplying the power to these so nothing on the board will be used except the physical rotary dial - aside from a few resisters it seems as well.

Here are a few images of the pcb layout:

enter image description here enter image description here enter image description here

And knowledge would be great as to how to go about hooking this up to read by the arduino :)

\$\endgroup\$
  • \$\begingroup\$ Hmmm... look like it's a rotatary encoder. \$\endgroup\$ – Long Pham May 19 '18 at 15:51
1
\$\begingroup\$

Your last photo shows that two of the device's pins are grounded to the large PCB "pour". That leaves three pins for the switches - two encoder pins and one push-to-make.

The wiring will usually be as shown in Figure 1.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Encoder and switch wiring.

The encoder outputs will be as shown in Figure 2.

enter image description here

Figure 2. Encoder count-up / count-down sequence.

Rather than spend too much time messing with the PCB I would be inclined to de-solder the resistors, cut the traces between them and the switch terminals and then solder flying leads from the switch terminals to your microcontroller. If you use internal pull-ups on the micro then you can omit R1, 2 and 3 of my Figure 1.


From the comments:

Since this is an infinite turn in either direction how would i determine, say for music volume, if its back at 0 or if its all the way up?

You can't. There is no zero position and most of these devices are low resolution encoders with as few as twelve steps per revolution. In use it takes several revolutions to go from zero to maximum. They're quite common on car radios so you should play with one for a while to get the feel of the system you are emulating.

On power-up you have to assume an initial value. This could be zero (muted) or some audible but safe value that isn't going to wake the baby. After that you keep track of the adjustment in code and stop the counter at zero when turning anti-clockwise and maximum when turning clockwise. Obviously the user can keep on turning but your code will reject additional counts until the direction is reversed.

\$\endgroup\$
  • \$\begingroup\$ It's possible that some of the connections are multiplexed with the LED drive though. Looks like 5 RGB LEDs perhaps. \$\endgroup\$ – Spehro Pefhany May 19 '18 at 15:56
  • 1
    \$\begingroup\$ Could be. Disconnection of the rotary switch seems the least troublesome option. \$\endgroup\$ – Transistor May 19 '18 at 15:58
  • \$\begingroup\$ Alright another question - since this is an infinite turn in either direction how would i determine, say for music volume, if its back at 0 or if its all the way up? \$\endgroup\$ – StealthRT May 19 '18 at 19:14
  • \$\begingroup\$ See the update. \$\endgroup\$ – Transistor May 19 '18 at 19:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.