 # computer transformer + potentiometer on arduino

I would like to increase and decrease the current of a computer transformer (connected to a coil) with a pot and also be able to read the pot's value with arduino. Any idea/sketch how I can connect all these so that I do not harm my board ???

I would like to increase and decrease the current of a computer transformer (connected to a coil) with a pot and also be able to read the pot's value with arduino.

What??? Do you mean a computer power supply? How is the coil connected? How much current?

A pot alone might work to control/decrease current (or voltage) if you have a small current (a few milliamps) and a constant load. Most real-world current sources are more complicated.

The arduino can read voltage. Reading current can be tricky, but it's usually done be reading the voltage across a small known-value series resistor. In general, you want to keep the series resistor small to miminize the voltage drop, but that means you usually need an amplifier to amplify the voltage before you measure it.

...and also be able to read the pot's value with arduino.

Similarly, you measure resistance by passing a known small current through the resistor, and measuring the voltage drop across it.

This is how a multimeter works... At it's core it's a voltmeter. Circuitry is added to allow current and resistance measurements.

Since you are measuring a voltage across a resistance, your Arduino's ground generally must be isolated.

The relationship between voltage, resistance, and current is defined by [u]Ohm's Law[/u].

I suggest a dual gang pot. Use one gang to control the coil, the other to read the resistance for your arduino. That way, the two currents/voltages are kept seperate but in sync.

Thank you both for your help ! It is much apreciated !

What??? Do you mean a computer power supply? How is the coil connected? How much current?

Yes I mean a computer power supply. The coil is connected to a transistor and then to the power supply. The current is about 5A.

I suggest a dual gang pot

It is an excellent idea (I didn't even knew it existed) but unfortunately I have already mounted a pot and it cannot be changed.

I would like a solution which uses the pot I already have (22K) to control the current and show a value on the arduino.

So, you are trying to limit the current? What is your end goal, how much current do you want it to supply? A Pot can directly limit the current (as it is a resistor, and if you put it in series, then you get a current limiting resistor), but the level of control will difficult, as, assuming 5V: 1Ohm = 5A, 2 Ohm = 2.5A, 5 Ohm = 1A. Now you have a 22K pot, I've listed less than 1% of the possible resistor values and have covered 80% of the possible current range. If you only intend to use 100mA or less, then I could maybe see doing this, but its still inefficient. Also your pot will get really warm since it will be dissipating a lot of energy through it. And measuring its setting will be quite difficult, as getting a steady voltage will be awkward.

Option 2, Buy one, it will be safer: http://www.mastechpowersupply.com/ - Good cheap place to get bench power supplies. They come with built in current limits and displays.