
Raspberry Pi Sensors
By :

Before we get started, it's time to reintroduce our good friend, the Raspberry Pi. Kudos to the designers of the board, who have packed everything we need to accomplish our projects in a credit-card-sized printed circuit, also called a credit-card-sized single-board computer. There are two versions of Raspberry Pi: Raspberry Pi 1 and Raspberry Pi 2. Due to earlier developments, the Raspberry Pi 1 family consists of model A, model A+, model B, and model B+. The recently launched model is Raspberry Pi 2, the new addition to the model B category. Nowadays, the most widely used Raspberry Pi is model B+, which is also called the original Raspberry Pi board in the Raspberry Pi 1 family. The predecessor of the Raspberry Pi models B and B+ was model A, which is not widely used in the hobbyist space compared to other models such as A+ and B+. If you are not aware of the specifications of these boards, take a look at the complete comparison in the following table, which contains the comparable parameters of the current models of Raspberry Pi 1 and 2. Then you can choose a board that you want.
Features |
Raspberry Pi 1 |
Raspberry Pi 2 | ||
---|---|---|---|---|
Models |
B |
A+ |
B+ |
B |
Processor |
BCM2835 |
BCM2836 | ||
Processor cores |
Single |
Quad | ||
Speed |
700 MHz |
900 MHz | ||
RAM |
512 MB |
256 MB |
512 MB |
1024 MB |
GPU |
VideoCore IV | |||
Pin header |
26 pin |
40 pin |
40 pin |
40 pin |
Audio and video ports |
RCA, HDMI port |
3.5 mm jack, merged audio-composite video and HDMI port | ||
Ethernet port |
Yes |
No |
Yes |
Yes |
USB ports |
2 |
1 |
4 |
4 |
Power |
Micro USB port | |||
Digital interfaces |
CSI (camera), DSI (display) ribbon cable connectors | |||
Memory card |
SD |
MicroSD |
Raspberry Pi 1 has a Broadcom BCM2835 processor with a 256 MB or 512 MB RAM on top of it. The processors and RAM are integrated as Package on Package (POP). On the other hand, Raspberry Pi 2 has a Broadcom BCM2836 processor, which comes with a 1024 MB RAM interfaced beneath the board. Raspberry Pi 1 model A+ is still loved by minimal RasPi users who need low-powered performance when they are running on batteries. There's lots of good stuff here: RAM states the temporary memory available to run the current processes and applications. Multimedia processing ensures smooth graphical processing to run high-resolution videos through HDMI and video-extensive applications on Raspberry Pi.
We have already decided to make the Raspberry Pi our friend, and like all our friends, it requires a unique and cool name so that we can call it easily when we need it. I would like to call it a RasPi, so throughout the book, whenever you are referring to the name RasPi, it's your buddy, Raspberry Pi.
Your new friend has all the capabilities that your computer has. The RasPi can be used to understand how a computer works, to learn programming, for word processing, and for gaming. Here are the small and shiny hacks that we can do with RasPi:
All of these features come in such a small piece of board.
Does this make you excited? Obviously, yes! There are such numerous applications that we can build with the RasPi, but they are out of the scope of this book.
Because of its ability to interact with the outside world, the major applications developed using RasPi include recognizing the surrounding parameters using sensors and converting them into useful data to analyze and control the appliances that we are going to experiment in the upcoming chapters.
I assume that you have the RasPi (model B or B+) in your hand, and you might be wondering what are the different connectors and electronic elements on the board. Rather than introducing the jargon of specifications, I will introduce what we need to make our projects. Take a look at the different connectors in the following diagrams. The nomenclature presented here will be used throughout the book.
The Raspberry Pi 1 model B connectors
The Raspberry Pi 1 model B+ and Raspberry Pi 2 model B look identical to each other, and the difference is only in performance.
The Raspberry Pi 1 model B+ and Raspberry Pi 2 model B connectors
Due to a more powerful processor and an upgraded RAM, Raspberry Pi 2 Model B improves on performance by six times. In a clockwise direction in the diagram of the RasPi 1 model B, the short description of the important connectors is as follows:
For example, in one of your applications, if the temperature falls below 20 degree Celsius then the thermostat connected to your RasPi gets the signal through the specific GPIO assigned and it starts heating. GPIOs typically work in logic high (1, ON) and logic low (0, OFF), and this will work the way you program it!
The maximum current the Raspberry Pi models A and B can use is 1 ampere, so if you need to connect a USB device that will take the power requirements of the Raspberry Pi above 1 ampere, then you must connect it to an externally powered USB hub. For example, a USB hard disk will need an ample amount of current to operate, which RasPi cannot deliver through the USB port. Alternatively, the maximum power model B+ can use is 2 amperes before needing to connect devices to an externally powered USB hub. There are power banks and batteries available for connecting to the RasPi if you are designing a remotely operated car or a quadcopter. If you are not sure how much power the USB device is going to take, buy an externally powered USB hub. Do not go above 2.4 amperes in any case, because this will destroy your RasPi if peripheral current demand is high—it'll be dead!
It is suggested to purchase the microSD card with the SD card adaptor so that if you switch over from RasPi 1 model B to B+ or RasPi 2 model B, you can retain the same operating systems and your programs. Additionally, after installing the libraries and setups, the OS crash can be painful. To avoid this, the periodical backup of the entire OS should be taken, and this can be used to install the OS on a new SD card again. The microSD card can easily be contained in an SD adaptor to convert it into a normal SD card, with no performance losses.
Change the font size
Change margin width
Change background colour