{"product_id":"dual-concentric-rotary-encoder-push-switch","title":"Dual Concentric Rotary Encoder with Push Switch - 30 Detents","description":"\u003cdiv class=\"nznpd\"\u003e\n\u003cdiv class=\"nznpd__lead\"\u003e\n\u003cp class=\"nznpd__intro\"\u003eA dual concentric rotary encoder is two knobs on one spindle. The outer sleeve and the inner shaft turn separately, and each one tells your controller which way it was turned and by how many clicks. This one has 30 clicks a turn on both shafts and a push switch that works when you press the shaft in, so one panel hole gives you two rotary controls and a button.\u003c\/p\u003e\n\u003cp class=\"nznpd__intro\"\u003eIt is the control behind the COM and NAV frequency knobs on a home flight sim radio panel, where the outer knob changes the whole numbers and the inner knob the decimals. You can also use it for heading and altitude on an autopilot panel, or on a synth to pick a menu item with one knob and set its value with the other. It reads on an Arduino Nano or Mega, an ESP32 or a Pico, and it uses five input pins and a ground. The collar is plain, with no thread or nut, so the solder joints hold it: solder it to a PCB that sits behind your panel and let the shaft come through a hole of about 8mm. Knobs are not included. The inner shaft is 3.5mm with a flat and the outer is a 6mm slotted sleeve, so look for a concentric knob pair made for dual encoders.\u003c\/p\u003e\n\u003c\/div\u003e\n\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eSpecifications\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__specs\"\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eType\u003c\/span\u003e\u003cstrong\u003eTwo incremental encoders on one concentric shaft, A\/B output from each\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eDetents\u003c\/span\u003e\u003cstrong\u003e30 clicks per turn on each shaft\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003ePulses per turn\u003c\/span\u003e\u003cstrong\u003e15 on each shaft (60 counts with 4x decoding)\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003ePush switch\u003c\/span\u003e\u003cstrong\u003eMomentary, press the shaft in, about 0.5mm travel\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eTerminals\u003c\/span\u003e\u003cstrong\u003e8: two rows of 3 (A, C common, B) at 2.5mm pitch, plus 2 short switch terminals\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eWorks with\u003c\/span\u003e\u003cstrong\u003e3.3V and 5V boards\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eInner shaft\u003c\/span\u003e\u003cstrong\u003e3.5mm with a flat, about 25mm long\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eOuter shaft\u003c\/span\u003e\u003cstrong\u003e6mm slotted sleeve, about 15mm long\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eMounting\u003c\/span\u003e\u003cstrong\u003ePCB, by its terminals and frame lugs. Plain collar, no thread or nut\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eContact rating\u003c\/span\u003e\u003cstrong\u003eTypically 10mA at 5V DC, signal use\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eRotation life\u003c\/span\u003e\u003cstrong\u003eTypically about 15,000 cycles\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"nznpd__spec\"\u003e\n\u003cspan\u003eIn the box\u003c\/span\u003e\u003cstrong\u003e1 encoder, no knobs\u003c\/strong\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\n\u003csection class=\"nznpd__block\"\u003e\n\u003ch3 class=\"nznpd__h\"\u003eDatasheets\u003c\/h3\u003e\n\u003cdiv class=\"nznpd__ds\"\u003e\n\u003ca class=\"nznpd__dsbar\" href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/SW-ENC-DUAL-Datasheet.pdf?v=1794447350\" target=\"_blank\" rel=\"noopener\" aria-label=\"Download the dual concentric rotary encoder datasheet (PDF)\"\u003e\n\u003csvg width=\"20\" height=\"20\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"\u003e\u003c\/path\u003e\u003cpolyline points=\"14 2 14 8 20 8\"\u003e\u003c\/polyline\u003e\u003c\/svg\u003e\n\u003cspan\u003eFull technical datasheet\u003c\/span\u003e\n\u003cspan class=\"nznpd__dsmeta\"\u003ePDF\u003csvg width=\"17\" height=\"17\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\u003e\u003cpath d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u003e\u003c\/path\u003e\u003cpolyline points=\"7 10 12 15 17 10\"\u003e\u003c\/polyline\u003e\u003cline x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"\u003e\u003c\/line\u003e\u003c\/svg\u003e\u003c\/span\u003e\n\u003c\/a\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\n\u003csection class=\"nznpd__block\"\u003e\n\u003cdiv class=\"nznpd__qs\"\u003e\n\u003ch3\u003eWiring \u0026amp; getting started\u003c\/h3\u003e\n\u003cdetails class=\"nznpd__figbox\" open\u003e\u003csummary\u003eWiring diagram\u003cspan class=\"nznpd__codelang\"\u003eArduino Nano\u003c\/span\u003e\u003c\/summary\u003e\u003cfigure class=\"nznpd__fig\"\u003e\u003ca href=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/SW-ENC-DUAL-wiring-nano-wide.png?v=1794447349\" target=\"_blank\" rel=\"noopener\"\u003e\u003cpicture\u003e\u003csource media=\"(min-width: 600px)\" srcset=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/SW-ENC-DUAL-wiring-nano-wide.png?v=1794447349\" width=\"904\" height=\"610\"\u003e\u003cimg src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/SW-ENC-DUAL-wiring-nano.png?v=1794447349\" alt=\"Wiring drawing for the dual concentric encoder and an Arduino Nano. On each row of three terminals the middle one goes to GND. The outer two of one row go to D2 and D3, and the outer two of the other row go to D4 and D5. One short switch terminal goes to D6 and the other to GND.\" width=\"690\" height=\"790\" loading=\"lazy\"\u003e\u003c\/picture\u003e\u003c\/a\u003e\u003cfigcaption\u003eTap the drawing to open it full size.\u003c\/figcaption\u003e\u003c\/figure\u003e\u003c\/details\u003e\n\u003col class=\"nznpd__steps\"\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eFit it\u003c\/strong\u003e\u003cp\u003eOn a PCB, push the eight terminals and the frame lugs through the board. Solder the lugs as well as the terminals, because the lugs take the strain when you turn and press the knobs. For a test before your board is made, solder short wires straight onto the terminals.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eWire the two encoders\u003c\/strong\u003e\u003cp\u003eEach row of three long terminals is one encoder. Connect the middle terminal of each row to GND. Connect the two outer terminals of one row to D2 and D3 on a Nano, and the two outer terminals of the other row to D4 and D5. Each row needs its own pair of inputs. If both rows share a pair, only one knob responds. You need no resistors, because the example code and MobiFlight turn on the ones built into the board. On an ESP32, keep off GPIO34 to 39, which have none built in.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eWire the push switch\u003c\/strong\u003e\u003cp\u003eThe two short terminals are the switch. Both sit on the same side, set in from one row of three and lined up with its end terminals. Connect one to GND and the other to D6. Either way round works.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eFind which row is which knob\u003c\/strong\u003e\u003cp\u003eInstall the Encoder library from the Arduino Library Manager, upload the code below and open the Serial Monitor at 9600 baud. Turn only the inner shaft, the thin one with the flat. If Row 1 counts, the row on D2 and D3 is the inner shaft. If Row 2 counts, it is the row on D4 and D5. Label your wires once you know.\u003c\/p\u003e\n\u003cdetails class=\"nznpd__codebox\"\u003e\u003csummary\u003eExample Arduino code\u003cspan class=\"nznpd__codelang\"\u003eArduino C++\u003c\/span\u003e\u003c\/summary\u003e\u003cpre\u003e\u003ccode\u003e\u003cspan class=\"t-c\"\u003e\/\/ Dual encoder test on an Arduino Nano.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Row 1: outer pins to D2 and D3, middle pin to GND.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Row 2: outer pins to D4 and D5, middle pin to GND.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Switch: one short terminal to D6, the other to GND.\u003c\/span\u003e\n\u003cspan class=\"t-c\"\u003e\/\/ Needs the Encoder library by Paul Stoffregen (Library Manager).\u003c\/span\u003e\n\u003cspan class=\"t-k\"\u003e#include\u003c\/span\u003e \u003cspan class=\"t-s\"\u003e\u0026lt;Encoder.h\u0026gt;\u003c\/span\u003e\n\n\u003cspan class=\"t-o\"\u003eEncoder\u003c\/span\u003e \u003cspan class=\"t-v\"\u003erow1\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e2\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e3\u003c\/span\u003e);   \u003cspan class=\"t-c\"\u003e\/\/ turns on the Nano's built-in resistors for you\u003c\/span\u003e\n\u003cspan class=\"t-o\"\u003eEncoder\u003c\/span\u003e \u003cspan class=\"t-v\"\u003erow2\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e4\u003c\/span\u003e, \u003cspan class=\"t-n\"\u003e5\u003c\/span\u003e);\n\u003cspan class=\"t-t\"\u003elong\u003c\/span\u003e \u003cspan class=\"t-v\"\u003elast1\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e0\u003c\/span\u003e, \u003cspan class=\"t-v\"\u003elast2\u003c\/span\u003e = \u003cspan class=\"t-n\"\u003e0\u003c\/span\u003e;\n\u003cspan class=\"t-t\"\u003ebool\u003c\/span\u003e \u003cspan class=\"t-v\"\u003elastPressed\u003c\/span\u003e = \u003cspan class=\"t-t\"\u003efalse\u003c\/span\u003e;\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003esetup\u003c\/span\u003e() {\n  \u003cspan class=\"t-f\"\u003epinMode\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e6\u003c\/span\u003e, \u003cspan class=\"t-t\"\u003eINPUT_PULLUP\u003c\/span\u003e);\n  \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003ebegin\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e9600\u003c\/span\u003e);\n  \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eprintln\u003c\/span\u003e(\u003cspan class=\"t-s\"\u003e\"Turn each knob, then press the shaft.\"\u003c\/span\u003e);\n}\n\n\u003cspan class=\"t-t\"\u003evoid\u003c\/span\u003e \u003cspan class=\"t-f\"\u003eloop\u003c\/span\u003e() {\n  \u003cspan class=\"t-t\"\u003elong\u003c\/span\u003e \u003cspan class=\"t-v\"\u003ecount1\u003c\/span\u003e = \u003cspan class=\"t-v\"\u003erow1\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eread\u003c\/span\u003e() \/ \u003cspan class=\"t-n\"\u003e2\u003c\/span\u003e;   \u003cspan class=\"t-c\"\u003e\/\/ 2 counts per click\u003c\/span\u003e\n  \u003cspan class=\"t-t\"\u003elong\u003c\/span\u003e \u003cspan class=\"t-v\"\u003ecount2\u003c\/span\u003e = \u003cspan class=\"t-v\"\u003erow2\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eread\u003c\/span\u003e() \/ \u003cspan class=\"t-n\"\u003e2\u003c\/span\u003e;\n  \u003cspan class=\"t-t\"\u003ebool\u003c\/span\u003e \u003cspan class=\"t-v\"\u003epressed\u003c\/span\u003e = \u003cspan class=\"t-f\"\u003edigitalRead\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e6\u003c\/span\u003e) == \u003cspan class=\"t-t\"\u003eLOW\u003c\/span\u003e;\n  \u003cspan class=\"t-k\"\u003eif\u003c\/span\u003e (\u003cspan class=\"t-v\"\u003ecount1\u003c\/span\u003e != \u003cspan class=\"t-v\"\u003elast1\u003c\/span\u003e) { \u003cspan class=\"t-v\"\u003elast1\u003c\/span\u003e = \u003cspan class=\"t-v\"\u003ecount1\u003c\/span\u003e; \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eprint\u003c\/span\u003e(\u003cspan class=\"t-s\"\u003e\"Row 1: \"\u003c\/span\u003e); \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eprintln\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003ecount1\u003c\/span\u003e); }\n  \u003cspan class=\"t-k\"\u003eif\u003c\/span\u003e (\u003cspan class=\"t-v\"\u003ecount2\u003c\/span\u003e != \u003cspan class=\"t-v\"\u003elast2\u003c\/span\u003e) { \u003cspan class=\"t-v\"\u003elast2\u003c\/span\u003e = \u003cspan class=\"t-v\"\u003ecount2\u003c\/span\u003e; \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eprint\u003c\/span\u003e(\u003cspan class=\"t-s\"\u003e\"Row 2: \"\u003c\/span\u003e); \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eprintln\u003c\/span\u003e(\u003cspan class=\"t-v\"\u003ecount2\u003c\/span\u003e); }\n  \u003cspan class=\"t-k\"\u003eif\u003c\/span\u003e (\u003cspan class=\"t-v\"\u003epressed\u003c\/span\u003e != \u003cspan class=\"t-v\"\u003elastPressed\u003c\/span\u003e) { \u003cspan class=\"t-v\"\u003elastPressed\u003c\/span\u003e = \u003cspan class=\"t-v\"\u003epressed\u003c\/span\u003e; \u003cspan class=\"t-k\"\u003eif\u003c\/span\u003e (\u003cspan class=\"t-v\"\u003epressed\u003c\/span\u003e) \u003cspan class=\"t-o\"\u003eSerial\u003c\/span\u003e.\u003cspan class=\"t-f\"\u003eprintln\u003c\/span\u003e(\u003cspan class=\"t-s\"\u003e\"Switch pressed\"\u003c\/span\u003e); \u003cspan class=\"t-f\"\u003edelay\u003c\/span\u003e(\u003cspan class=\"t-n\"\u003e20\u003c\/span\u003e); }\n}\u003c\/code\u003e\u003c\/pre\u003e\u003c\/details\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eCheck it works\u003c\/strong\u003e\u003cp\u003eEach click changes the count by 1, and pressing the shaft prints \"Switch pressed\". Clockwise counts up, anticlockwise counts down. However, if clockwise counts down, swap the two outer wires of that row.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003cli\u003e\u003cdiv\u003e\n\u003cstrong\u003eSet it up in MobiFlight (optional)\u003c\/strong\u003e\u003cp\u003eAdd two Encoder devices, one for each row, and one Button for the switch. Set the type of both encoders to 2 detents per cycle (00, 11). If one click then moves the value two steps, or it takes two clicks to move it one step, choose the other type.\u003c\/p\u003e\n\u003c\/div\u003e\u003c\/li\u003e\n\u003c\/ol\u003e\n\u003c\/div\u003e\n\u003c\/section\u003e\n\u003c\/div\u003e","brand":"NZN Electronics","offers":[{"title":"Default Title","offer_id":67768122900576,"sku":"SW-ENC-DUAL","price":18.99,"currency_code":"NZD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0664\/6127\/0112\/files\/SW-ENC-DUAL_01_hero.png?v=1794448781","url":"https:\/\/www.nznelectronics.co.nz\/products\/dual-concentric-rotary-encoder-push-switch","provider":"NZN Electronics","version":"1.0","type":"link"}