Читать книгу Raspberry Pi For Dummies - McManus Sean, Evans Jonathan, Sean McManus - Страница 23
Essentials
ОглавлениеThere are a few things that are essential to get your Raspberry Pi up and running:
Monitor: The Raspberry Pi has a high-definition video feed and uses an HDMI (high-definition multimedia interface) or Micro HDMI connection for it. If your monitor has an HDMI socket, you can connect the Raspberry Pi directly to it. If your monitor does not support HDMI, it probably has a DVI socket, and you can get a simple and cheap converter that enables you to connect an HDMI cable to it. Older VGA (video graphics array) monitors require a device to convert the HDMI signal into a VGA one. If you’re thinking of buying a converter, check online first to see whether it works with the Raspberry Pi. A lot of cheap cables are just cables, when what you need is a device that converts the signal from HDMI format to VGA, not one that just fits into the sockets on the screen and your Raspberry Pi. These converters can be quite expensive, so Gert van Loo has designed a device that uses the Raspberry Pi’s GPIO pins to connect to a VGA monitor. He’s published the design specs so that anyone can build one, and sell it if they want to, too. Take a look at eBay if you need one, and you might well find what you need. For more information, check out
https://github.com/fenlogic/vga666
. (If your monitor is connected using a blue plug and the connector has three rows of five pins in it, it’s probably a VGA monitor.)TV: You can connect your Raspberry Pi to a high-definition TV using the HDMI socket and should experience a crisp picture. If you have an old television in the garage, you can also press it into service for your Raspberry Pi. The Pi can send a composite video signal, so it can use a TV as its display. When we tried this, it worked but the text lacked definition, which made it difficult to read. You’ll need to get a cable with the right connector to fit your Pi: The original Model A and Model B have a dedicated RCA video socket, but current models use the headphone socket for RCA video output, too.
USB keyboard and mouse: The Raspberry Pi only supports wired USB keyboards and mice. If you’re still using ones with PS/2 connectors (round rather than flat), you may be able to use a PS/2 to USB adapter. Official Raspberry Pi keyboards and mice are available with an attractive white and red design. You can use Bluetooth devices, but you’ll need to use a wired keyboard and mouse to set them up. When the Raspberry Pi behaves unpredictably, it can be because the keyboard is drawing too much power, so avoid keyboards with too many flashing lights and features.
SD card or microSD card: The Raspberry Pi doesn’t have a hard drive built into it, so it uses a microSD card (current models) or SD card (older models, earlier than the Model B+) as its main storage. You probably have some SD cards that you use for your digital camera, although you might need to get a higher-capacity one. We recommend a 16GB card as a minimum for Raspberry Pi OS, but you can use a 4GB card if you use a media center operating system (OS) like LibreELEC (see Chapter 8 for a guide to LibreELEC). SD and microSD cards have different class numbers that indicate how fast you can copy information to and from them. You will be fine 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.
FIGURE 1-4: The Micro USB–to–USB converter cable and the Mini HDMI–to–HDMI converter for the Raspberry Pi Zero.