Книга: Raspberry Pi 3: Learn How to Create Your Own Projects with Raspberry Pi (raspberry pi 3 model b, raspberry pi model 3, raspberry pi projects, raspberry ... Programming, Raspberry Pi,Tips & Tricks)
Назад: Chapter 7–Camera Projects
Дальше: Conclusion

 

A Pi is an impressive little computer, but it isn’t necessarily capable of doing every little thing right out of the box. There are some common components of most computers that don’t come included with a Pi, like a microphone or sound amplifier, that can limit your project option. Luckily, you can get peripheral components that can satisfy these needs.

The camera module mentioned in the last chapter is only one of the many extra gadgets you can get to attach onto your Pi and expand its functionality. You can find both official products developed by the Raspberry Pi Foundation and third-party products. Some of these will connect through the USB ports, while others will use the GPIO or other connections, meaning you can use them even with smaller versions of the Pi.

Many of these expansion options will connect to the Pi through something known as a breadboard. This is a long rectangular board with rows of connections that allows you to easily add and remove components without having to solder any circuits.

Unlike the Pi base, the Breadboard will need a bit of preparation before you attach it to your Pi. For many peripheral items you’ll also need a breakout board, which is a smaller rectangular board that can be easily installed onto the breadboard simply by pressing the pins of the breakout board into the holes of the breadboard.

You may also need to attach wires to the breadboard and breakout board to create a ground rail and a circuit. This is only strictly necessary if you’re going to need a power rail in your circuit board, but it can be helpful to do for other projects, as well, since it makes the breadboard easier to use and helps you to troubleshoot issues with your project.

To create a circuit, you’ll need two pairs of wires, one long (for the ground) and one short (to attach the breakout board to the circuit). The longer jumper wires should be connected to the side of the breadboard, from the top section to the bottom, plugging one into both the positive rows and one into both the negative rows. Each of the shorter wires will be connected to the breadboard, from the positive plug on the top and the negative on the bottom.

While the breadboard may be the most universally useful of the extra pieces for your Pi, it’s not going to expand the Pi’s functionality on its own. There are a whole host of different peripheral objects you can get for these little computers; some of the most popular and useful are explored below.

 

Microphone and speakers

You can download software onto a Pi that will allow it to play music, and you can play sound from the Pi on most speakers, but that sound will not be especially loud or of a high enough quality for most music lovers unless you add some electronics. A speaker amplifier will be a very helpful addition, especially if you’re using your Pi as a media center and hooking it up to your entertainment system.

You can get an amplifier for your Pi for very cheap, though it will require you to use the breadboard and some headphone cable to make a good connection. Once they’re installed, the sound that comes out of your Pi will be much better to listen to.

If you want the sound to go both ways, you’ll also need a microphone. There are a couple options for microphones that work with your Pi. The Electret Microphone amp is a tiny microphone that connects onto your Pi through a breadboard. You can also use USB microphones—and may have to, if you want to use it for voice control or other multi-media applications. Adafruit sells small USB microphones specifically designed to work well in Pi projects.

Keep in mind that before you start recording your voice using the microphone you’ll need to get a sound card for your Pi. Without one, it won’t process any kind of audio. Some USB microphones include their own sound card, making them especially helpful for this kind of project.

Some of the most popular projects utilizing a microphone with a Pi are built around smart home and voice control applications. You can make a DIY version of an Amazon Echo, for example, or use it to add more control to your existing smart gadgets.

 

 

Weather sensors

 

Adafruit Industries sells a whole host of DIY supplies, many of which are geared toward use with a Pi. Included in their catalogue is weather-responsive hardware, such as the BMP 180, which has sensors for temperature and barometric pressure. You can also find wind speed sensors, precipitation meters, and humidity gauges, both at Adafruit and on other sites.

The most obvious use for all of these gadgets is a DIY weather sensor. You can put it in a weatherproof casing and leave it outside on your front porch or in your garden, then check the readings through SSH from your computer without needing to go outside to look. If you’re interested in setting up this kind of device, you can find a variety of different configurations online; the Pi Foundation even sells a kit, containing everything you’ll need to make a weather sensor of your own.

You can use these weather sensing devices in a variety of other useful ways, too. One option is to have a notification sent to your phone when it’s about to rain so you can close the windows or grab an umbrella. If you have a smart home system, you can use IFTTT recipes to have your heater adjust to the weather outside. The rainfall and temperature sensors could be used in a garden gadget that waters your plants in response to the conditions—a huge help if you like fresh produce but are better at building circuits than growing things.

Назад: Chapter 7–Camera Projects
Дальше: Conclusion