Go Down

Topic: Arduino controlling 2.4GHz R/C Helicopter (Read 1 time) previous topic - next topic

greensamuelm

Jun 05, 2012, 02:18 am Last Edit: Jun 05, 2012, 02:20 am by greensamuelm Reason: 1
Hey guys, I am a software developer by trade and I'm trying to earn my hardware hacking merit badge ;)

Please talk to me like I'm totally ignorant. :) The last electronics project I did was building a TV transmitter from a kit with my dad (and I helped!), and that was years ago.

I am attempting to connect an Arduino to a 2.4GHz R/C controller for a sick co-axial helicopter I have. It is important to note that this helicopter features a 4 channel controller (Throttle, Yaw, Pitch, Roll). I cracked this baby open and (no big surprise) found 4 potentiometers. I grabbed my volt meter and played around with each. From testing the middle (wiper?) pin I was able to determine that the voltage to these pots ranges from 0 to 4v. Using analogRead with the Arduino I am able to detect the position of the joysticks and their potentiometers pretty reliably.

However, I would now like to supply power from the Arduino to each pot and bypass the sticks to allow controlling the Heli from the Arduino. I tapped in to the middle pin on the throttle and things work semi-ok using analogWrite; However the rotors have a kind of pulsing effect I am curious if this is due to the PWM. I have also run in to another issue where the right joystick has springs on it that keep it centered. This means that the pot sits at about 2v, if I send 4v from the Arduino, wouldn't that total 6v and cause problems? I am thinking I might need to short-circuit the pot's positive pin to the pot's ground pin, but that feels dirty. Ideally any modifications I make to the transmitter would not prevent it from working in the future. So far all I have done is tapped in to the wiper pins on the pot and run wires outside the transmitter.

My Questions (TL;DR)

  • Is the effect of the PWM noticeable when using analogWrite as a potentiometer?

  • Is there an easy way to short circuit a pot and reset it's voltage to 0?


PeterH

AnalogWrite does not output an analog voltage - it outputs a voltage which switches between 0V and 5V. This is not suitable as input to a circuit which is expecting to read a potentiometer value.

You could use a hardware smoothing circuit to convert the Arduino's output pulses to a true analog voltage, or use a digital-to-analog converter to do the job properly.
I only provide help via the forum - please do not contact me for private consultancy.

greensamuelm

Thanks for your response. As I said, I'm still pretty new to most of this.

Does this describe what you are suggesting? http://provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/

Nick Gammon

Yes that page looks pretty good.

Quote
wouldn't that total 6v and cause problems?


Where would the extra 2V come from?

terryking228

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Go Up