Sir, I want control the voltage using a 10K potentiometer, Vin=12V DC, and Vout= (between 0v-5v) from the potentiometer. So, I need a resistance R1, that will drop the voltage from 12v to 5v, in order to produce Vout = 0v to 5v from the potentiometer. But I am unable to calculate the R1 resistance value. Please help me in this.
Hey. Why do you not watch this video here, and learn instead? This video here explains it all. So ask questions to the understanding of this video, and I will assist you.
Use this formula for voltage divider with 2 values resistors, R1 (top resistor), R2(button one), consider R1 is 10K, Vout is 5 volts (arduino max input voltage ) and Vin (yours 30 volts): R2= R1*(Vout/Vin-Vout). The result is 2K. Now you can find the values of R2 for any voltage you want.
@@HenrikHvalpen since the original voltage is multiplied by 3 and divided by 13 (look at the circuit and formula). So the voltage on the arduino should be multiplied by 13 and divided by 3 to get the original value. The point is multiply the divided voltage, so we can print the original voltage before divided.