Easiest way to power a USB-micro board from 120V

I’ve got a tiny little board that I normally power via USB micro with a regular 5V wall wart. It’s being mounted to the back of a light fixture where it’d be ideal to just connect to the 120V supply there with wire nuts. What’s the easiest way to do this? I found this power supply (https://www.sparkfun.com/products/14601) which can be hardwired to 120V, but then I’d have to attach that to a USB micro cord somehow… any other ideas?

I’d check with Digi-Key or Mouser Electronics for something like that. The Mean Well LED Switching Power Supply would do the trick but it’s fairly bulky and probably provides more current than you need, but should work just fine if you have the space for it.

Since you’re building this into a light fixture, it would be very wise to use something UL listed and designed for the application rather than hacking a USB charger or another power supply. If you did that and anything happened, and the insurance company found it, they could potentially deny a claim so it’s better to pay a bit extra to do things the right way.

You might find a better solution but a quick search on Digi-Key turned up a few potential power supplies that might work for you. Just make sure you pick a supply that has a voltage and current output appropriate for your load.

[945-2210-ND This is enclosed and has lead wires already attached.

[945-3043-ND If you’re designing your own board, this could be soldered directly on your board.

For connecting a USB cable to those, you could either cut the USB A plug off one end of a cable and connect the power leads to the supply or use something like [BOB-12700 and a regular USB cable.](SparkFun USB Type A Female Breakout - BOB-12700 - SparkFun Electronics)](RAC01-05SGA Recom Power | Power Supplies - Board Mount | DigiKey)](RAC04-05SC/W Recom Power | Power Supplies - External/Internal (Off-Board) | DigiKey)

Yes, I suppose there isn’t simply a 120VAC → 5VDC USB micro adapter all in one piece X-) I can definitely build it in a number of ways I just wasn’t sure if there was something already out there. Do you know if there’s a bare-wire USB micro cable that I can solder directly to the DC output? I just want to be able to heat-shrink everything and not have to worry about intermediate boards or adapters in the middle of things.

Yes, I suppose there isn’t simply a 120VAC → 5VDC USB micro adapter all in one piece. I can definitely build it in a number of ways I just wasn’t sure if there was something already out there.

Unless you're talking about using an outlet plug in USB charger with a USB cable plugged into it, It would be such a niche item that I doubt it.

Do you know if there’s a bare-wire USB micro cable that I can solder directly to the DC output?

Again, that would be a really niche type item. There's *probably* a company making such a part that gets assembled into another product somewhere.

The problem is figuring out where to get one, how long it take to ship and they are probably making them in large quantities for one or two industrial customers. If someone is making them and you find them, they might not be willing to sell you just one or two at a time. Alibaba or Aliexpress might be potential places to look. There are companies that will build something like this for you, but they are going to want to sell you thousands at a time.

As cheap and plentiful as micro USB cables are, it might be easiest to just chop the connector off one end and strip the insulation back. You could do that in 60 seconds where it might take days of searching plus weeks of shipping to order the exact part you’re needing.

I just want to be able to heat-shrink everything and not have to worry about intermediate boards or adapters in the middle of things.

One of the two supplies I mentioned before would just take soldering 2 wires and heat shrinking the connections. Shouldn’t take but a few minutes to do all that. If it’s just for a project, I’d go that route.