This guide is also compatible with the Raspberry Pi using CircuitPython. We're going to build the house's lighting system, wire up the home security circuit, and program it with CircuitPython.
The Pi Zero W has built-in WiFi - which is great for connecting our environmental monitor to Adafruit IO. It's also smaller than a regular Raspberry Pi 3, making it the perfect size to stick it in a small corner of your room.
While we could use a breadboard, we'll build our own pHAT for our IO House.
Since we're using a Raspberry Pi, we're going to use the eight-megapixel Raspberry Pi Camera v2 to capture images from outside our home.
Because the Pi Camera Board is designed for the Raspberry Pi and not the Raspberry Pi Zero, we'll use a Raspberry Pi Zero camera cable.
Remove the CSI cable which comes from the Pi Camera and replace it with the Pi Zero camera cable by lifting the collar of the camera module and removing the cable.
Connect the wider end of the Pi Zero camera cable into to the Pi Camera.
Open the collar on the Pi Zero W's camera connector. Push the camera cable through the connector, making sure the cable is seated firmly in place and the contacts are facing the back of the Pi Zero.
While going through this project, I found it easiest to add a JST SM receptacle to the bonnet and attach the plug to the end of the cable. It makes it easy to quick connect / disconnect everything in your home from the Pi.
*pi camera not shown
NOTE: Since this is a series, we'll be building off what we built in the previous guide, but adding a SGP30 (you can wire it by chaining SCL/SDA pins), the motion detector (PIR sensor), and a PiCam.
Connect the SGP30 to the Pi:
- SGP30 SCL to Pi SCL
- SGP30 SDA to Pi SDA
- SGP30 GND to Pi GND
- SGP30 Vin to Pi 3V
Connect the PIR Sensor to the Pi:
- PIR 5V to Pi 5V
- PIR Signal to Pi GPIO #22
- PIR GND to Pi GND
Connect the NeoPixel Jewel to the Pi:
- NeoPixel Jewel GND to Pi GND
- NeoPixel Jewel PWR to Pi 3V
- NeoPixel Jewel IN to Pi GPIO #18
Connect one wire of the Reed Switch to Pi GPIO #24, and connect the other wire to GND.
We're ready to power up - connect the plugs for the sensors and the neopixel strip/jewel to the appropriate receptacles and connect your Pi to a power supply.
Next, let's move on to setting up your Pi.