Is there a component similar to the one shown in the photo?
What I need is to reduce the voltage in line 2 by a certain percentage. For example, if I set it to -50%, then if the voltage in line 1 is 5V, it will become 2.5V in line 2. If the voltage in line 1 is 3V, then line 2 will be 1.5V.
if i set 100% then whatever voltage is in line1 doesnt matter coz line 2 will be 0
Line 3 can be connected to an Arduino, and I can send analog voltage, I2C, or PWM signals, whichever is necessary to achieve this.
in voltage divider i see i need 2 resistors. but problem is that i need to change percentage of resistence with arduino. example sometimes i want 100% sometimes 50% sometimes 10%
Then you have to check if the digital pot you use can withstand the highest voltage you want to feed into that first line 1 input. You haven't mentioned that.
So providing you measure the voltage on line 1 with the analogRead, and power the digital pot with 5V you should be able to calculate the value the analogue pot needs to be to get you what you need on the output.
note that any sort of resistive voltage divider will not allow significant current to be drawn from the output. For that, you'd need to add some sort of amplification after the digital pot.
The concept is certainly possible.
However we would need to know a lot more to give useful advice.
the main question perhaps is what voltages and currents you would expect.
What are -- 1. Input voltage range on line-1? 2. Output voltage range on line-2? 3. Which Arduino (UNO/NANO/MEGA) you will be using to provide the control signal on line-3?
I have been thinking to propose LM317 based variable voltage regulator (Fig-1, with offset voltage of 1.2V). This is the reason to interrograte OP about the exact range of the input/output voltage.
The later UNO's have a DAC (Digital to Analog Converter) built in, so you can set and vary the output voltage on a special output pin, from your sketch. This issue seems to be crying out for a DAC ...