Setup Pizero
Pizero
Once you are done testing out your circuit on the raspberry pi, it’s time to turn it into a product. This is where the pizero comes in. It’s a cheaper version of the raspberry pi and the first impression when you hold it it is…gosh this is small!
The pizero W model, shown above has bluetooth and WIFI, so that’s pretty impressive. If you’re planning to connect it to relays, and other sensors, you will need to buy GPIO headers separately. While you’re at it, also buy a heat sink to keep the processor running cool.
Objective
- Connect the pizero to the WIFI network
- Connect the pizero to a relay and use it to the turn the relay on and off
Prerequsites
[[vault/wip/workshops/electronics/parts/relay]]
Parts
- pizero (of course!) with a SD card
- a [[vault/wip/workshops/electronics/parts/relay]]
- pizero case (optional)
- GPIO headers
- Soldering iron and solder
- Heat sink
- A computer to setup the pi (Mac, Windows, or Linux)
- A wifi network
Experiment 1: Connect pizero to WIFI
- Follow the instructions here to install the OS in the SDCard, enable SSH and connect to WIFI.
- Use the Balena Etcher Program to copy the OS to the SDCARD.
- The pizero cannot connect to the 5GHz band, so make sure you choose the 2.4GHz band only.
- Assign a static IP address to the pizero. You have to login to the wifi router to do this. Configure hostname, DNS, install additional software like vim etc, and reboot.
- SSH into the pizero now and run the following program [[vault/wip/workshops/electronics/parts/relay#^2b5485]].
Experiment 2: Connect pizero to relay
Take out the soldering iron and solder the GPIO headers to the pizero. For a proper touch the heated iron to one side of the pin, and the solder to the other side of the pin. The heat from the iron, to the pin to the solder…should melt the solder.
Make sure the solder flows on to the “circles” on the board. In the following picture, it does not, for one of the pins.
Then, connect the relay as described in the [[vault/wip/workshops/electronics/parts/relay | relay experiment]].
Once you have confirmed that the pi zero is able to control the relay using it’s GPIO pins, it’s time to put it in its case. As a bonus, this also includes a heat sink for your pi zero, so it runs cool.
And looks cool too!