# Using usb as output to control LED strip

**URL:** <https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988>\
**Category:** Device Hacking\
**Created:** [December 2, 2023, 4:18pm UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988 "2023-12-02T16:18:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lasermite](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@lasermite](https://forum.arduino.cc/u/lasermite)\
**Post date:** [December 2, 2023, 4:18pm UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/1 "2023-12-02T16:18:18Z")

</div>

Hello! I'm posting here because I can't find a satisfying answer elsewhere (I could be using bad search terms).

I am in early stages of making my own lightsaber. I am looking into using an arduino nano but the hardware could be changed if needed (my thinking for this question is that most controllers have a usb connection and might operate similarly). I am going through ideas of how to make the light part detachable and I thought of using the magnet detachable usb heads that can rotate (You might find them if you google "magnetic usb cable"). This would allow me to send power and data to the light-rod which would allow me to animate it while not worrying as much of the connection between handle and rod. Using a breakoutboard or pcb female side to connect power and data to the controller is easy enough, but I had an idea of maybe this connection could double as debugging (or updating) the controller. You would just plug in a usb cable to the same connection and your computer instead of the light-rod. This would however mean you'd have to be able to send the data to the LED-strip in the light-rod through one of the USB-leads. I'm not sure this is possible without it messing with the usb-protocol and similar. Could you have wiring for both functions that are physically switched? Could you through software let the controller take manual control of one of the usb-leads? I know you can send data back that's serialized but I have a sneaking suspicion that manual control of the data is harder (or impossible). Is there any clever solution around this were I can still have double functionality through the same connection?

I do realize this is a broad question and I apologize for that. If there's an obvious solution that I'm not seeing I would be happy to hear about that too. Thanks for any and all help!

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [December 2, 2023, 4:42pm UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/2 "2023-12-02T16:42:09Z")

</div>

Sure, USB connectors don't have to be used for USB. You can use a USB switch to switch USB signals and any other type of signal as long as it's 0 to 5V and low current.

> **[FSUSB42MUX | Digi-Key Electronics](https://www.digikey.com/en/products/detail/onsemi/FSUSB42MUX/2036916)**
>
> Order today, ships today. FSUSB42MUX – USB Switch IC 1 Channel 10-MSOP from onsemi. Pricing and Availability on millions of electronic components from Digi-Key Electronics.

---

<div class="post-metadata">

**Author:** ![DrDiettrich](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/drdiettrich/32/219048_2.png) [@DrDiettrich](https://forum.arduino.cc/u/DrDiettrich)\
**Post date:** [December 2, 2023, 8:56pm UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/3 "2023-12-02T20:56:45Z")

</div>

> [@lasermite](#):
>
> I'm not sure this is possible without it messing with the usb-protocol and similar.

You can cut off the USB connectors of the magnetic cable and connect the wires to whatever Arduino pins you like. The same for your light-rod.

But the contacts of a slip ring are not reliable, that's why such cables only can be used for **device charging** , not for USB data transmission.

---

<div class="post-metadata">

**Author:** ![lasermite](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@lasermite](https://forum.arduino.cc/u/lasermite)\
**Post date:** [December 2, 2023, 9:42pm UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/4 "2023-12-02T21:42:44Z")

</div>

Thanks for the reply.

Is the part about data transmission true? There are products on amazon and similar that claim to handle data transmission.

Also, connecting to the pins I know I could do but is there a way to program the arduino using the same connection? I'm looking to either plug in the usb directly into the usb reciever in the arduino and controlling the LED:s through that usb somehow, or maybe more reasonable, programming the arduino through some other pins. Is this possible?

---

<div class="post-metadata">

**Author:** ![lasermite](https://avatars.discourse-cdn.com/v4/letter/l/3bc359/32.png) [@lasermite](https://forum.arduino.cc/u/lasermite)\
**Post date:** [December 2, 2023, 9:44pm UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/5 "2023-12-02T21:44:33Z")

</div>

I like the idea of switching but any commersial usb switch I've found is always too big. Would there be an easy way to DIY something like this? My electrical knowledge is about 4/10.

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [December 3, 2023, 8:29am UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/6 "2023-12-03T08:29:44Z")

</div>

> [@lasermite](#):
>
> easy way to DIY something like this?

If your electrical knowledge is 4/10, I would say no.

---

<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:** [May 31, 2024, 8:30am UTC](https://forum.arduino.cc/t/using-usb-as-output-to-control-led-strip/1195988/7 "2024-05-31T08:30:11Z")

</div>

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