I am looking to better refine a design I have for a circuit that switches between two voltage sources: one stable (3V) and one variable (1V-5V), and I would like to be able to control the rise/attack and fall/release times of that switching.
The ideal operation of the circuit would be that it is referenced to 3V until a momentary switch is pressed or held, when it will then switch to the variable voltage source (between 1V and 5V, controlled by a potentiometer), and when the switch is released it will return to 3V. The time it takes to rise to or fall from the variable voltage is controlled by a simple RC circuit. I have designed a Falstad simulation to show what I have so far:
Switching circuit for one stable and one variable voltage source
One the right-hand side you will find sliders for the rise, fall, and variable voltage controls. In the simulation I currently have the fall/release control referenced to 3V to try and better stabilize the output and its return to 3V, but the control is limiting (I have included additional ground references and a resistor outside of the circuit to be swapped in and messed around with). I am also aware that the RC constant is quite large, and that is by design: the intention is to be able to switch as quickly or as slowly as the rise and fall control resistances are set (from pretty much instantaneous to several seconds).
The circuit mostly works as intended, but the main issue I am having is with the fall/release time, and having the circuit return reliably to the 3V fixed voltage once the momentary switch is released.
Diodes could obviously be used to isolate the rise and fall time controls (using a slightly different configuration), but they come with an inherent voltage drop, and I need the output voltage to be as close to the fixed and variable voltages as they possibly can be. NPN transistors configured as diodes work decently better, but still not ideally. Relays and MOSFETs might be possible solutions, though I do not currently have any on hand to breadboard and verify and am sort of sticking with what I know so far.
Is there a better solution to this that I am maybe overlooking or unaware of?
