The hardware of Tweet-a-PowerStrip contains Arduino as the main controller unit that interfaces with the relays and the Ethernet Shield to communicate with the computation unit. The Arduino code implements the MQTT client, using the PubSubClient
library to publish and subscribe to the topics. Although we are using some example appliances to control the use of the relay, you can select any other appliance you own. You can also use a commercial power strip instead of an individual power plug.
While assembling the hardware components, as displayed in the following diagram, make sure you are precise in connecting the appliances with the AC power plugs. One wire of the AC plug is directly connected to the appliance, while the other is connected between the C and NO ports of the relay. We have connected the control side of the relay to the digital pin of our Arduino. As we are using a four-channel relay, we will have to utilize...