This week we dive into a couple home automation tutorials using controlled outlets. Both interact with the outlets using different methods. Try out whichever you like best! Or both!
On the surface this tutorial is about setting up a home automation system. The goal of the project is to be able to wirelessly control multiple outlets throughout your home. Simple concept, but awesome execution.
See, in this tutorial, you also get to reverse-engineer a wireless protocol and implement a Dickson charge pump. It’s a three-in-one deal.
On the flip-side, this tutorial also requires some competency in oscilloscope usage and C/C++ programming. Tutorial author CalcProgrammer1 explains the project in a generic manner to fit any type of microcontroller setup, but an Arduino Uno would work fine. In fact, using an Arduino would probably be the simplest method because the built-in Serial Monitor in the IDE can roughly replace writing your own command-line software.
In Step 3, it is a little unclear what is meant by “build a switch/case or cascading if/else statement with one of these blocks for each button, using outlet number and switch state as your if/else conditions.” Checking the attached code, it looks like PC program sends two values: the outlet choice and the state, on or off. The switch/case or if/else statements are separated by outlet number and command. Each variation (3 outlets times 2 states in the case of the tutorial’s example) has a unique command broadcast wirelessly.
The example code uses interrupts to acquire the command from the PC, but you could just as easily use a busy-waiting loop.
Overall, this is not a beginner’s tutorial, but it can be very educational.