Autonomus and Rc control of servo

Im working to an autonomous boat. I want to have a manual switch in case anything goes wrong with the boat in autonomous mode. But when I connect the signal pin of my servo to both my RC remote receiver and Arduino the RC remote stops working and when I disconnect the Arduino it works again.
I've a simple program which reads in a value from the receiver and when it goes high it activates the arduino contol

Let me know how you connect your parts. Wiring diagram will be fine :wink:

The servo signal is connected to both the receiver and pin 9 on the Arduino on a breadboard. The arduino is powering the receiver. Sorry for the wiringing diagram didn’t really know how to go about it

It will not work if you connect both together like you do …
You can try to connect relays for the servos an switch with your rc remote between arduino and rc.
Otherwise you can import the RC signal to the Arduino. It’s up to you what you want :wink:

Have a look !

I was thinking that thanks, any idea of which would be an easier method cause I have to get it done soon :smiley:

If you already have done your code for the boat you should try relays ... :art:

Basically, what you want to do is called a “pass-through” control system.

The idea is this:

  1. Run the output of your receiver into a digital input on the Arduino (connect the grounds!)

  2. Hook your servo(s) to the Arduino on other digital pins (connect the grounds!)

  3. Write your code to switch as needed between the Arduino controlling the servo, and the radio controlling it

  4. The Arduino controls things using the Servo library (as normal)

  5. The Arduino reads the receiver output using “pulseIn()” -

  6. The Arduino interprets that output (a unsigned long value in microseconds), and uses that information to control the servos.

Read the documentation for “pulseIn()” and the Servo library carefully - I believe you can simply write the code as:

servo.writeMicroseconds(pulseIn(pin, HIGH, 0));

Where “pin” is the input pin and “servo” is your Servo type variable. For instance:

See also

#include <Servo.h> 

Servo myservo;

void setup() 
  myservo.attach(9); // servo attached to pin 9
  myservo.writeMicroseconds(1500);  // set servo to mid-point

void loop() 
  myservo.writeMicroseconds(pulseIn(10, HIGH, 0));  // set servo to signal on pin 10

That’s the gist, at least. There’s a robot out there (used to be sold by sparkfun) by DFRobots called the “Wild Thumper”; it was a 6WD chassis (and expensive). There was example code available for it, but basically it had an RC receiver, with an Arduino connected to that (well, it was an “all in one” robot controller board hooked to the RC receiver, and it was ATMega328 based). The example code basically did something like the above, reading the receiver using “pulseIn()” and then taking that value and using it to control servos and h-bridges that controlled the robot. If you can find that example code, it might help.

Alternatively (but this will be more difficult to figure out and code for - maybe - and is likely overkill for your project) - you can try this library:

…it can do similar things, but it is also designed for the creation of entire R/C systems (Arduino microcontroller-based transmitters and receivers).