Indoor Positioning System icon Indoor Positioning System — Infrared indoor positioning for ARC robots: dual-camera tracks IR beacon, shows real-time heading, path and EZ-Script navigation variables Try it →
Germany
Asked
1 Participant
ESP32-CAM servo pins and Virtual Robot

ESP32-CAM Servo Pins And Virtual Robot

Using an AI-Thinker ESP32-CAM flashed with the Synthiam ESP32-CAM firmware (Client mode), ARC connects fine and the Camera Device skill streams video perfectly. I’m building a tiny pan/tilt with two SG90s and want to visualize it with the Virtual Robot skill. I added Virtual Robot with a front photo, created two markers (Pan, Tilt), and linked them to my servos. When I jog the servos in ARC, the Virtual Robot markers move as expected, so ARC thinks everything is good.

The physical servos are where I’m stuck. I first used D12 (Pan) and D13 (Tilt), then tried D14. Behavior ranges from jitter/no movement to the ESP32-CAM rebooting if both servos move together. If I try D2, the onboard flash LED triggers instead of moving the servo, so I’m clearly colliding with something. Power-wise, the servos are on a separate 5V/3A buck, grounds are common with the ESP32-CAM, and I added a 470 F cap at the servo rail. I also reduced servo speed and staggered moves in ARC to lower the surge current. If I disable the camera temporarily, the servos behave a bit better, which makes me suspect pin timing or a camera/SD pin conflict.

What I’m missing is a definitive D-port to GPIO map for this firmware on the AI-Thinker board that calls out which D ports are actually safe for standard 50 Hz servo PWM (i.e., not tied to the camera, SD, boot strapping, or the flash LED), and whether there’s a best practice for linking Virtual Robot markers (by port vs by a named servo in a servo control) so the overlay keeps tracking if I later remap the hardware ports?



Related Hardware (view all EZB hardware)
ESP32 Cam by Espressif
ESP32-CAM with Synthiam ARC streams live video for robot vision, digital I/O, sensors, UART, and Wi‑Fi control.
Wi-Fi
Servos Varies
Camera
Audio
UART Varies
I2C
ADC Varies
Digital Varies

Related Robot Skills (view all robot skills)
Virtual Robot by Synthiam
Display robot image with real-time servo position readouts and basic servo management including servo deletion
Camera Device by Synthiam
Use PC or robot cameras for vision tracking: color, QR, glyph, face, object, motion; record video/data, control servos and movement, run scripts

ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

Author Avatar
PRO
Canada
Twitter YouTube GitHub
#1  

You’re running into two separate issues here:

  1. ESP32-CAM pin conflicts / boot-strapping pins
  2. How Virtual Robot should be linked so the visualization survives hardware remaps

The important part first

On the AI-Thinker ESP32-CAM, there is not a large pool of truly safe GPIOs for hobby servos while the camera is active. That board is notorious for pin conflicts because many pins are already consumed by:

  • the camera
  • the onboard flash LED
  • boot strapping requirements
  • optional SD circuitry

So the behavior you described is exactly what I’d expect when a servo is moved onto a pin that the board uses internally or expects to be at a certain state during boot.

Why D2 triggers the flash LED

That’s a classic conflict. On the AI-Thinker board, D2 is commonly tied to the onboard flash LED circuitry, so using it for PWM servo output will interfere with the LED and/or the servo signal.

Why the board reboots when both servos move

That usually points to one of these:

  • a boot-strapping pin being driven into the wrong state
  • servo current noise coupling into the ESP32-CAM
  • a pin shared with camera/flash circuitry causing instability
  • brownout or reset due to transient load, even with separate power if grounds or signal routing are noisy

Since you said it behaves better with the camera disabled, that strongly suggests pin contention with the camera subsystem, not just power.


Best practice for the AI-Thinker ESP32-CAM

For this board, I strongly recommend you treat pin selection as model-specific, not generic "D-port safe" selection.

Synthiam’s firmware for ESP32-CAM uses a mapping layer, but the safe pins still depend on the board model and what features are enabled. The right reference is the firmware notes on the ESP32-CAM hardware page:

Practical guidance

For AI-Thinker, the pins that are often usable for non-camera I/O are the ones people commonly test first, but they are not guaranteed across all revisions or feature combinations. If a pin is used by:

  • camera data lines
  • flash LED
  • SD card lines
  • boot mode strapping

then it is not a good servo pin.


What I’d do in ARC

1) Test one servo at a time

Before trying pan + tilt together:

  • keep the camera running
  • test only one servo
  • identify a pin that moves the servo cleanly without reset
  • then test the second servo on a different pin

2) Avoid the usual trouble pins

On ESP32-class boards, be especially careful with:

  • boot strap pins
  • flash LED pin
  • any pin explicitly mentioned in the firmware comments as reserved

3) Use a servo skill or script to slow motion, not the Virtual Robot

The Virtual Robot is only a visual mirror. It doesn’t solve hardware mapping; it just reflects what ARC thinks the servo position is.


About Virtual Robot linking

Your current setup is the correct idea:

  • add a real servo control / servo mapping
  • link the Virtual Robot marker to that servo

Best practice

Link the Virtual Robot to the servo name/servo control configuration, not to a hard assumption about a physical pin.

That way:

  • if you later remap the hardware port
  • you update the servo control’s port
  • the Virtual Robot continues to follow the same named servo relationship

In other words:

  • Virtual Robot should follow the servo abstraction
  • the servo control should own the hardware port

That is the proven ARC pattern. Don’t tie your visualization directly to a physical D-port if you expect to change hardware later.


Recommendation for your pan/tilt project

For reliability on an ESP32-CAM, I’d suggest:

  • keep the camera skill active only on pins/features that don’t conflict
  • use servo controls for Pan and Tilt
  • link Virtual Robot to those servo controls
  • avoid trying to "force" servos onto camera-related pins

If you want, I can help you build a known-good pin plan for your exact AI-Thinker board revision and the features you have enabled. If you can share:

  1. whether SD card support is enabled in your firmware build
  2. which exact D ports you’ve tested besides D2/D12/D13/D14
  3. whether your servos move correctly if the camera skill is stopped completely
  4. what you’re trying to achieve overall: just camera pan/tilt, or a full tracked head on the robot?

If you want, I can also show you the clean ARC setup for naming the servos so the Virtual Robot remains stable even if you change the hardware ports later.

I am a customer support AI and still learning. Please verify important answers in our support documentation. For advanced AI features, use the AI Script Agent built into ARC.