I'm wall mounting a tablet and need to supply 5V. I've seen posts on how this can be achieved but my question is specifically about these types of power supply modules: enter image description here


Is it legal in the USA to add an inline power supply like this behind a light switch or outlet in an outlet box?

EDIT: So from all the great discussion here the best solution is to use a recessed electrical box plus an outlet with USB enter image description here enter image description here

  • 3
    Why not just use a safe, UL listed USB wall outlet? (spoiler: pretty sure that's not legal inside the junction/outlet box) – JPhi1618 Dec 4 '19 at 20:09
  • 1
    @Jeeped - excellent timing! I'm looking at replacing a few outlets and that review is very helpful. – FreeMan Dec 4 '19 at 20:44
  • 1
    @Geordie, right, it's your house and no one's going to break down the door and arrest you because you have a questionable device in a light switch box. Some things are "illegal" because of technicalities, and other things are illegal because they are dangerous in one form or another. Imagine that adapter has the worst possible design and it just catches fire and burns to ashes inside your electrical box. Are you OK with that risk, because no one has evaluated that device and said it won't do that... – JPhi1618 Dec 4 '19 at 20:47
  • 2
    Add to that if it does catch on fire and damages stuff, you may have an uphill battle with insurance for not following code. – DeadChex Dec 4 '19 at 20:52
  • 2
    The difference between this and something like the sonoff is that with the sonoff it's all mains voltage wiring, and there's no risk of mains voltage ending up on some micro-usb plug even if wires cross in an unintended way. – Nate S. Dec 4 '19 at 21:07

No, because of the source.

Generally anything you find on eBay or Amazon Marketplace is from the endless junkstream from Alibaba. These things are firestarters.

There are two things you need.

Must have a UL listing (or other recognized testing lab; not CE)

Equipment used in mains wiring must meet basic quality standards. That is called out on literally the first page of the National Electrical Code, in section 110.2.

In practical terms, that means approved by Underwriter's Laboratories, or a list of other "Nationally Recognized Testing Labs" seen to be of equal reliability: this list is maintained by OSHA. These include CSA, ETL, Intertek, BSI, TUV and a few others.

Notably, the list does NOT include CE, CCC, FCC or ROHS; none of these things are testing labs. These marks are typically used when the Chinese maker can't qualify for an NRTL. They certainly try to make people think CE is a meaningful mark; it's not, except for one context for items shipped from the manufacturer within Europe. Outside that, the mark is certainly fraudulent.

All this is because the device is interacting with mains voltage, and so has the possibility of starting a fire.

Must use according to instructions and labeling

This is in the NEC in the next section, at 110.3(b). The reason is that the testing labs (UL etc.) only test the item for certain uses - those discussed in the instructions and labeling. Using it "off-label" means the item has not been tested for that use.

A related issue is "electronic components" vs "equipment/devices". Equipment makers have the option of using electronic components that have already been UL-certified, which speeds up certification of the equipment. UL calls this component certification "RU" - we call this "Really Useless" (thanks ThreePhaseEel) because the component is simply not rated for direct use in building wiring. And obviously, the labeling and instructions say nothing about using that way.

So your idea of using a module is fine; however you must use a module that is UL-listed for that purpose.

  • Thank you for your answer, I'm not originally from the USA so not familiar with regulations. The fact that the only place I could find this type of thing was on eBay prompted me to ask this question. There's a lot of misinformation out there, there's youtube vids of electricians installing these in boxes etc – Geordie Dec 4 '19 at 21:59
  • @Geordie -- there are power supply modules that are available outside the junkstream, you just have to know where to look. (Usually, they're DIN rail mounted type things designed for industrial controls work, that are UL listed to UL 508, such as this Mean Well unit. The one downside is that you need a rather large j-box in order to fit them...) – ThreePhaseEel Dec 5 '19 at 2:20

If you installed a separate network jack you could then use


If you don't have any other network options, you can use a PoE injector to supply voltage on the other end of the cable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.