How to connect my Arduino to both my linear actuator and two servos (Currently have my linear actuator connected to a XY160D H-Bridge)

Hi everyone,

I’m working on an Arduino project and could use some advice. My goal is to have a single button press trigger both a XY160D linear actuator and two hobby servos at the same time. Here’s what I have so far:
• The XY160D actuator is powered by a 12V wall adapter through its barrel connector.
• I’ve been controlling it with the Arduino by connecting 5V and GND from the Arduino to the actuator for signal purposes. This works fine for moving the actuator.
• I now want to add two servos to the project, but I’m not sure how to integrate them because:
• Servos also need 5V power, and I only have one 5V pin on the Arduino.
• I want to make sure I don’t overload the Arduino or cause voltage drops.

My main questions:
1. What’s the best way to wire both servos and the actuator so they can all be triggered by the Arduino without damaging anything?
2. Can I safely use the Arduino’s 5V for the servos, or should I use a separate 5V power supply?
3. Are there any tips for coding this so that a single button press moves the actuator and the two servos in sequence or simultaneously?

I’d really appreciate advice on both the wiring and Arduino code side. I’m hoping to make this a smooth, one-button operation without risking the Arduino or components.

Thanks in advance for any guidance!

  1. Please post a link the actuator product page or data sheet, and identify the exact model of servo.

  2. No, servos and actuators must all be powered separately. The 5V Arduino output is intended for at most a couple of LEDs or low power sensors.

Example servo connection (don't forget to connect all the grounds).

I’m hoping to make this a smooth, one-button operation

What is that operation? The details matter.

Here are some simple guidelines that if violated tend to destroy the Arduino and make the Arduino sales person happy.

Gil's Crispy Critter Rules for Processor Hardware:

  1. Rule #1: An Arduino is NOT a Power Supply!

  2. Rule #2: Never connect anything inductive (motors, speakers) directly to an Arduino!

  3. Rule #3: Avoid connecting or disconnecting wires while the power is on.

  4. Rule #4: Do not apply power to any pin unless you are certain of what you're doing.

  5. Rule #5: Do not exceed the maximum voltage or current ratings.

  6. Rule #6: Many Arduinos cannot power transmitters directly.

  7. Rule #7: Before powering your project, take a break and double-check the wiring.

  8. Rule #8: Bad soldering makes for project failure.

LaryD’s Corollaries:

  1. Coro #1: When starting out, add a 220Ω resistor in series with both input and output pins to protect against shorts.

  2. Coro #2: Invest in a Digital Multi-Meter (DMM) to measure voltages, currents, and resistance.

Note: Violating these rules can turn your Arduinos into crispy critters. For optimal performance, keep your wires under 25 cm (10 inches).

Additional Tips:

  • The L293 motor driver, though common, is inefficient as it can lose around 3V as heat when driving both legs of a motor. Consider using a motor driver with MOSFET outputs to reduce heat loss and conserve battery power.

  • Not all motor drivers work with each motor, they have to be compatible.

  • The nRF24 radios do not work very well when powered with an Arduino even if the 5V adapter is used.

  • For more on powering Arduino boards, explore this guide: Powering Alternatives for Arduino Boards.

When working with motors remember they have a starting current possibly 10X the running current.

1 Like

What is this?

Hi, @jannmckay

XY160D does not Google as a linear actuator.

Can you please post a link to data/specs?

What is your project?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Sorry the XY160D is a dual H-Bridge. This is the set up as of now:
Uploading: IMG_8666.png…
I watched this video:

My question is: how do I add in (2) servos to this set up, so the run with the same code.

Thanks,

You could use step down converter from 12V to 5-6V for your servos. If your 12V power supply is rated for that (undescribed) current draw.
You can run code for both with same arduino.

1 Like

What does that mean? So that forum members might have some idea what you are talking about, post the "same code", using code tags.

Hey, yeah. By same code, I mean combining my 2 servos into what I currently have set up (my linear actuator connected to my XY160D H-Bridge, and arduino). I don’t know how to add two servos to my current circuit. I have code to tell the linear actuator to go up and down. But as it goes up I’d like my servos to rotate one way, and then as it comes down I’d like it to rotate the other way.

See the diagram in post #2 .
You will need a separate 5V supply for the two servos and supply the UNO through the 5V pin.

You could use step down converter from 12V to 5V for your servos.

Tom.... :smiley: :+1: :coffee: :australia:

Adding servos would just take a couple more lines of code. Your favorite search engine, armed with a search phrase like "arduino servo", will find countless examples.

Post some info on the actuator and servos, preferably links to datasheets or at least, brand names and EXACT part numbers.

Hi there,

The actuator is a 12V 12” Windy Nation linear actuator, and the servos are the small ones that come in the arduino kit.

One of these?
https://www.windynation.com/collections/linear-actuators

Since you never posted your code, we don't know what you currently have,