<p>I know this will be a really obvious question to some people, but I have bricked about 3 boards doing this so I want to be certain before I brick a fourth. I don't have a lot of experience working with AC voltage, especially crimping / hacking it like what's going on here. Trust me it was my last resort to ask this.</p>

<p>Basically, as a chamber heater I'm using some 120V heat lamps (here in the U.S.). The problem seems to be that when I connect my laptop to the board (if the laptop is plugged in, which it has to be for long-term serial control), sometimes I:</p>

<ol>
<li>Hear an electric shock sound -- the board is fried</li>
<li>Don't hear an electric shock sound -- the board is fried, though</li>
</ol>

<p>What I interpret from this is that I'm stupidly wiring the 120V heat lamps incorrectly relative to my 3D printer board, such that when I connect it to my charging laptop via USB, the AC voltages are out of phase, causing my board to be fried. Alternatively, it's the 12V/24V power supply that's wired wrong relative to everything else, which also needs to be wired to the same polarity.
<a href="https://i.stack.imgur.com/hPD8v.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hPD8v.png" alt="enter image description here"></a></p>

<p>I was on the understanding that when crimping a three-wire male electrical cord:</p>

<ol>
<li>White = Neutral</li>
<li>Black = Hot (or Load)</li>
<li>Green = Ground</li>
</ol>

<p>... reinforced on the left side of the below image as well: </p>

<p><a href="https://i.stack.imgur.com/HgeRE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HgeRE.png" alt="enter image description here"></a></p>

<p>So, I know that much already. <strong>The question is</strong>, when I connect this AC outlet to a <a href="https://rads.stackoverflow.com/amzn/click/com/B00LW15D1M" rel="noreferrer" rel="nofollow noreferrer">relay</a> like this, I got <code>NO</code>, <code>COM</code>, <code>NC</code> on one side and <code>IN</code>, <code>DC+</code>, <code>DC-</code> on the other. Which wire goes to <code>COM</code>, and which goes to <code>D-</code>? The board uses <code>COM</code> to denote the voltage that is switched 'on' by the relay, and <code>D-</code> to denote whatever the shared ground is among, the 3D printer, heat lamp, printer board, etc... (For more info, see link to relay)
<a href="https://i.stack.imgur.com/nuc81.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nuc81.png" alt="enter image description here"></a></p>

<p>This 5V relay says it supports AC loads being managed by an arduino / 3D printer, so I was under the impression that I could connect the white wire to its <code>D-</code> pin (which also should receive the "GND" for my 3D printer board) and the black wire to its <code>COM</code> pin. However, what do I do about the green wire? Nothing? Also, was it wrong for me to assume it would support this function when the Arduino is connected to a charging laptop via USB?</p>

<p>Basically, I just need to be sure that my laptop (3-prong), power supply (3-prong), heat lamps (2 or 3 prong) and relay (only 2-prong) all have matching polarities and don't cause an electric shock or fry my board. But I am getting really conflicting results and frying a lot of boards, probably by overthinking this. </p>

[{'answer_id': 11273, 'author': 'r_ahlskog', 'author_id': 14957, 'author_profile': 'https://3dprinting.stackexchange.com/users/14957', 'pm_score': 3, 'selected': False, 'text': '<p>You need to take a step back and think about what you are doing. From what I read there you are connecting the neutral to the low voltage. You should definitely not mix connections between your high and low voltage side. I think you are lucky to not have broken more things than the logic board.</p>\n\n<p>I quickly drafted this to show the idea.\n<a href="https://i.stack.imgur.com/0UIZT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0UIZT.png" alt="enter image description here"></a></p>\n\n<p>The relay provides isolation so you do not want any connections crossing over that electrically connects the sides. So you keep the 120V mains stuff on one side and the other side you connect to your logic board and printer supply.</p>\n\n<p>The grounds you can join to a common point or printer frame. I would never join L or N from different cables because at least here in Northern Europe our outlets are not keyed and can be rotated 180-degrees swapping L &amp; N which would create a dead short.</p>\n'}, {'answer_id': 11274, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 4, 'selected': True, 'text': '<p>In effect, the ground (from mains) does not need to be connected to the relay, the relay interrupts the "hot" or "neutral" (preferably the "hot", but that is not possible for all plugs, e.g. some European plugs can be inserted 180&deg; turned into the sockets). You connect one of the interrupted wires to the <code>COM</code>, the other interrupted wire (that goes to the lamps) to the <code>NO</code> (or the <code>NC</code>, depending on safety, the logic and/or preference). The ground wire from the mains power socket is not necessary at all (some lamp amratures require this to be connected though). See a schematic below, it uses an Arduino Uno, but you can think of it being the printer board. Note to never connect the ground from mains to the printer board directly!</p>\n\n<p><a href="https://i.stack.imgur.com/oKLoi.png" rel="nofollow noreferrer" title="Connecting lamp to relay"><img src="https://i.stack.imgur.com/oKLoi.png" alt="Connecting lamp to relay" title="Connecting lamp to relay"></a></p>\n\n<p><sub><a href="http://osoyoo.com/2017/08/28/arduino-lesson-1-channel-relay-module" rel="nofollow noreferrer">Image based on source: osoyoo.com</a></sub></p>\n\n<p>The logic (low voltage side of the relay) needs to be wired as follows:</p>\n\n<ul>\n<li><code>DC+</code> is the voltage power supply of the relay module, this is frequently +5&nbsp;V, but some modules use +3.3&nbsp;V (sometimes there is a jumper cap to select the voltage)</li>\n<li><code>DC-</code> is the ground from the printer board</li>\n<li><code>IN</code> is the trigger that needs to be connected to the port on the printer board that electronically switches the relay</li>\n</ul>\n'}, {'answer_id': 11275, 'author': 'Trish', 'author_id': 8884, 'author_profile': 'https://3dprinting.stackexchange.com/users/8884', 'pm_score': 2, 'selected': False, 'text': '<p>Let\'s look at the notes on the relay first, as these tell us what to connect the terminals to.</p>\n\n<h2>Powered side</h2>\n\n<ul>\n<li><code>NO</code>/<code>NC</code> - Normally Open/Normally Closed lead. Which you use determines the switching behavior: open line on signal (NC) or closed line on signal (NO). Connect this to the powered component.\n\n<ul>\n<li>For heater components <strong>it is best to use NO</strong>, as a failure of a signal automatically stops heating, making this a safety means! If any of the supply wires are ripped or pulled from the terminals or the board is fried, the power of the heater doesn\'t come through.</li>\n</ul></li>\n<li><code>COM</code> - Common. This is the other lead of the switch part of the component, the line that transports the power to the switch. Connect this to the power supply.</li>\n</ul>\n\n<h2>Low\xa0Voltage signal side</h2>\n\n<ul>\n<li><code>IN</code> - Input. Here the switch signal goes in\n\n<ul>\n<li>This is a 5\xa0V Signal</li>\n</ul></li>\n<li><code>DC+</code>/<code>DC-</code> - This is the power supply for the switch and should be the same as the power supply for the Board. Check your Rating! \n\n<ul>\n<li>Red "High" on DC+ </li>\n<li>Black "Low" on DC-</li>\n</ul></li>\n</ul>\n\n<p><a href="https://i.stack.imgur.com/lzuv9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lzuv9.png" alt="Wiring Diagram"></a></p>\n\n<p>Note I used European colors to differentiate the 5\xa0V side from the mains-power side better. You have your Neutral in white, Phase in black, Ground in green on your Power Supply picture. This <a href="https://paladintech.files.wordpress.com/2014/10/2014-10-11-18.png" rel="nofollow noreferrer">color conversion</a> can be handy.</p>\n\n<p>If the heater lamp has a connection for the ground wire, use it! This should be the same ground wire the power supply is connected to, to ensure safety.</p>\n'}, {'answer_id': 11276, 'author': 'Harper - Reinstate Monica', 'author_id': 19011, 'author_profile': 'https://3dprinting.stackexchange.com/users/19011', 'pm_score': 2, 'selected': False, 'text': '<p>Mains electric specialist here.  When working in mains power, mechanical execution of work is <em>everything</em>.</p>\n\n<p>The first rule is do not casually mess around with mains power -- it will kill you! If you\'ve done a lot of low-voltage tinkering with jury-rigged wires splayed all over the place -- <strong>do not do that with mains wiring. Ever</strong>.  Break that habit with mains! </p>\n\n<p>The second rule is hard separation.  It is absolutely forbidden, for instance, to have low voltage wires intermingled with mains in a jumble, even inside a metal box.</p>\n\n<h2>A "Chinese wall" between mains and low-voltage</h2>\n\n<p>By which I <em>don\'t</em> mean low quality.  Generally all wires associated with mains should be inside a grounded metal enclosure, and all low-voltage wires should be outside that enclosure, or separated by a physical divider. </p>\n\n<p>Here is an ideal setup that will pass muster.  </p>\n\n<ul>\n<li>A standard square drawn steel junction box, with knockout holes, \\$1</li>\n<li>a #10-32 ground screw for that hole on the bump</li>\n<li>A cover plate, \\$1, made to take ....</li>\n<li>... two common receptacles, but get the higher quality <a href="https://www.handymanhowto.com/electrical-outlets-side-wire-versus-back-wire/" rel="nofollow noreferrer">screw-and-clamp type</a> - $2.50 each so we can use stranded wire.  I\'m assuming you have more than 2 lights.  If not, you can wire this thing so half the sockets are always-on.  </li>\n<li>a couple feet of #12 stranded THHN wire, each red, black and white  (20 cents/foot)</li>\n<li>A <a href="https://rads.stackoverflow.com/amzn/click/com/B00D5YLY2G" rel="nofollow noreferrer" rel="nofollow noreferrer">relay-transformer</a> that mounts to a knockout hole.  </li>\n</ul>\n\n<p><a href="https://i.stack.imgur.com/hf7tS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hf7tS.png" alt="enter image description here"></a>\n<a href="https://i.stack.imgur.com/bDm9j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bDm9j.png" alt="enter image description here"></a>\n<a href="https://i.stack.imgur.com/BNSTY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BNSTY.png" alt="enter image description here"></a></p>\n\n<p>For now just imagine 3 mains wires coming in: black hot, white neutral and green earth. Earth goes to that #10-32 screw hole on the bump, and the metal case grounds everything else. </p>\n\n<p>I <a href="https://www.jlconline.com/how-to/electrical/q-a-to-pigtail-or-not-to-pigtail_o" rel="nofollow noreferrer">pigtail</a> wires on receptacles because it\'s easier, but it\'s also clearer for a novice (than using a receptacle as a splice block). On the receptacles, pigtail neutral with <strong>white</strong>.  Hot gets a <strong>red</strong> pigtail if switched, and <strong>black</strong> if always-on. </p>\n\n<p>Fit the relay into a knockout hole, mains wires inward.  </p>\n\n<p>Now you have a bunch of black, red, and white wires.  Join them by color! Easy peasy!  This is why I made such a fuss about getting 3 colors of THHN wire. </p>\n\n<p>Button it all up, and the mains work is done.  </p>\n\n<h2>Getting power into our box</h2>\n\n<p>I glossed over bringing mains supply into this box.  Let\'s review that further. </p>\n\n<p>That junction box is made to mount on a wall.  It\'s a code violation to use it as a portable box (but lots of people do). However you must use <strong>cordage</strong> (SJOW, SJOOW etc.) not in-wall wiring (NM, THHN, UF).  I just buy a 14 AWG extension cord and lop the socket off. Visit the electrical supply house (Greybar, not Mouser) and get a strain relief that\'ll fit that cord and a knockout hole. </p>\n\n<p>If you want to mount it on the wall over another box, they make special 4" square boxes for that. If the existing box is a similar box, they make "extension boxes" with open backs.  They also make ones designed to go over top of a 1-gang box that is metal or plastic.  </p>\n\n<p><a href="https://i.stack.imgur.com/UDuin.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UDuin.png" alt="enter image description here"></a></p>\n\n<p>If you need the existing outlet space on the wall, you can use surface conduit systems like Legrand Wiremold (not to be confused with cable organizers intended for low-voltage cables only). You extend off an existing outlet, leaving that with its original function, then run surface conduit to another box, where you mount these items.  </p>\n\n<h2>Make the system talk to it</h2>\n\n<p>That was a lot of heavy lifting, but the rest is downhill. </p>\n\n<p>On the above relay, you simply attach 2 wires to W and R.  (in fact, common thermostat cable is "W"hite and "R"ed, coincidence: not). If you short those wires to each other, the relay operates and the lights turn on. Use an appropriate relay if needed.  There is low voltage AC on these wires (24VAC between them, 34V peak, isolated from earth and mains) which means you can route these wires without mains-level protection. </p>\n\n<p>They make other relay-transformers, but I really like how this one puts the low-voltage on opposite sides of the knockout from the mains.   They also make cheaper relays that accept 24VDC or even 12VDC, but then you have to supply that. </p>\n'}]
['https://3dprinting.stackexchange.com/questions/11272', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/10369/']