Download Print this page

Advertisement

Quick Links

Setting Up the Pi Zero Wireless Pan-Tilt Camera
Introduction
This tutorial will show you how to assemble, program, and access the Raspberry Pi Zero Wireless Pan-Tilt
Camera.
SparkFun Raspberry Pi Zero W Camera Kit
 KIT-14329

Advertisement

loading
Need help?

Need help?

Do you have a question about the Raspberry Pi Zero Wireless Camera Kit and is the answer not in the manual?

Questions and answers

Summary of Contents for sparkfun Raspberry Pi Zero Wireless Camera Kit

  • Page 1   Setting Up the Pi Zero Wireless Pan-Tilt Camera Introduction This tutorial will show you how to assemble, program, and access the Raspberry Pi Zero Wireless Pan-Tilt Camera. SparkFun Raspberry Pi Zero W Camera Kit  KIT-14329...
  • Page 2: Required Materials

    Required Materials You'll need a microSD card, a sufficient power supply, and a micro-B USB Cable. We do not recommend the pre- installed NOOBS card, as it may not include a recent enough version of the Pi operating system to support the Pi Zero W.
  • Page 3: Suggested Reading

    Solder Lead Free - 15-gram Tube Soldering Iron - 30W (US, 110V)  TOL-09163  TOL-09507 Flush Cutters - Xcelite Tool Kit - Screwdriver and Bit Set  TOL-14782  TOL-10865 Suggested Reading Very little of this kit requires anything but following our step-by-step guide; however, you might want to check out our through hole soldering tutorial as you'll need to do some soldering to put the pins in place on the Pi Zero W and the Pi Servo Hat.
  • Page 4 Pi Servo Hat Hookup Guide Getting Started with the Raspberry Pi Zero Wireless This hookup guide will show you how to connect and Learn how to setup, configure and use the smallest use the Pi Servo Hat in a project. Raspberry Pi yet, the Raspberry Pi Zero - Wireless.
  • Page 5 By default, Etcher "ejects" the card after it has created the image, so you'll need to pull it out and reinsert it to get your computer to reload the disk. Edit the "config.txt" File on the MicroSD Card To continue, we're going to need to edit a file on the microSD card. This file will be visible from any operating system, although on a Linux system it's in a slightly different location.
  • Page 6 The last thing we need to do to prepare the microSD card is to create a "wpa_supplicant.conf" file on the card. This file contains the information needed for your local wireless network setup. Create a new file using your favorite text editor. On Windows we recommend Notepad, as it provides WYSIWYG content and allows you to save a file with an arbitrary file extension.
  • Page 7: Hardware Assembly

    Hardware Assembly To assemble the hardware, we need to: Solder headers to the Raspberry Pi Zero W. Solder headers to the Pi Servo Hat. Install the Pi Servo Hat on the Pi Zero W. Assemble the pan-tilt hardware and connect the servos to the hat. Let's walk through these steps in more detail! Solder Headers to the Raspberry Pi Zero W and the Pi Servo Hat We recommend soldering the male header to the Pi Zero W and the female to the Pi Servo Hat.
  • Page 8 Identify the smallest screws in the baggie of screws that came with the kit. These will be used to affix this horn to the base of the pan-tilt mechanism. Place the horn in the base as shown, then screw it down by inserting the screws from the bottom and threading them into the horn.
  • Page 9 Here's the sandwiched servo. Again, note the orientation for proper assembly. Here, you can see where the screws identified a couple of steps ago fit into our servo sandwich. Tighten them down, but not too much. Now fit the shaft of the servo into the fitting on the horn that you previously installed into the base. This is the point where you need to make sure that the shaft is roughly centered in order for the entire assembly to work properly.
  • Page 10 Find the two longer screws that came with the horn kit in the set to attach the base to the servo. There will likely be only two of these, and you need both, so don't lose one! Insert the screw to the bottom and tighten the screw to attach the two parts together.
  • Page 11 Attaching the single arm servo horn. Attaching the clipped single arm servo horn. Note: If necessary, you can loosen screws on the brackets placed around the servo in order to attach the clipped single arm servo horn to the bracket. This will keep the screws straight when tightening the screws. You'll now need the second servo motor and the last piece of the mechanism.
  • Page 12 Thread these screws through the stand off wings on the servo motor and into the last piece of the mechanism. You can use nuts for these if you like, but I've found it to be unnecessary as they thread into the mechanism quite snugly without the nut.
  • Page 13 Take the final screw that you identified above as a horn attaching screw and use it to secure the horn to the servo motor. Congratulations, you've finished assembly of the pan-tilt mechanism! Solder the Headers onto the Pi Zero W and Pi Servo Hat We suggest soldering the male headers onto the Pi Zero W.
  • Page 14 My favorite trick for this type of situation is to solder down one pin, then melt the solder on that pin with the iron held in my right hand and use my left hand to adjust the header until it sits flat as shown below. Make sure that you are soldering with the header's shorter side and the longer pins are on the component side.
  • Page 15 Next, attach the flex cable to the camera module. Take note of the copper "fingers" on the end of the cable. The side with the fingers on it should be facing the camera module circuit board. See the image below. Thread the flex cable through the pan-tilt mechanism as shown below, then press the back of the camera board against the double stick tape to adhere it to the pan-tilt mechanism.
  • Page 16 You may now attach the Pi Servo Hat to the header on the Pi Zero W. Connect the Servo Motors to the Pi Servo Hat The servo motors need to be connected to channels 0 and 1 on the Pi Servo Hat. Connect the "pan" servo (the one on the bottom) to channel 0 and the "tilt"...
  • Page 17 Update the software on the Pi Zero W. Download and install the camera interface software from GitHub. Make some changes to enable the pan-tilt control functionality. Download the Pi Servo Hat interface software from GitHub. Make some changes to start the Pi Servo Hat interface software on boot. Let's walk through these steps in more detail! Power the Pi Zero W Using a sufficient 5V wall adapter, we can power the Pi Zero W.
  • Page 18 Windows If you don't have the Arduino IDE installed and don't want to install it, you can find the same information using built in tools. Under Windows, open up your device manager (if you don't know how to do this, do a search online for OS specific information on how to do it since it's slightly different under various versions of Windows).
  • Page 19 Log In to the Pi When the Pi finishes booting (about 30 seconds) you should see a prompt on your serial terminal screen that looks like the image below. If you don't, try hitting the enter (or return) key. This will bring up the login information if it printed before you had your serial terminal ready.
  • Page 20 Highlight option "P1 Camera", and hit enter. That will bring up this screen: Highlight "Yes" and hit enter. You'll receive a confirmation message: Hit enter to leave this screen. You'll be back at the main menu. Return to the "Interfacing Options" menu again and repeat the process two more times, once for the "I2C"...
  • Page 21 auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf and enter to save the file, then to quit the nano text editor. CTRL CTRL Now reboot the Raspberry Pi by typing: sudo reboot Update the Pi You must now update your Pi's software to the latest version. To do this, enter these two commands at the command prompt: sudo apt-get update sudo apt-get dist-upgrade...
  • Page 22 The installation script will download and install all of the dependencies for the project. This can take some time (up to several minutes) so be patient. When everything is finished, you'll be asked if you want to start the service now. Select "Yes".
  • Page 23 Adding Pan-Tilt Support The RPi Cam Interface software supports pan-tilt functionality, but it needs to be enabled. To do this, there are several steps required. First, we must tell the software that we wish to enable pan-tilt functionality. This is done by renaming a file hidden deep within the directory structure using this command: sudo mv /var/www/html/pipan_off /var/www/html/pipan_on After running this command, go back to your web browser and refreshing the camera interface.
  • Page 24 RPi_PanTilt_Camera_Kit/Firmware/pantilt.py & The first command ensures that you are in the /pi user home directory; later instructions will depend upon that being the case. The second command fetches the program from GitHub, and the third executes it. As soon as you enter the third command, you should see and hear the motors twitch a little as the software centers them.
  • Page 25 Raspberry Pi Camera Web Interface - Official repository for the web based interface for controlling the Raspberry Pi Camera, includes motion detection, time lapse, and image and video recording. SparkFun Pan/Tilt Example Code - Demo code used in the Setting Up the Pi Zero Wireless Pan-Tilt Camera tutorial.
  • Page 26 Or check out the IoT Raspberry Pi Camera Refrigerator project to see what's in your fridge or what is happening in another room to monitor experiments. SparkFun Internet of Things Apartment #4 - Raspberry Pi Camera Re SparkFun Internet of Things Apartment #4 - Raspberry Pi Camera Re...

This manual is also suitable for:

Kit-14329