Skip to content

SoundMachine Build Log 02

June 23rd, 2017 - HardwareTutorial

I’ve decided to put in a knob to control the volume directly on the box itself. It will be controlled by volumio itself via a plugin, much like the GPIO Buttons plugin.

Since this is really a development kit approach, the hardware consists of:

  • A KY-040 rotary encoder and
  • A screw-based prototype board

Both are relatively easy and cheap to find and buy.

Rotary encoder

The encoder is straight-forward cheap version, with a push button too, just in case. It’s even mounted on a PCB and has pins too, so it’s practically plug-and-play

The prototype board

The board looks like this: Screw board

This allows me to connect the clock pin (volume UP), data pin (volume DOWN) to e.g. D7 (GPIO23) and D8 (GPIO24) respectively. Now, we only need to create a plugin to put the encoding in the right place. Next post will detail the software side of volume control :)

Annex - Mapping

The mapping between raspberry pi pins, GPIO and the screw-able parts is:

Raspberry PI Pin N.O.Pin nameArduino ShieldDescription
13.3V3.3V
25V5V
3GPIO02A4SDA
45V5V
5GPIO03A5SCL
6GNDGND
7GPIO04A0
8GPIO14D1TXD
9GNDGND
10GPIO15D0RXD
11GPIO17D2
12GPIO18D3
13GPIO27D5
14GNDGND
15GPIO22D6
16GPIO23D7
173.3V3.3V
18GPIO24D8
19GPIO10D11SPI_MOSI
20GNDGND
21GPIO09D12SPI_MISO
22GPIO25D9
23GPIO11D13SPI_SCK
24GPIO08D10SPI_CE0
25GNDGND
26GPIO07D4SPI_CE1
27ID_SD
28ID_SC
29GPIO05A1
30GNDGND
31GPIO06A2
32GPIO12A3
33GPIO13D14
34GNDGND
35GPIO19D16
36GPIO16D15
37GPIO26D19
38GPIO20D17
39GNDGND
40GPIO21D18
Share on
Reddit
Linked in
Whatsapp

A little experiment: