Arduino instead of a potentiometer ?

Hello, I don't know a lot about arduino but I would like to know if it was possible to substitute a potentiometer with an arduino ? Like I have an RC car and I would like to command the remote control with my arduino instead of the potentiometer inside of it. Is it possible ?

Thanks in advance.

You are not providing enough information. It would be best if you could make a pencil drawing of the circuit and of the changes you want to make and post photos of the drawings.

If you simply mean that you want an Arduino to take the place of a potentiometer that you turn with your hand then there are two simple options - and probably many others that are more complex.

You could make the Arduino operate a servo that turns the knob.

You could replace the potentiometer with a digital potentiometer that is controlled by the Arduino.

...R

Oh yes, thanks for your answer, a digital potentiometer could do the work. But is it possible to emulate with the arduino the return value of the potentiometer? The remote control is a Futaba T2PH http://www.casimages.com/i/16021603534254098.jpg.html

With a function like analogWrite()

Mr_Poulay: But is it possible to emulate with the arduino the return value of the potentiometer?

I don't know what you mean and I don't understand what the image is intended to convey.

...R

Sorry, I was not verry clear. The 3 wires on the picture are the potentiometer wires. Between the black one and the with one, there is always 5V, between the red one and the black one, the tension changes when I turn the potentiometer. Is it possible to plug the red one to the ardino and then to "simulate" a potentiometer with the arduino ?

You can use analogRead() to measure the voltage on the centre wire - just be absolutely sure it can NEVER exceed 5v - not even for a micro-second.

After that the Arduino can use the data for whatever you want.

However I'm not clear how this will achieve what your title asks? I suspect you are thinking about things back to front.

Assuming the Arduino can measure the voltage what do you want to do with that data and what do you plan to connect the Arduino to?

...R

If the arduino can measure the voltage, can it produce the same voltage to control the remote control back ? And why "it can NEVER exceed 5v" ? Beacause I already have powered my arduino with a 9v battery and nothing wrong happened.

Mr_Poulay: If the arduino can measure the voltage, can it produce the same voltage to control the remote control back ? And why "it can NEVER exceed 5v" ? Beacause I already have powered my arduino with a 9v battery and nothing wrong happened.

Starting at the bottom You connect your 9v battery to the power input not to the I/O pins. There is a voltage regulator on the Arduino board to reduce the 9v to 5v.

If you connect more than 5v to an I/O pin you will damage your Arduino - read the Atmel datasheet if you need confirmation.

I still cannot understand what you mean by "can it produce the same voltage to control the remote control back"

Please describe what you are trying to achieve.

...R

Ok I see for the voltage. With a voltmeter I measured the tension of the signal of the potentiometer (between the red wire and the black wire). This tension change between 1.01V to 3.90 V. Than, with the function: analogWrite(pin, value) , I can produce a tension between 0 and 5V. So I plugged the output tension of the arduino to the red wire of the remote control to "simulate" the potentiometer with the arduino. But it didn't worked.

I think you have your ideas all mixed up.

The reason you get a voltage on the signal wire of the potentiometer is because it is acting as a voltage divider for a voltage within the circuit board the potentiometer is connected to. That voltage is an OUTPUT. It would normally be connected to something else on the board that uses it as an INPUT.

Putting an external voltage on the potentiometer signal pin is like trying to get sh*t back into the goose.

Your external voltage must go to the thing that the potentiometer signal would normally be connected to.

HOWEVER ... The Arduino analogWrite() does NOT produce a varying voltage. It produces an output that is 5v for part of the time and 0v for the other part. The proportion of time when it is 5v varies. It is not a suitable substitute for the potentiometer voltage without other circuit components to average the voltage.

AND... Even if you get a smoothed varying voltage from your Arduino it may not be suitable because the circuit board probably expects a potentiometer with a certain impedance.

SIMPLE SOLUTION ... as suggested in Reply #1

...R

I will take the solution as suggested in Reply #1 but I was just trying to understand why it was not working. So when I measured the output volatge of the analogWrite() with a voltmeter, I get a voltage that change in function of the parameter of analogWrite(), it is beacause my voltmeter is doing the average tension of the output.

For example, if I wrote analogWrite(pin, 127.5) (as the duty cycle is between 0 and 255; 127.5 is the half). I will measure a voltage of 2.5V with a voltmeter because half the time the pin is at 5V and the other time, the pin is at 0V, is it right ?

Yes, the meter will take the average. Easier to see on a meter with a needle vs an LCD display. The electronics would normally see a DC kind of voltage from the wiper of a potentiometer. You can create a similar DC level by passing the square wave from analogWrite thru a resistor/capacitor low pass filter.

With 490 Hz input, and 2K/10uF filter, you can see the expected output here. http://sim.okawa-denshi.jp/en/PWMtool.php

Ok, thank you for your answers :)