I am trying to make a digital potentiometer, but I cannot get the transistors behave linearly. The name that I gave it ( digi pot) does not matter much as long as it does what I am aming to do. I just want the left voltmeter and right voltmeter values change inversely. I am not looking for chips like X9CXXX, I want to design my own but I have tried all I could. I am out of my depth now, need help, This is the schematic, you can tweak it in the App
digipot
Hi, @anon2761406
Google.
r-2r switch d to A arduino
https://www.electronics-tutorials.ws/combination/r-2r-dac.html
Might help.
Tom....
![]()
Tom!! Did you check the link you provided? Does it look linear to you??? I mentioned something about the linearity.
Yes, when you look at it in 4 bit from, you have 16 levels of output not 4 levels.
R-2R allows you to have more than one of the four inputs on at a time.
Tom....
![]()
Try using this circuit.
The way you had it was just a switch that produces just high or low. With the last transistor being used as a voltage follower as here the transistor will mirror the voltage is on it's base, with an offset voltage of 0.7V.
There is no way to get rid of that offset voltage with silicon transistors. If you could get hold of a germanium transistor the offset would reduce to about 0.25V.
What I don't see in the diagram is any sort of input to actually control this circuit.
Also the first transistor looks wrong, I would expect some sort of resistor in the emitter.
EDIT
Looking at it again this will not produce an inversion of the signal.
Try reading this:-
- You can make an isolated digital potentiometer with a photo resistor (LDR) and a LED (or light bulb).
Vary the LED’s (bulb’s) intensity . . .
Inversely relative to what? The battery voltage or some component?
By inverse do you mean that V1 = 1/V2 ?
That 1Ω resistor at a jaunty angle is actually a 1kΩ variable resistor.
There is a slider labelled 'Resistance' to control its value, over at the right hand side.
Thanks. I know that with a simple 8-bit shift register you can get 256 unique outputs and that can with a lot of calculations, give you a 256 notch digi pot. But I have to avoid programming for that and rely on hardware.
Thanks. It did not occur to me, but searching the Internet, I found that they dont behave like str8t line either. For my project, it has to be increasing one side and decreasing the other side of sweeper like a real potentiometer.
So NOT the inverse?
Yes , inversely. If you slide the Potentiometer that @JohnLincoln pointed out, the voltmeters' values change inversely. One goes up and one goes down and vice versa
Inversly would be V1 = 1/V2
So if V2 = 5V then V1 = 0.2V
Or do you mean V1 = 5V-V2, so if V2 =3V then V1 = 2V and the sum is always 5V
something like tat, but does not have to be 5v. If you slide the potentiometer, you will see that the voltage of the voltmeters remain almost in the same range while one increases and other decreases. Sadly, the output is curvy like this and not even symmetrical.
In such a way that one amount gets bigger as another gets smaller:
The offset is fine, just need to get it behave linearly in 1:1 ratio. The schematic's outputs are curved shape and exponential, what is worse , they are asymmetrical.
It does not have to be transistors. I tested with P and N MOSFET combo and it seems they have a better response to Vgs but I spent hours and I could not get the values remain in the same range
What you need to use is operational amplifiers.
Hi, @sirmrpotatohead
Why, what exactly is your project?
Tom....
![]()
What it needs to do is simply, adjust the potentiometer based on the input. It will compare it to another voltage reference that varies at different stages, and if the input is lower than optimum, adjust the potentiometer and vice versa
I gather that you just want to generate a voltage.
Why not just use a PWM signal, from a PWM pin,and smooth it to a voltage with an RC circuit.
Leo..


