Raspberry Pi For Dummies. Sean McManus

Raspberry Pi For Dummies - Sean McManus


Скачать книгу
with a Class 6 or higher. If you buy an official Raspberry Pi kit, it includes a microSD card with Raspberry Pi OS already installed on it.Note: In this book, when we say microSD card, we also mean SD card if that’s what you’re using. If we’re talking about something that’s different for SD cards, we tell you.

       SD or microSD card writer: Many PCs today have a slot for SD or microSD cards, so you can easily copy photos from your camera to your computer. If yours doesn’t, you might want to consider getting an SD or microSD card writer to connect to your computer. You can use it to copy software to an SD card for use with your Raspberry Pi, but you won’t be able to use it to copy files from your Raspberry Pi to a Windows computer. You can also use the card writer to create a backup copy of your Raspberry Pi’s files and software. (You can read about making back-ups in Chapter 4.)

       Power supply: To power your Raspberry Pi, you need to use a 5V power supply. The Raspberry Pi 4 and Raspberry Pi 400 use a USB-C connector, and earlier models use a USB-C Micro USB connector. Although you may have mobile phone and tablet chargers that fit, many of them can’t deliver enough current (up to 2,500 milliamperes for a Raspberry Pi 3 Model A+, and up to 3,000 milliamperes for Raspberry Pi 4), which can make the Raspberry Pi perform unreliably. It’s worth checking to see whether you have a 5V charger that may do the job (it should say on it how much current it provides), but for best results, we recommend buying a compatible charger from the same company that you buy your Raspberry Pi from. There is an official Raspberry Pi 4 power supply available, which has plug styles for the United States, Canada, United Kingdom, Australia, New Zealand, Europe, India, and China.Don’t try to power the Pi by connecting its power port to the USB port on your PC with a cable, because your computer probably can’t provide enough power for your Pi. You can also power the Pi through the GPIO pins, but you could damage the Raspberry Pi if there is a spike in current or the wrong voltage is applied. If you want to provide power through the GPIO pins, a safer approach is to use a hardware-attached-on-top (HAT) device designed to sit on the GPIO pins and provide the consistent power you need while protecting the Pi underneath. For portable applications, you can power the Raspberry Pi using a battery pack designed for mobile phone charging. The Raspberry Pi Foundation advises that you should only use batteries to power your Raspberry Pi if you know what you’re doing, because there’s a risk of damaging your Raspberry Pi. There is an official Raspberry Pi PoE HAT if you want to power your Pi through an Ethernet cable.For more details on the power requirements of various Raspberry Pi models, consult the FAQ at www.raspberrypi.org/documentation/faqs.

       Cables: You’ll need cables to connect it all up, too. In particular, you need an HDMI cable (if you’re using an HDMI or DVI monitor), an HDMI-to-DVI adapter (if you’re using a DVI monitor), an RCA cable (if you’re connecting to an older TV), an audio cable (if you’re connecting the audio jack to your stereo), and an Ethernet cable (for networking on models with an Ethernet port). The Raspberry Pi 4 and 400 use Micro HDMI connections, so you’ll need a cable that connects Micro HDMI to (normal) HDMI for your monitor, or an adapter. Note that the Raspberry Pi 2 and later (including Raspberry Pi 4) send the RCA video signal through a 3.5mm jack (headphone socket). Earlier models had a dedicated RCA socket. You need a different cable, depending on which version of the Pi’s design you have, if you plan to use RCA. If you have a Raspberry Pi Zero, you’ll need a converter for the Mini HDMI socket and for the Micro USB socket (see Figure 1-4). You can get these cables from an electrical components retailer, and you may be able to buy them at the same time as you buy your Raspberry Pi. Any other cables you need (for example, to connect to PC speakers or a USB hub) should come with those devices.

Photo depicts the Micro USB—to—USB converter cable and the Mini HDMI—to—HDMI converter for the Raspberry Pi Zero.

      Optional extras

      There are a few additional items you may want to get for your Raspberry Pi. They can make your Raspberry Pi easier to use and enable new applications.

       USB hub: The Raspberry Pi has one, two, or four USB sockets (depending on the model you get). Consider using a powered USB hub, for two reasons. Firstly (and especially if you have a Model A, A+, B, or Zero), you’re going to want to connect other devices to your Pi at the same time as your keyboard and mouse, which need two sockets. And secondly, a USB hub provides external power to your devices and minimizes the likelihood of experiencing problems using your Raspberry Pi, especially if connecting relatively power-intensive devices such as hard drives. Make sure your USB hub has its own power source, independent of the Raspberry Pi.

       External hard drive: If you want lots of storage, perhaps so that you can use your music or video collection with the Raspberry Pi, you can connect an external hard drive to it over USB. You’ll need to connect your hard drive through a powered USB hub, or use a hard drive that has its own external power source.

       Raspberry Pi Camera: The Raspberry Pi has stimulated entrepreneurs to create all kinds of add-ons for it, but the Camera Module is a product that originated at the Raspberry Pi Foundation. This fixed-focus camera can be used to shoot HD video and take still photos. The standard camera has 8-megapixel resolution, and the Raspberry Pi High Quality Camera offers 12-megapixel resolution. There is also a version of the standard camera without an infrared filter (the PiNoIR Camera), which can be used for wildlife photography at night or weird special effects by day.

       Speakers: Raspberry Pis (excluding the Pi 400) have a standard audio out socket, compatible with headphones and PC speakers that use a 3.5mm audio jack. You can plug headphones directly into it, or use the audio jack to connect to speakers, a stereo, or a TV. If you’re using a TV or stereo for sound, you can get a cable that connects the 3.5mm audio jack and the audio input(s) on your television or stereo. You won’t always need speakers: If you’re using an HDMI connection, the audio is sent to the screen with the video signal, so you won’t need separate speakers. If you’re using a DVI monitor, you can get an HDMI-to-DVI adapter that includes audio extraction, so you can connect the audio separately. Some adapters can also convert from HDMI to VGA, with sound extracted separately.

       Case: It’s safe to operate your Raspberry Pi as is, but many people prefer to protect it from spills and precariously stacked desk clutter by getting a case for it. The Pibow Coupe (https://shop.pimoroni.com/collections/pibow) is one of the most attractively designed cases, assembled from layers of colored plastic (see Figure 1-5). It’s designed by Paul Beech, who designed the Raspberry Pi logo. There are also official red-and-white cases for current Raspberry Pi models. The case for the Pi Zero includes three different tops, so you can either seal it, leave a camera hole, or have access to the GPIO pins. You don’t have to buy a case, though. You can go without or make your own using cardboard or Lego bricks. Whatever case you go with, make sure you can still access the GPIO pins so that you can experiment with connecting your Pi to electronic circuits and try the projects in Part 5 of this book.FIGURE 1-5: The Pibow Coupe case on the Raspberry Pi 4.

       Raspberry Pi 4 Case Fan: If you’re really pushing the performance of your Raspberry Pi 4, you might find it gets a bit hot. The Raspberry Pi 4 Case Fan (see Figure 1-6) is an official accessory that fits inside the official Raspberry Pi case. It connects to your GPIO pins, and the fan spins to keep air flowing through the case. It’s useful for power users, but most people won’t need one.

Photo depicts the Raspberry Pi 4 Case Fan.

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