ES9038Q2M: HW-Volume Control MCP4131+Arduino Uno (sketch)..

so, 😉
at waiting for my 2 AD797s i just finished my long planned “ES9038Q2M-HW-volume control” via some MCP4131+ an Arduino..
i originally wanted it to “combine/implement” it with my “ES9038Q2M-filter-web-control” on an ESP32S but there i have to first find out the right SPI-software/libraries and the pinouts; so not at present..
i took an Arduino Uno, one BT-Modul (HC-06), a 1602LCD and as said this MCP4131-digi-poti (1$ Ebay/Aliexpress)..

first post about it is here->http://essabre-90xx-rpi.sfb2.com/2018/02/es9038q2m-project-2-building-a-bt-controlled-hw-volume-control-digital-pot-10kohm-mcp4131/ and i used this very helpful article about controlling the MCP4131 via SPI from here:->http://www.learningaboutelectronics.com/Articles/MCP4131-digital-potentiometer-circuit.php





this mcp4131 has 128 steps and the usable “range” on this ES9038Q2M is about 64-128; as also posted by someone else before, only after 50% you can hear any difference..
the sketch (via BT as said now) is “full-up” (+128), “full-down” (+85), and in 4 point steps (+4 and -4) example: 124,120 and so on and in 1 point steps(+1,-1)..
the “main”-point in the sketch is this:

int digitalPotWrite(int value)
{
digitalWrite(CS, LOW);
SPI.transfer(address);
SPI.transfer(value);
digitalWrite(CS, HIGH);
}

(its after the loop and u call the function simply with: “digitalPotWrite(i);”; where “i” is the value (from 0-128))

Link (sketch) here + at the forum;

works here all very well and so u have another choice to adjust the volume (i use Volumio here without any software-mixer and therefore on 100% volume) than only via your amplifier and so u have some “finer” adjustments..
nice thing (but as said, i will try to “pair” it with my ESP32S-web-filter-control in future..),
many greets for now 😉