Electrical – Adjusting Potentiometer Range

potentiometer

I'm using two 1K potentiometers and I want to achieve this result:

When the first pot is set to 1K (100%), adjusting the second pot should change the output from 0 to 1Kohms.

When the first pot is set to 500 ohms (50%), adjusting the second pot should change the output from 0 to 500ohms.

I have wired the potentiometer like this schematic. but the lower range changes too. for example when I set the first pot to 120 ohms, turning the second pot changes the output to Arduino from 60 to 120 when I want it to be 0 to 120.

enter image description here

I want the output to be linear. How can I approach this problem?

Best Answer

Here's how, if I have understood it right.

enter image description here