nice link. a little cheaper than EZBlocker - USB Power Blocking Cable - TH3D Studio LLC
Great description!. What would be necessary for this to work in the USA with 120 V supply?
Sorry, I do not see where this post refers to local mains voltage.
hi
mains voltage isn't relevant here. It's about the 5V the usb port uses
my bad! I was looking at the schematic to build the 'on-off' switch.
Or use this adapter and turn the switch to off.
hook between the pi and the printer cable.
link removed by mod
Please don't post temu or wish links
Those shops have a very bad reputation
Tape is a reasonable solution in a pinch, and definitely cheap, but potentially unreliable: the tape might move if disconnected and reconnected, for example.
I would recommend one of the following approaches, which will give a much tidier and more reliable result. This is mainly here for those people who aren't already very experienced with electronics, or who may have done it before and even own a couple of tools, but not know what the various parts are called or that these kits exist. For most of these, unless you find labeled breakāout cables, you'll want a multimeter to check you have your pināout correct.
-
cheapest: cut a sufficiently long USB cable, then reconnect the 3 wires needed (and the shield/case wire, if present), and leave the 4th one taped off on one side. You will need to know how to strip wire and have wire cutters and wire strippers; alternatively you can buy "USB pig tails" for each end for about $5-10 each. You can reconnect those wires with "screw terminals", which just require a screwdriver to reconnect, or if you have a heat gun or soldering iron you can use "heat shrink wire connectors" which have a small piece of solder inside that melts to connect the wires. If you have heatshrink you could bare solder the wires together, I just find that ends up looking messy.
-
Use motherboard USB header cables. These are commodity items and the headers are spaced well to fit into breadboard or a PCB prototyping kit. You can connect them to PCB/Breadboard and make the connections you want, or you can simply connect a Dupont female and male connector, and remove the cable for the +5V pin. For example: Raspberry Pi's USB A to Dupont cable will connect straight to this Dupont to USB A female cable. There's a little plastic catch you need to bend open with a knife or a pin, and then the cable with the connector on the end comes out easily.
-
about US$20: buy USB cables with builtāin screw terminals. For example, get both male and female USB to screw terminal cables ($9 each on Amazon), and connect the two screw terminals with any insulated wire you have on hand that fits, then plug your normal USB cable into the female connector.
-
If doing this in a professional manufacturing or industrial environment, you would probably lean more towards DIN rail connections. Break out a USB cable, crimp on some pins to the end of each wire (or tin them with solder), throw on heat shrink tube labels and connect each one to their own DIN block. Much Ooo! Very Aaah!
All of these approaches can be made to look quite tidy and professional, and if you're going to be doing more electronics in the future then you might want to invest a little in one or more of these approachesāheat shrink tubes, Dupont/breadboards, screw terminals, or DIN. They're handy!
[EDIT: see the below post for even tidier, joyfully tapeāfree solutions that are even less expensive that I missed while scanning these replies. While you could solve those issues with wiring changes and/or adding extra components once you have "broken out" to an electronics system, you'd probably only want to do it this way if you planned on doing other electronics work, and even then, a $6 preāpackaged solution is still likely the pragmatic choice]
Nice write up of options @samv,
The other solid options listed further up in the post should not be ignored. Many users of OctoPrint want/need a simple plug and play solution. I also feel it is necessary to point out that most of the solutions you have listed do not account for a Shield loop which can be just as important as disconnecting the +5v.
**Easy Options and note that they may be listed above already **
(this appears to have a connection for the shield on the one side but its construction is a bit of an issue in the same way as a breakout terminal or using a din rail terminal connection would. Yet still a pretty good plug and play option.
(not sure if this cable has a shield, it is not listed as having one)
And there is a stick style available on amazon:
(This appears in its construction to connect through the shield)
https://www.amazon.com/PortaPow-USB-Power-Blocker-Only/dp/B094FYL9QT
And this one: (full disclosure this one is made available through my Tindie store)
And there is this one just to round out the listing. not sure on the shield line.