McManus Sean

Raspberry Pi For Dummies


Скачать книгу

or TV, keyboard, and mouse

      ❯❯ Connecting to your router or Wi-Fi

      ❯❯ Connecting and testing the Raspberry Pi Camera Module

      ❯❯ Using Raspi-config to set up your Raspberry Pi

      The thought of being faced with a bare circuit board might strike you as rather daunting, but it’s actually quite easy to connect your Raspberry Pi and get it up and running. You might need to change some of its configuration (see Appendix A), but many people find that their Raspberry Pi works well the moment they connect it all together.

Before we start, make sure you have the Raspberry Pi facing the right way around, at least as far as these directions are concerned. The top of your Raspberry Pi is the side that has the most components and sockets sticking out of it, and is shown in Figures 3-1, 3-2 and 3-3. The back is relatively flat. Arrange your Raspberry Pi so that the spiky GPIO pins are in the top left, or in the case of a Pi Zero or Zero W without pins, so that the 40 holes are in the top left.

       FIGURE 3-1: The original Model B Raspberry Pi. The Model A is the same, except that it has no Ethernet.

       FIGURE 3-2: The Raspberry Pi 3 Model B. The same layout applies to the Raspberry Pi 2 Model B, the Model B+, and the Model A+ (with changes on the right).

       FIGURE 3-3: The Raspberry Pi Zero W. The same layout applies to the Raspberry Pi Zero, except that there is no camera connector.

      Figure 3-1 shows the ports and sockets you will need to use to connect up an original Model B Raspberry Pi. The Model A is the same as Figure 3-1 except that it has no Ethernet connection in the bottom right.

      Figure 3-2 shows the connection points on the Raspberry Pi 3 Model B. This layout also applies to the Raspberry Pi 2 Model B, and the Model B+. At first glance, the Model A+ looks quite different because it's a smaller board, but it's the same layout except for the right edge, where there is no Ethernet socket and just the one USB port.

      Figure 3-3 shows the Raspberry Pi Zero W. The Raspberry Pi Zero looks the same, except that it is missing the camera socket on the right.

      tip Chapter 1 lists everything you might need in order to use your Raspberry Pi, including the various cables.

      Inserting the SD Card

      To start up, the Raspberry Pi requires an SD or MicroSD card with the operating system on it. If you don’t have one, see Chapter 2 for advice on downloading the operating system and copying it to an SD or Micro SD card.

To insert a MicroSD card in a Model 2, 3, A+, or B+, turn your Raspberry Pi over, as shown in Figure 3-4, so that you’re looking at its underside. The metal MicroSD card socket is labeled and is on the left edge of the board. Slide your MicroSD card into the slot face up. On the Raspberry Pi 3 Model B, the card will slide into place. On the other models, it will click into place. The card will overhang the board slightly.

       FIGURE 3-4: The MicroSD card, lined up for insertion in a Raspberry Pi 3 Model B.

To insert an SD card in a Model A or Model B, flip your Raspberry Pi over. (See Figure 3-5.) On one of the short sides is a plastic fixture for your SD card. Slide the SD card in with the label side facing you, and gently press the card home to make sure it’s well connected. The fixture is not big enough to cover your SD card, so most of the card will stick out from the side of the board and will be visible when you turn your Pi back over again. You can remove the card by just pulling it out again.

image

       FIGURE 3-5: The SD card, correctly aligned with the socket on the underside of the Model A.

The Pi Zero and Zero W have the MicroSD card socket mounted on the top surface of the board. Insert the card with the label side facing you, as shown in Figure 3-6.

image

       FIGURE 3-6: The MicroSD card, lined up for insertion in a Raspberry Pi Zero.

      To remove the card again, just pull it if you have a Raspberry Pi 3 Model B or a Pi Zero. For the other models, press the card in and the spring will push it back out toward you. You can then pull it out.

      warning To avoid data loss, you should only insert and remove SD and MicroSD cards with the power switched off.

      Connecting the Raspberry Pi Camera Module

There are lots of accessories and add-ons available for the Raspberry Pi, but the Raspberry Pi Camera Module has the rare status of being an official product from the Raspberry Pi Foundation, so we show you how to connect it. The camera module is a small circuit board, with a strip of ribbon cable that plugs directly into the Raspberry Pi board. (See Figure 3-7.) It’s easiest to connect the camera before you plug your Raspberry Pi into any cables.

      On the board of your Raspberry Pi is a connector for the camera. You can see it labeled in Figures 3-1, Figure 3-2, and 3-3. (Remember that the Pi Zero does not have a camera connector).

      As you can see in Figure 3-7, the lens has a plastic film over it, to protect it. Pull the green plastic tab to remove the film.

image

       FIGURE 3-7: The Raspberry Pi Camera Module.

      At the end of this chapter, we show you how you can check to ensure that your camera is connected correctly and working.

Connecting the camera on a Pi Zero W

      The Pi Zero W camera socket uses a different width of cable to the main Raspberry Pi boards. You can buy the cable separately, or get it with the official Pi Zero case.

      The camera and the Pi board have similar sockets for the cable. You press the connector between your thumb and finger and gently pull to open the connector. The parts don't separate, but there's enough of a gap to remove and insert the cable. On the Raspberry Pi, the camera connector is on the right of the board. (Refer to Figure 3-3.)

      On the camera, insert the cable with the shiny contacts facing the camera front, and then press the socket closed again. On the Raspberry Pi Zero W, insert the cable with the shiny contacts facing the bottom of the board (the flat side). When the cable is flat,