A SPST switch connects HB1 and HB2, to control a lamp connected to HB OUT. I am looking into modifying this circuit to make the slew rate adjustable when switching the output to VCC (around 12V). I would like to be able to control the slew rate with a controller such as Arduino or Rasperry Pi.
The slew rate seems to be affected largely by C1. I found some digitally controlled pots like this one: https://www.sparkfun.com/products/10613 , but there don't seem to be digitally controlled capacitors.
I have also been looking into adding circuitry such as this op amp design from TI to control the slew rate: http://www.ti.com/tool/TIPD140#0
I am a beginner when it comes to electronics so any suggestions/insight would be greatly apprecitated.
Best Answer
The conduction of the MOSFET is controlled by its total gate charge \$Q_g\$: operating a MOSFET is equivalent to charging and discharging its gate capacitance, bringing it from its "OFF" state (zero conduction between the drain and source electrodes and \$Q_g=0\$) to its "ON" state (full conduction between gate and source electrodes and \$Q_g=Q_{g\max}\$) and the other way around. The process is exactly the charging of a (nonlinear) capacitor: if you want to control the "speed" of the transition between these conduction states, the simpler way is to control the charging current. Looking at your circuit, the best way is perhaps to change you input saturated switch \$\mathrm{Q}_2\$ with a properly controlled "amplifying" current mirror: the current charging the gate is controlled by the potentiometer \$\mathrm{PT}_1\$, which can be a digital one.
simulate this circuit – Schematic created using CircuitLab
Notes
New edit
A relationship between the input current \$I_{in}\$ from the \$\mathrm{HB}_1\$ switch and the \$I_{C3}\$ discharge current as a function of the resistors \$R_{E1}\$ and \$R_{E2}\$ which can be deduced from the circuit properties of the bipolar junction transistor is the following one: $$ I_{C2}\approx\frac{h_{FE}}{(h_{FE}+1)\frac{R_{E2}}{R_{E3}}+1}I_{in} $$ where