Chapter 5. Making a Smart Plug with the Raspberry Pi Zero
You have probably seen those smart plugs in your local shop: they allow you to not only control appliances remotely, but also to measure the energy consumption of the device connected to the plug. These smart plugs are now available nearly everywhere, from well-known brands such as Belkin.
The following image shows one I bought as an experiment a while ago to see what components were inside:
In this chapter, we are going to learn how to use the Raspberry Pi Zero to make a project that has the same functionalities as a smart plug. You will be able to control an electrical device such as a lamp via Wi-Fi, and also measure its electrical consumption in real time.
Because we are building this device ourselves, we will of course be able to customize it for our needs. For example, we'll learn how to log the data measured by the plug in a database so it can be used later. Let's start!