USB control h-bridge motor, LED strips, AND single LED's

Programmer for years, new to Arduino/electronics. I can do simple things like light an LED or make an h-bridge for a motor, but this is what I need to do...

I've built a flight simulator. In it, I need to put internal lighting, via Radio Shack LED strips, 5-10 individual LED's to serve as a console, and a bi-directional motor to extend/retract the controls.

  • Can I put all of these on one Arduino? I have enough pins to control them all, but is there a problem with powering all of them?

  • I want the USB to control the color/intensity of the lights, and the direction of the motor. Speed of the motor isn't a factor, just clockwise/off/counterclockwise.

Can someone help me with a sketch/diagram to get started on this? I'm hoping for a single device connected to the PC via USB that will control the console led's, the interior lighting led's, and the motor that turns a threaded rod that pushes/pulls the drawer with the controllers mounted on it.

Could also use help determining the best motor to use for this situation. Needs to be strong enough to turn a pretty heavy rod, and fast enough that the rod will spin at least 120-200 rpm.

Thanks in advance for any assistance.

You have to consider the power availability of the USB port/s.

Are you taking about a battery powered laptop or mains desktop, fitted with USB2 or USB3 ports ?

Also consider your the maximum current your arduino pins can handle.

Are the led strips those RS USB ones, the others at 12v rated?

What are the power rating of the leds , have you calculated their total current.

Same goes for the motor, you will need to find its current as it likely to be quiet heavy if you want a heavy and fast start up.

Well, I did not intend to power the entire setup via USB, just control it programmatically I know that I cannot get a motor that will power the axle that would run off the 5V available from the USB port. I had planned on using a 12v (or possibly 9v) power supply for the motor, and then run the LED's from the Arduino's power, but if that's not possible, then I'd get power for the LED's separately too. That's kind of what I was trying to determine here.

The LED's lighting the place are the RadioShack flexible strip, cut into pieces, but connected, so the full values for that. The other LED's are going to be simple small LED's for indicators lights.

Not knowing much about Arduino yet, I was just planning on taking the disparate parts I know, building a 12v motor controller on h-bridge, and lighting individual LED's via USB commands, and trying to merge them onto a single project board and Arduino, so I didn't have to have 3 different devices connected to USB.

I mean, a steering wheel game controller can have the potentiometer (and several buttons), servo for force feedback, and several LED's, all running off a single wall supply, and controlled via a single USB. That's kinda what I'm going for here.


  • Can I put all of these on one Arduino? I have enough pins to control them all, but is there a problem with powering all of them?

You say you will have separate power supplies for the motor. High-power LEDs would also require a separate power supply but you would be able to power a few small LEDs (that take 5 or 10mA) directly from the Arduino. The specs say that an I/O pin on an Uno or Mega can deliver a max of 40mA but I think it would be wise to limit yourself to 20mA. And it is important to note that there are also limits for the amount of current you can draw from pins on one I/O port and from the total Atmega 328. You should read the Atmel datasheet for all the details.


Excellent information, and along the lines of what I was looking for.

I don't mind running the console led's from the Arduino, since that's not going to too many or too much draw, but I know I'm going to need more power for the motor and the LED strip. So can I power the motor and the LED strip with a wall brick (AC power supply) and still connect them to the same Arduino? That way, my program can control the motor and the lights and the leds all through a single USB cable, which is what I'd want to do. Any idea what a diagram like that would look like?

Any idea what a diagram like that would look like?

You are the guy with all the data.

if you want advice make a simple pencil drawing showing how you propose to connect things and post a photo of the drawing.

And post links to the datasheets for the external devices.

Generally you need to connect the GND for the power supplies to the Arduino GND. But specific items may have an internal connection - hence the need for the details.


Yes, good idea. So here's a drawing of what I want to do. I need to know if it's feasible, and I could use recommendations on the motor.

Click here to see the drawing.

Now, what I'm trying to achieve is that the USB connected to the Arduino tells the motor to turn, and which direction, so I can extend and retract the controller.

I also want the Arduino to tell the LED strips how bright (and what color) to light the cockpit.

Finally, I want the Arduino (from USB commands) to light each of the LED's on the console.

It will be much easier if you post the JPG file here so that we can see it while reading your comments. See this Image Guide

I have looked at your image and it is not as unambiguous as I would like. I think it is showing that there is a common GND with the Arduino, and that is correct. But there would be no connection between an Arduino and a motor - only with the h-bridge - so I may be misunderstanding what you have in mind.


Thanks for the reply. Can't upload image from my office, so I'll have to fix that later.

You are correct, that I incorrectly connected the Arduino to the motor, and not the h-bridge. As I said, I'm am very new at this, and even though I knew better, that's the kind of mistake a noob like me makes, and hopes you guys catch. So, good catch.

That being said, I hope the rest of the drawing makes sense. I don't know how else to communicate it, but I have a cockpit I built. In that cockpit, I want the PC to control aspects of the cockpit. For now, I've limited it to:

  • Motor that extends/retracts the controller
  • LED Strip that serves as interior lighting
  • 5-10 small LED's that serve as console indicator lights

Eventually, I'd like to add a heater and a fan that can also be controlled by the PC, but I don't want to get ahead of myself.

I know this is way too much to power via an Arduino, so I plan on having all of these in a component that will plug into the wall, and USB plug into the PC for control commands. I know plenty of devices have multiple components running off one power supply, like a DVD player would have motor for spinning the disk, motor for ejecting, the display, the video processing stuff. So I wouldn't think it would be too difficult to have a motor, an LED strip, and 5 LED's running off one Arduino.

Am I missing something? And is there a good online resource where I can whiteboard this, like dragging components onto a virtual breadboard to figure out what voltage I need? That's the kind of help I'm looking for, taking this concept (and the incorrect drawing) and getting a schematic from it I can put on the arduino.

Am I missing something? And is there a good online resource where I can whiteboard this, like dragging components onto a virtual breadboard to figure out what voltage I need?

I think you have the concept generally correct.

The voltage that a component requires is independent of all the other components and will be stated in its user manual or datasheet. Life is simplest if all the parts need the same voltage. If not you may need multiple power supplies or a power supply that can provide the highest required voltage (I am assuming safe voltages below (say) 24v) together with some devices to drop that voltage to the lower voltages that other parts require.

As well as getting the voltages correct you need to ensure that your power supply(ies) can provide enough amps. Having more amps available than you need will not be a problem, but having too few will be.


Great advice! So, it seems to me that any motor strong enough to turn the threaded rod fast enough, is going to require more voltage than the LED strip does. So I'll need to work out a circuit that feeds the full voltage to the motor, then feeds a dropped amount of voltage to the LED's. Guess I'll be researching voltage regulators next!

So, it seems to me that any motor strong enough to turn the threaded rod fast enough, is going to require more voltage than the LED strip does

That is much too simple. The motor will need more watts (power) and 1 watt is 1 volt x 1 amp. So you can get 100 watts with 5 volts x 20 amps or 20 volts x 5 amps etc.

It may be possible to get a motor that will work on the same voltage as your LED strip, and it may not.

Write down the required voltages of the components where you know the value.


Having gone through Youtube videos, I’ve noticed a lot of people successfully salvaging battery operated drills. I have both a battery operated one, and a corded one, either of which I can salvage.

So now I’m wondering if I can just pull that out, connect the trigger mechanism to be always on, and connect the arduino to the directional switch, and use the arduino (or PC via USB to the arduino) to toggle the direction between (CW, off, and CCW)?

Granted, this doesn’t help me with the LED’s and I would probably end up doing them separately, but this would get me a reliable motor, and I know it would be powered correctly since it’s using it’s own power, and I wouldn’t need to make and h-bridge circuit since the drill comes with the directional switch.

I’d just need to figure out how to connect the Arduino to that switch on the drill that determines direction. Maybe as simple as connecting an IO Pin to each side (CW and CCW) and just using code to turn on a pin depending on whether I want to extend or retract?