-
Preparing an SD card for your Raspberry Pi (note: Mac users now have an easier option in RPi-sd card builder)
- First time configuration
- Network setup
Before continuing, get your Raspberry Pi to a state where it’s booting, connected to the local network (either wired or wireless) and reliably communicating with the outside internet.
The Raspberry Pi at this point is assumed powered and networked; we’ll leave those elements out of the remaining explanation.
Connect Pin 1 on the PowerSwitch Tail (labeled “+in”) to GPIO 24 on the Raspberry Pi GPIO header. Connect Pin 2 (“–in”) to the adjacent ground pin on the GPIO header. Pin 3 (Ground) isn’t used. You don’t necessarily need a Pi Plate or Cobbler, though those may make wiring easier depending what you have on-hand. A pair of female-to-male extension jumper wires may be all you need.
The two pins on the header are outlined in red here:
Finally, plug the PowerSwitch tail into a wall outlet or power strip. Nothing should happen yet; that will require software. But if you’d like to test it, try moving the GPIO 24 wire to either a 3.3V or 5V pin. The light should come on.
At first thought it might seem “cleaner” to hide the Raspberry Pi inside your lighting fixture, but this may actually create an awkward jumble of wires. The Pi needs to remain powered on, it can’t be switched with the light. Merging the two would likely involve either a lot of cabling inside the box, or wires leading in and out for the Pi, PowerSwitch Tail, etc.
We felt it was easier just to keep the Pi outside the box, down by the outlet along with the PowerSwitch Tail, then run a single slim power cord to the light: