Controlling appliances
In this section, we are going to control appliances using a product called IoT Power Relay (shown in the following image). We are going to make some minor tweaks to the code sample discussed in the previous section to turn on a light when the door is open and vice-versa.
Appliances Controlled by the Power Relay
We recommend using the power relay for your projects because it offers a safe way to control AC appliances. We recommend controlling simple resistive loads such as a floor lamp.
The following photo shows the IoT power relay. The terminal on the bottom side of the picture is used to control the relay.
![Figure 3.11 – IoT power relay (image source: sparkfun.com. License: CC by 2.0)](https://static.packt-cdn.com/products/9781801814812/graphics/image/B17494_03_011.jpg)
Figure 3.11 – IoT power relay (image source: sparkfun.com. License: CC by 2.0)
The IoT power relay enables controlling alternating current (AC) appliances with a 3.3 V signal. It comes with the requisite protection to safely interface the Pico with the relay. We will be making use of the GP11 pin to control the...