nodemcu控制开关电灯_如何更换由电灯控制的插座
nodemcu控制开关电灯
In some houses, light switches on the wall might control individual outlets, where you can plug in lamps and other lights. They’re really convenient, but if you ever need to replace that outlet, there are some important things you’ll need to keep in mind. It’s not the same as replacing any other outlet.
在某些房屋中,墙上的电灯开关可能会控制各个插座,您可以在其中插入灯和其他灯。 它们确实很方便,但是如果您需要更换该插座,则需要牢记一些重要事项。 这与更换任何其他插座都不相同。
Warning: This is a project for a confident DIYer. There’s no shame in getting someone else to do the actual wiring for you if you lack the skill or knowledge to do so. If you read the beginning of this article and immediately visualized how to do it based on past experience wiring switches and outlets, you’re probably good. If you opened the article not sure how exactly we were going to pull this trick off, it’s time to call in that wiring-savvy friend or electrician. Also note that it may be against the law, code, or regulations to do this without a permit, or it might void your insurance or warranty. Check your local regulations before continuing.
警告 :这是一个充满信心的DIYer的项目。 如果您缺乏其他技能或知识,请别人帮您完成实际接线并没有什么可耻的。 如果您阅读本文的开头并根据过去对开关和插座的接线经验,立即看到了如何做,那可能很好。 如果您不确定这篇文章的开头,不确定我们将如何实现这个技巧,那么该找这个精通布线的朋友或电工了。 另请注意,未经许可执行此操作可能违反法律,法规或法规,否则可能会使您的保险或保修无效。 在继续之前,请先检查您当地的法规。
你需要什么 (What You’ll Need)
Before you dive deep into replacing an outlet, you’ll need a few tools to do the job.
在深入研究更换插座之前,您将需要一些工具来完成这项工作。
The absolute must-have tools include a flat-head screwdriver, a Phillips-head screwdriver, and some needle-nose pliers. Some optional—but very handy—tools include some combination pliers (for twisting wire together if needed), a wire stripper tool (in case you need to cut wire or strip off wire housings), and a voltage tester to make sure the wiring isn’t still live.
绝对必要的工具包括一字螺丝刀,一字十字螺丝刀和一些尖嘴钳。 一些可选的但非常方便的工具包括一些组合钳(如果需要,用于将电线拧在一起),剥线工具(以防您需要剪断电线或剥去电线外壳的情况)和电压测试仪 ,以确保电线没有还活着。
You also need a new outlet. You don’t need to get super fancy here, and any basic outlet will do the trick—just make sure it’s UL-certified by looking for this logo on the outlet when you go to buy one. This one from Leviton is a great option and it’s also tamper-resistant, making it great for households with kids.
您还需要一个新的插座。 您不需要在这里花哨的东西,任何基本的插座都可以解决问题,只需在购买时通过在插座上查找此徽标来确保它已获得UL认证。 Leviton的这款产品是一个不错的选择,并且具有防篡改功能,非常适合有孩子的家庭。
第一步:关闭断路器箱的电源 (Step One: Turn Off the Power at the Breaker Box)
Before you actually start taking things apart and messing with wires, you need to shut off the power to the outlet by turning off the appropriate breaker at the breaker box.
在您开始拆开东西并弄乱电线之前,您需要通过关闭断路器盒上的适当断路器来切断电源。
Most of the time, you’ll only need to turn off one breaker, but sometimes houses have unique wiring setups where some outlets are connected to two breakers (like my house). This actually isn’t too rare, as outlet junction boxes sometimes serve as junction boxes for other circuits passing through.
大多数时候,您只需要关闭一个断路器,但是有时房屋具有独特的接线设置,其中一些插座连接到两个断路器(例如我的房屋)。 实际上这并不是很罕见,因为出口接线盒有时会用作其他电路通过的接线盒。
Your circuit breaker should have a diagram of what breakers control which areas of your house, but to be sure that you turned off the correct breaker, a good trick to use is to plug in a stereo and crank the music so that you can hear it from the breaker box. Flip off the breaker and if the music stopped, then you hit the right one. Again, there may be a second breaker you’ll need to flip, so it’s a good idea to test the wiring inside the outlet box before you start messing with it, as described below.
断路器应有一个示意图,说明哪些断路器控制了房屋的哪些区域,但是要确保关闭正确的断路器,一个好的窍门是插入立体声音响并摇动音乐,以便您可以听到从断路器箱。 翻转断路器,如果音乐停止,则您击中了正确的断路器。 同样,您可能需要翻转第二个断路器,因此,如下面所述,在开始弄乱插座箱之前,最好测试一下插座内的布线。
第二步:删除现有的插座 (Step Two: Remove the Existing Outlet)
Start by taking your flat-head screwdriver and removing the small screw in between the two receptacles.
首先拿起一字螺丝刀,然后卸下两个插座之间的小螺丝。
From there, you can remove the faceplate.
从那里,您可以卸下面板。
Next, before you begin removing the actual outlet, take your voltage tester and stick it into the junction box to see if any of the wires are still live. If so, then you’ll need to shut off another breaker in order to kill power completely to that outlet.
接下来,在开始拆除实际插座之前,请先将电压测试仪放到接线盒中,以查看是否还有电线存在。 如果是这样,则您需要关闭另一个断路器,以完全切断该插座的电源。
Next, take your Phillips-head screwdriver and remove the two screws that hold the outlet onto the junction box.
接下来,拿起梅花槽螺丝刀,卸下将插座固定在接线盒上的两颗螺钉。
Once removed, take your fingers and pull the outlet out of the junction box to expose more of the wires.
卸下后,请用手指将电源插座从接线盒中拉出,以露出更多电线。
Take a look at how the outlet is wired up. You’ll notice that there are two black wires connected to the outlet on one side and two white wires on the other side, as well as a bare copper wire connected to a green screw. The black wires are the power (or “hot”) wires, the white wires are the neutral (or “return”) wires, and the bare copper wire is the ground wire. Electricity flows through the hot wire, entering the outlet and then into whatever is plugged into it, and then returns through the neutral wire. However, the extra black and white wires are for continuing the circuit to other areas of the house, so the outlet is also acting as a junction of sorts.
看一下插座的接线方式。 您会注意到,有两条黑线分别连接到电源插座,另一侧有两条白线,还有一条裸铜线连接到绿色螺钉。 黑线是电源(或“热”)线,白线是中性(或“返回”)线,裸铜线是地线。 电流流经热电线,进入插座,然后进入所插入的任何电线,然后通过中性线返回。 但是,多余的黑色和白色电线用于将电路连接到房屋的其他区域,因此插座也可以充当各种连接点。
Before you disconnect the wires from the outlet, make sure that you know which wire was connected to which screw. Either remember this in your head or mark the wires with electrical tape. Next, take your Phillips-head screwdriver and unscrew the terminal screws for all of the wires—including the ground wire—and remove them from the outlet.
在从插座上断开电线之前,请确保您知道哪条电线连接了哪个螺钉。 记住这点,或者用电工胶带标记电线。 接下来,拿起梅花槽螺丝刀,拧松所有电线(包括地线)的端子螺丝,然后将其从插座上卸下。
You can then put the old outlet off to the side and you’ll be left with five wires: two black wires, two white wires, and one ground wire. If the outlet you’re replacing is at the end of the circuit, it wouldn’t have the extra pair of black and white wires, since it doesn’t need to continue the circuit, so you’ll only have one black wire, one white wire, and one ground wire in that case.
然后,您可以将旧插座放到一边,然后剩下五根线:两根黑线,两根白线和一根地线。 如果您要更换的插座位于电路的末端,则无需额外的黑线和白线,因为它不需要继续电路,因此您只有一条黑线,在这种情况下,一根白线和一根地线。
第三步:断开新插座上的连接桥片 (Step Three: Break Off the Connecting Bridge Piece on the New Outlet)
Grab your new outlet and locate the connecting piece that bridges the top brass-colored screw with the bottom brass-colored screw.
抓住新的插座,找到将顶部黄铜色螺钉与底部黄铜色螺钉桥接的连接件。
You’ll need to break this piece off so that the two screws are independent of each other. If not, then the light switch will simply turn off the whole outlet, as well as the entire circuit following that outlet. Removing this piece means that only one of the receptacles will be powered by the light switch, leaving the other receptacle always on for other devices.
您需要将其折断,以使两个螺钉彼此独立。 如果没有,那么电灯开关将简单地关闭整个插座以及该插座之后的整个电路。 卸下该部件意味着仅一个插座将由电灯开关供电,而另一个插座始终为其他设备供电。
The exception here is if the outlet that’s controlled by the light switch is only connected to that light switch and there aren’t any other wires. If that’s the case, you’ll only have one black wire, one white wire, and a ground wire connected to the outlet.
例外情况是,如果由电灯开关控制的插座仅连接到该电灯开关,并且没有任何其他电线。 在这种情况下,您只有一根黑线,一根白线和一根接地线连接到插座。
To break off the connecting bridge piece, simply grab your needle-nose pliers, grab onto the connecting piece and bend it back and forth with a gentle pulling force. Eventually it’ll weaken and break off. That’s all there is to it!
要断开连接桥件,只需抓住尖嘴钳,抓住连接件,然后用轻轻的拉力使其来回弯曲即可。 最终它会减弱并破裂。 这里的所有都是它的!
第四步:安装新插座 (Step Four: Install the New Outlet)
Take the outlet and start by connecting the ground wire to the green screw. You can do this by curling the wire around the screw itself and tightening it. You’ll do this for all of the wires. Sometimes outlets have small holes on the back that you can stick the end of the wire into and tighten the screw down, but this isn’t always the case. The latter method is easier, but it’s not quite as solid of a connection as the former. Still, it should hold up just fine.
取下电源插座,然后将地线连接到绿色螺钉上。 您可以通过将电线卷曲在螺钉本身周围并拧紧来做到这一点。 您将对所有电线进行此操作。 有时,插座的背面有小Kong,您可以将电线的末端插入其中并拧紧螺钉,但这并非总是如此。 后一种方法比较容易,但是与前一种方法相比,连接的可靠性不高。 不过,它应该可以承受。
After you connect the ground, move on to connecting the two white wires to the silver screws. It doesn’t really matter which white wire goes to which silver screw, since both are going to be connected together anyway.
接地后,继续将两根白线连接到银色螺钉上。 哪条白线连接到哪条银螺钉并不重要,因为无论如何两者都将连接在一起。
However, it does matter which black wires connect to which brass screws, which is why you should’ve marked them in previous steps. This will make sure that if the top receptacle was the switched receptacle, then it will remain the same on the new outlet. It’s not a huge deal if you mix them up, as it will simply switch to the bottom receptacle being the switched one—you can always switch them back.
但是,哪条黑线连接到哪些黄铜螺丝都没有关系,这就是为什么您应该在前面的步骤中将它们标记出来的原因。 这将确保如果顶部插座是交换式插座,那么它将在新插座上保持不变。 如果将它们混在一起,这并不是什么大不了的事情,因为它将简单地切换到底部的插座,即已切换的插座,您可以随时将它们切换回去。
Next, you’ll need to stuff the wires and outlet back into the junction box. Don’t be afraid to get rough with the wires and bend them back into the box as far as they’ll go, as well as pushing the outlet into the junction box with a bit of force.
接下来,您需要将电线和插座塞回到接线盒中。 不要害怕弄粗电线,将它们弯曲到尽可能远的距离,再用力将插座推入接线盒。
With the outlet in place, use the two included screws to affix the outlet to the junction box.
将插座固定好后,使用随附的两个螺钉将插座固定在接线盒上。
Next, mount the faceplate over the outlet and secure it with the small flathead screw.
接下来,将面板安装在出口上方,并用小平头螺钉将其固定。
Turn the power back on and make sure that the outlet works properly by plugging in a lamp and checking to see that the light switch turns the lamp on and off. If not, try the other receptacle, as it’s likely you switched around the black wires. Either way, one receptacle will be controlled by the light switch and the other receptacle will always be powered on no matter what.
重新打开电源,并插入灯并检查电灯开关是否打开和关闭灯,以确保插座正常工作。 如果没有,请尝试其他插座,因为您可能会绕过黑色电线。 无论哪种方式,一个插座都将由电灯开关控制,而另一个插座无论如何都将始终通电。
翻译自: https://www.howtogeek.com/281023/how-to-replace-an-outlet-thats-controlled-by-a-light-switch/
nodemcu控制开关电灯