# Controlling a servo remotely

**URL:** <https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140>\
**Category:** Programming\
**Created:** [September 12, 2025, 5:57pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140 "2025-09-12T17:57:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 5:57pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/1 "2025-09-12T17:57:40Z")

</div>

Hello,

I'm making a project that will allow me to control a servo connected to an Arduino mega from a joystick that will be connected to another mega. Eventually the servo will have camera on it for video feed etc. The camera will be at one side of the room with the joystick at another.

So far when the joystick button is presses I can get the servo to do an automatic sweep function and this is on a timer so it will keep doing this. When the button is pressed again it well then receive manual command.

The trouble I'm now having is how do I now get control of the servos using the joystick that at the other end of the room on the sending Arduino? I'm doing this wired and it is likely it will stay that way. The camera has not been integrated yet, just trying to get the basics down first .

Any help would be great as I feel like I'm at a road block currently

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [September 12, 2025, 5:59pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/2 "2025-09-12T17:59:52Z")

</div>

consider using an [ethernet-shield-rev2](https://docs.arduino.cc/hardware/ethernet-shield-rev2/) sending UDP datagrams

what camera are you thinking of using?

---

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 6:04pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/3 "2025-09-12T18:04:24Z")

</div>

This could be a possibility, but is there a way without this?

Using the Raspberry Pi AI camera, more data lines to come!

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [September 12, 2025, 6:16pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/4 "2025-09-12T18:16:45Z")

</div>

give more details of the project

there may be better alternatives, e.g. ESP32 with the RPI communicating using WiFi

---

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 6:21pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/5 "2025-09-12T18:21:10Z")

</div>

The overall project is essential a remote camera that can be either doing an automatic sweep or controlled manually from another location.

We have 3 sensors that will be with the AL camera at one location and then a screen with the joystick at another.

Sensors will pick up noise or movement and the camera will pan to this location, with the AL function if it picks up a person it will set a buzzer off and then who ever is in the location where the buzzer is can manually then take control of the camera with a joystick

---

<div class="post-metadata">

**Author:** ![gcjr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gcjr/32/314015_2.png) [@gcjr](https://forum.arduino.cc/u/gcjr)\
**Post date:** [September 12, 2025, 6:28pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/6 "2025-09-12T18:28:38Z")

</div>

> [@lynz68](#):
>
> The overall project is essential a remote camera that can be either doing an automatic sweep

seems that you need to start with machine-to-machine communication, once you have that working you can easily add commands to do more things

---

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 6:32pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/7 "2025-09-12T18:32:55Z")

</div>

So I have them connected and can send a receive commands, I have it so that when I click the joystick and sweep is send the servo will do this, I can then click it again and it will send a manual command and stop the sweep command

where I'm stuck is when I'm now in manual mode how do I control the servo with the joystick when they are connected to different arduinos

---

<div class="post-metadata">

**Author:** ![gcjr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gcjr/32/314015_2.png) [@gcjr](https://forum.arduino.cc/u/gcjr)\
**Post date:** [September 12, 2025, 6:34pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/8 "2025-09-12T18:34:21Z")

</div>

> [@lynz68](#):
>
> where I'm stuck is when I'm now in manual mode how do I control the servo with the joystick when they are connected to different arduinos

send a command with the desired servo position

presuambly you can support different commands

---

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 6:37pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/9 "2025-09-12T18:37:08Z")

</div>

I can send different commands, however what I need to be able to do is move the servo as I please with the joystick not just to set positions

---

<div class="post-metadata">

**Author:** ![gcjr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gcjr/32/314015_2.png) [@gcjr](https://forum.arduino.cc/u/gcjr)\
**Post date:** [September 12, 2025, 6:38pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/10 "2025-09-12T18:38:18Z")

</div>

each change in joystick position sends a new command

---

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 6:40pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/11 "2025-09-12T18:40:51Z")

</div>

I'm not sure how I would code this in? do I need to put this in both my send and receive programs?

---

<div class="post-metadata">

**Author:** ![gcjr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gcjr/32/314015_2.png) [@gcjr](https://forum.arduino.cc/u/gcjr)\
**Post date:** [September 12, 2025, 6:43pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/12 "2025-09-12T18:43:16Z")

</div>

you need to monitor the joystick position when in this manual mode and whenever there is a change in one of the values (x or y), send a command

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [September 12, 2025, 7:16pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/13 "2025-09-12T19:16:56Z")

</div>

> [@lynz68](#):
>
> move the servo as I please with the joystick

... radio control...

> **[nRF24L01 Wireless Joystick for Arduino Robot Car | DroneBot Workshop](https://dronebotworkshop.com/nrf24l01-wireless-joystick/)**
>
> Learn to use the nRF24L01 modules and the RadioHead Library to construct a wireless joystick to control a robot car! This article will show you how the nRF24L01 works and how to use it in your Arduino designs.

.., bluetooth, IR control...

> **[Elegoo Smart Robot Car - IR and Bluetooth | DroneBot Workshop](https://dronebotworkshop.com/elegoo-smart-robot-car-part-2/)**
>
> In part 2 of the series on the Elegoo Smart Robot Car I will show you how to code for and use both the Bluetooth and Infrared remote controls.

---

<div class="post-metadata">

**Author:** ![lynz68](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lynz68/32/1102991_2.png) [@lynz68](https://forum.arduino.cc/u/lynz68)\
**Post date:** [September 12, 2025, 7:20pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/14 "2025-09-12T19:20:44Z")

</div>

would this be easier with a Bluetooth module as currently I'm going in circles and getting nowhere?

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [September 12, 2025, 7:26pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/15 "2025-09-12T19:26:26Z")

</div>

> [@lynz68](#):
>
> would this be easier

The DroneBotWorkShop links have accompanying videos... so grab a full meal, start the videos, follow along in the text. Easier is not possible. Either of these methods involve connecting, configuring and programming the hardware.

---

<div class="post-metadata">

**Author:** ![gcjr](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gcjr/32/314015_2.png) [@gcjr](https://forum.arduino.cc/u/gcjr)\
**Post date:** [September 12, 2025, 8:28pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/16 "2025-09-12T20:28:20Z")

</div>

> [@lynz68](#):
>
> would this be easier with a Bluetooth module as currently I'm going in circles and getting nowhere?

you would have the same issues with bletooth

if you can already send/receive commands, it seems the problem is determining when to send commands

can you monitor your joystick and recognize when its position has changed?

---

<div class="post-metadata">

**Author:** ![Paul\_KD7HB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_kd7hb/32/1127958_2.png) [@Paul\_KD7HB](https://forum.arduino.cc/u/Paul_KD7HB)\
**Post date:** [September 12, 2025, 8:48pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/17 "2025-09-12T20:48:29Z")

</div>

> [@lynz68](#):
>
> I can send different commands, however what I need to be able to do is move the servo as I please with the joystick not just to set positions

Take a different approach! Make the structure of your message contain the status and position of every part of your project, rather than individual commands. On the command Arduino, change any one or more of the fields each time you make a physical change, such as a joystick. Send this structured message at a constant time interval.

On the receive/slave end, read each message and if one of the fields has changed from the previous message, make your component follow the new value.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 11, 2026, 8:49pm UTC](https://forum.arduino.cc/t/controlling-a-servo-remotely/1406140/18 "2026-03-11T20:49:22Z")

</div>

Closed on March 11, 2026, 8:49pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
