Can NPN replace Relay Module

hey guys i have a project about IC PT2256, thats IC was Audio volume digital potentiometer.
the IC dont have I2C connection but only need 2 button that bridge them to groung.
I wondering can control the IC with NodeMCU, so what must i do? making virtual ground or virtual button
if make virtual button, NPN Transistor as switch or Relay Module

Thank you

datasheet_4.pdf (73.1 KB)

I think I2C Digipot would be great

ramine:
I think I2C Digipot would be great

but i dont know how to code the i2c

The internal pullup resistor for the up and down inputs is typical 110 k,
so you probably need no interface, you can drive the pins directly from the Arduino.

Given you run the PT2256 with 5V.

This datasheet is a bit more detailed.

Yes, a transistor will work. Or if you're running it from 5V you can just connect an Arduino output-pin without the transistor.

An opto coupler could be better if audio ground is different from digital ground.
The opto transistor could act as the switch, while the opto LED can be driven by the Arduino pin via a 1k current limiting resistor.
Leo..

Whandall:
The internal pullup resistor for the up and down inputs is typical 110 k,
so you probably need no interface, you can drive the pins directly from the Arduino.

Given you run the PT2256 with 5V.

This datasheet is a bit more detailed.

so i must set the arduino pins always have high output to keep the volume?

DVDdoug:
Yes, a transistor will work. Or if you're running it from 5V you can just connect an Arduino output-pin without the transistor.

it will safe for arduino?

Just connecting the pin to the IC might not work if the supply voltages of Arduino and audio chip are different.
The audio chip expects a normally HIGH on the volume pins of 0.7*VCC.
That's 6.3volt minimum on a (typical) 9volt supply of the audio chip.
A NodeMCU (3.3volt) can't deliver that.

So you must use an NPN transistor (with ~3k3 base resistor), with shared grounds.

Or the opto coupler (post#5).
Leo..

Wawa:
Just connecting the pin to the IC might not work if the supply voltages of Arduino and audio chip are different.
The audio chip expects a normally HIGH on the volume pins of 0.7*VCC.
That's 6.3volt minimum on a (typical) 9volt supply of the audio chip.
A NodeMCU (3.3volt) can't deliver that.

So you must use an NPN transistor (with ~3k3 base resistor), with shared grounds.

Or the opto coupler (post#5).
Leo..

i think the opto coupler was the best way :smiley: