A Raspberry Pi is a inexpensive, fully programmable computer that is small enough to fit into the palm of your hand. While the Raspberry Pi is small in size, it is mighty in potential. You can use it like a regular desktop computer or create a super-cool project with it. For example, you could use a Raspberry Pi to set up your very own home-based cloud storage server.
The Raspberry Pi concept began around 2006 with Dr. Eben Upton and his colleagues at the University of Cambridge’s Computer Laboratory in Cambridge, England. They were concerned about the decline in knowledge and skill levels of incoming computer science students as compared with those of earlier students. Dr. Upton decided to create an inexpensive computer, reasoning that it was likely that parents were not allowing their children to experiment with modern and relatively expensive PCs. This idea ultimately led to the development of the very inexpensive RasPi. This computer would provide an excellent opportunity for children to learn and experiment with programming, while not being a concern to parents if something should go horribly wrong and the board be destroyed.
Dr. Upton teamed with several other individuals to form the Raspberry Pi Foundation, a registered United Kingdom charity that promotes computer literacy and enthusiasm, especially among young children using the RasPi as their initial platform. They seem to be achieving these highly laudable goals, since they have greatly exceeded the initial estimate of selling 10,000 RasPi’s, and at the time of this writing, the total sales are approaching one million units. The foundation’s website is www.raspberrypi.org, where you will find all sorts of information about the board, current news, forums, FAQs, and so on.
A key design decision that kept costs low was to incorporate a SoC type chip on the board. SoC is short for System on a Chip—a technology that physically places the memory, microprocessor, and graphics processor in a type of silicon “sandwich” that in turn minimizes the printed circuit board(PCB) space and the accompanying PCB interconnecting board traces. The foundation eventually partnered with Broadcom to use its designs for both the microprocessor and graphics processors in the SoC. The SoC and some other key components and connections that you should know about are identified in figure shown above.
One impressive feature of recent RPi models is that their functionality can be extended with daughter boards,called HATs (Hardware Attached on Top), that connect to the GPIO header (the 40-pin double-pin connector row on the boards). You can design your own HATs and attach them securely to your RPi using this header. In addition, many HATs are available for purchase that can be used to expand the functionality of your RPi platform.
Raspberry pi 1 Vs pi 2
Raspberry Pi 2 is a small computer that is more or less the size of a credit card. You can connect it to a TV or monitor and keyboard to use it as a general-purpose computer. However, it has still found many uses in developer projects due to its low cost and versatility. It comes as an exposed circuit board without any casing. This is pretty much similar to the Pi 1. Let us now focus on the differences.The Raspberry Pi 2 replaced the Pi 1 models. The Pi 2 has a 900 Megahertz (MHz) quad-core Advanced RISC Machines Cortex Central Processing Unit. It also packs 1 GB of RAM. These are the main hardware differences. The Raspberry Pi 1 had 256 MB of RAM and a 700 MHz quad-core CPU. This represents the first time the company has upgraded the CPU after trying to improve speed and memory through other ways (mostly software).
The improvement to the multi-core 900 MHz Broadcom BCM2836 SoC is responsible for the increased speed. The increased memory enables the running of complex operating systems and programs. These upgrades make Pi 2 perform roughly six times better than previous Pi models.
Just like the PI 1, the Pi 2 has the same four USB ports, forty GPIO pins, an Ethernet cable, a micro SD card slot, a HDMI port, a composite video and 3.5 mm audio jack, CSI, DSI, and a VideoCore 43D graphics core. The 4 USB ports supply up to 1.2A of current. This enables the connection of more components, even those that are power intensive.
The new Raspberry Pi 2 is able to run a wider range of the ARM GNU/Linux
distributions, the Microsoft 10 I0T, and the snappy Ubuntu core due to the change in the architecture from the ARMv6 instruction set to the ARMv7 and advancements in the processor speed and memory. We shall be looking at these operating systems in more detail and how to install them.
The Raspberry Pi 2 is fully backwards compatible with the Pi 1 and all the projects, software, and hardware that were used on the Pi 1. It is able to integrate all the projects that were on Pi 1, but it performs at a higher level due to the increased power. This ensures a seamless transition for those willing to upgrade. It has a complete identical form factor to its predecessor, even after managing to pack much higher power. All connectors are in the same place, retaining the same functionality. This means that any case or third party board add-ons you were using before will still fit onto the new Pi 2. The circuit board is still run from the 5V micro power adapter.
One thing that the Raspberry foundation should be commended for is sticking with the same price even with the added power. In fact, they have been responsible for bringing down the prices of embedded computers on the market. Before Pi 1, it was not possible to find them at prices any lower than $40. This has enabled more enthusiastic programmers, hobbyists, and students to try out their different coding skills on an inexpensive platform. Even for gamers who want increased functionality and possibilities in their video games, it has come in handy.
To demonstrate the increased performance of Pi 2 over the previous models, the Raspberry foundation created a quick test using a Python script that calculates the approximation of Pi’s speed then displays it in visual form in the popular Minecraft game. The Pi 1 used 47 seconds to complete this calculation, while the Pi 2 used just three seconds. The quad-core processor is that fast. However, the speed will also depend on whether you have optimized your Pi 2 to run multi threaded, which we will be looking at later. No matter how you use Raspberry, you will notice a bump in performance once you upgrade to the Pi 2.
With all the added power and functionality it brings, the Pi 2 is the one thing you should have. The extra flexibility over previous models that allows you to install and run a wider range of operating systems, including Windows 10 IoT operating system for builders and creators, will make it more popular with all it can do.
Raspberry pi 3
Processing power from a 1.2 GHz 64-bit quad-core ARM Cortex-A53 CPU. This has approximately the power of 10 Raspberry Pi 1s. In Raspberry pi 3 low-power on-chip Bluetooth 4.1 and 802.11n wireless LAN, both of which are integrated. Also it is very happy to say that it is total compatible with Raspberry Pi 1 and pi 2. As a reminder, the Raspberry 2 came with four USB ports, a full HDMI port, 40 GPIO pins, an ethernet port, camera interface, display interface, microSD card slot, VideoCore IV 3D graphics core and a 3.5 mm audio jack with composite video.The Raspberry Pi 3's new Broadcom SoC, dubbed BCM2837, has the identical basic architecture as its previous models, BCM2835 and BCM2836. This means that tutorials and projects that need the exact details of the Raspberry Pi hardware will keep working. Raspberry Pi 2 Model B sported a 32-bit quad-core ARM Cortex-A7 CPU complex clocked at 900MHz. With its 33 percent upgrade in clock speed and architectural improvements, the Raspberry Pi 3 is 50 to 60 percent more powerful in 32-bit mode when compared to its predecessor. More than half a year was spent to help the new BCM2837 SoC play well with the BCM43438 wireless "combo" chip. The Raspberry 3 maintains almost the same form-factor as the Raspberry Pi 1 Model B+ and the Raspberry Pi 2 Model B. The single noticeable modification is the location of the LEDs, which were repositioned in the opposite side of the SD card socket so that the antenna could fit. The built-in Bluetooth and wireless LAN will offer the customers of Raspberry Pi 3 with access to more USB ports.
Every connector kept its place and functionality from the Raspberry Pi 2 Model B. What is more, the board still supports a 5V micro-USB power adapter. The company recommends using a 2.5A adapter, should you plan to connect your Raspberry Pi 3 to power-hungry USB gadgets.
A summary of comparison of commonly available raspberry pi models given below;
Model | RPi 3 | RPi 2 | RPi B+ | RPi A+ | RPi zero | RPi B | Compute |
---|---|---|---|---|---|---|---|
Characteristics | Performance/Wi-FiBluetooth/Ethernet | Performance/Ethernet | Ethernet | Price | Price/Size | Original | Integration/eMMC |
Price | $35 | $35 | $25 | $20 | $5+ | $25 | $40($30 volume) |
Processor* | BCM2837 quad coreLinux ARMv7 | BCM2836Linux ARMv7 | BCM2835Linux ARMv6 | BCM2835Linux ARMv6 | BCM2835Linux ARMv6 | BCM2835Linux ARMv6 | BCM2835Linux ARMv6 |
Speed | 1.2GHz | 900MHz | 700MHz | 700MHz | 1GHz | 700MHz | 700MHz |
Memory | 1GB | 1GB | 512MB | 256MB | 512MB | 512MB | 512MB |
Typical Power | 2.5W(up to 6.5W) | 2.5W(up to 4.1W) | 1W(up to 1.5W) | 1W(up to 1.5W) | 1W(up to 1.5W) | 1W(up to 1.5W) | 1W(up to 1.5W) |
USB Ports | 4 | 4 | 4 | 1 | 1 OTG | 2 | Via header |
Ethernet | 10/100Mbps,Wi-Fiand bluetooth | 10/100Mbps | 10/100Mbps | none | none | 10/100Mbps | none |
Storage | Micro-SD | Micro-SD | Micro-SD | Micro-SD | Micro-SD | SD | 4GB eMMC |
Video | HDMI Composite | HDMI Composite | HDMI Composite | HDMI Composite | MiniHDMI Composite | HDMIRCA Video | HDMI via edgeTV DAC via edge |
Audio | HDMI digital audio and analog stereo via 3.5mm jack(where available) via edge connector | GPU | DualCore VideoCore 4 Multimedia Co-Processor at 250MHz(24GFLOPS) | ||||
Camera(CSI) | yes | yes | yes | yes | no | yes | CSI×2 via edge | Display(DSI) | yes | yes | yes | yes | no | yes | DSI×2 via edge |
GPIO header | 40 pins | 40 pins | 40 pins | 40 pins | 40 pins | 26 pins | 48 pins via edge | Usage | General-purpose computing and networking. High- performance interfacing. Video streaming. |
General-purpose computing. High- performance interfacing. Video streaming. |
General-purpese computing. Internet- connected host. Video steaming |
Low-cost general- purpose computing. Standalone electronics interfacing applications |
Low-cost small- profile standalone electronics interfacing projects |
General-purpose legacy applications. Internet-connected host |
Suitable for plugging into user-created PCBs using a DDR2 SODIMM connector. Open-source breakout board available |
*The BCM2835 is an ARM1176JZF-S(ARM11 processor architecture) that has full entitlement to an ARMv6 processor architecture.T he BCM2836 is a quad-core ARM Cortex-A7 that has a NEON Data Engine and full entitlement to an ARMv6 software architecture. The BCM2837 is 64-bit ARMv8 quad-core ARM Cortex-A53 processor that has a NEON Data Engine and full entitlement to ARMv7 software architecture |
Meet with Raspberry Pi
This section begins with an introduction to the features, components and layout of the Raspberry Pi board. We show contrasts between the various models but with an emphasis on the Raspberry Pi 2. Reading this section and examining the Raspberry Pi board is like looking at a map before setting off on a journey—it gives you the lay of the land. If you know where the various important parts of the board are and how they work, it makes imagining and creating projects a lot easier because you understand the board better.We begin with the Raspberry Pi 2 Model B (there was no Model A in the 2 series or the new 3 series). After introducing you to the Raspberry Pi 2, we’ll look at the other versions, including the Raspberry Pi 3 Model, which includes more processor speed, on board Wi-Fi and Bluetooth.
If you want to follow along with your own board, orient it as shown below, with the two rows of GPIO pins at the upper left.
GPIO Pins
The GPIO pins—the row of pins at the top of the board as it’s oriented in figure—perform magic in tying the Raspberry Pi to the real world. Through these pins, you program the Raspberry Pi to control all sorts of devices. “Input/Output”, looks at programming the Raspberry Pi and helps you understand inputs and outputs and shows methods of controlling various devices. Let’s examine these pins and get an understanding of how simple and powerful they are.
Raspberry Pi 2board with GPIO Pins at upper left |
Real-world devices—doorbells, light bulbs, model aircraft controls, lawn mowers, robots, thermostats, electric coffeepots and motors of all sorts, to name a few things cannot normally connect to a computer or follow its orders. Through GPIO, the Raspberry Pi can do neat stuff with these real-world objects! That’s why we’re emphasising the GPIO pins; the pins enable you to do things with the Raspberry Pi that you can’t do with conventional computers.
We have 40 pins—two rows of 20. The bottom row of pins (left to right) consists of odd numbers: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37 and 39. The top are numbered 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38 and 40.
These pins are programmable; you can even change the layout of most of the pins! The power pins cannot be rerouted.
When you add simple external circuits, it becomes possible for the Raspberry Pi to switch all sorts of things on or off. It can also sense input from devices and respond accordingly. Thanks to the Raspberry Pi’s ability to communicate in various ways—such as by wireless, by Bluetooth or on the Internet—inputs and outputs do not even have to be local. With some additional hardware, you can control devices, programs and so forth from anywhere in the world.
Status LEDs
The status light-emitting diodes (LEDs) are to the lower left of the GPIO pins. These tiny babies put out a good deal of light. On the Raspberry Pi 2, they are labeled (from top to bottom) PWR (power) and ACT (activity); PWR lights red and ACT lights green.
Whenever power is present to the board (that is, a micro USB plug provides 5 volts direct current (VDC) from a USB source or a wall adapter), the PWR light glows red. The ACT LED indicates that a microSD card is available, and only lights up when the Raspberry Pi accesses the card.
The Model B+ has the same arrangement as on the Model B except that the LED status lights are located on the opposite side of the board, and there are five LEDs:
■ ACT (activity, green): Indicates an SD card is plugged in and accessible
■ PWR (power, red): Indicates power is present
■ FDX (full duplex, green): Indicates a full duplex local area network (LAN) is connected
■ LNK (link, flashing green): Indicates activity is happening on the LAN
■ 100 (yellow): Indicates a 100-Mbit/s LAN is connected (as opposed to a 10-Mbit network)
With the Model B+, the last three LEDs functions were moved to the Ethernet jack, with the FDX and 100 being combined into one LED. So flashing green on the jack shows network activity on the right LED and either solid green or yellow on the left, showing a 10-Mbits/s (megabits per second) or 100-Mbits/s network connections, respectively.
All the Raspberry Pi models actually have five status lights; it’s just that on the B+ and Raspberry Pi 2 there are two LEDs (PWR and ACT) on one side of the board, and the network indicators are on the other side as part of the Ethernet jack.
The status LEDs give you a quick picture of what transpires on your Raspberry Pi board, especially during the boot-up process. It goes like this:
1. When you plug in the microUSB connector (there’s no on/off switch), the PWR LED lights red to show that power is present. The PWR LED stays lit so long as power is flowing to the board.
2. The ACT LED flashes green a couple of times or so, indicating an SD card is present and readable. After boot-up, this green light flashes whenever SD card access occurs.
3. As the powering-up process continues, the green light on the right of the Ethernet jack (Model B+ and later) come on if a network is present. The light flashes whenever there is traffic on the network. The left LED flashes green for a slow network and is solid yellow if you are connected to a 100Mbit/s network.
So, at a glance, the status LEDs tell us the board has power, the SD card is working and the network is active.
USB Receptacles
On the right-hand side of the board are the Raspberry PI 2 Model B’s four USB 2.0 ports, as shown below:
USB 2.0 ports and Ethernet ports |
The ports appear in the same way on the Model B+ but the older Model B provides only two USB receptacles.
USB receptacles—or ports, as some people incorrectly call them—allow you to plug in and run a keyboard, mouse and all sorts of other devices—even big hard drives!
Ethernet Connection
All sorts of Raspberry Pi tasks require a connection to both your local network and the Internet itself. Upgrading the operating system and the Raspberry Pi’s firmware requires Internet access. Networking is a necessity for downloading and installing programs, web surfing, using the Raspberry Pi as a media centre to deliver movies to your humongous flat screen TV and many more reasons.
Fortunately, you have two ways of achieving network connectivity with the Raspberry Pi. The first is a wired connection using the Ethernet socket on the lower-right corner (as shown in first picture). Refer to second picture to see what this socket looks like.
The second way of connecting involves the USB receptacles. You can use a wireless USB dongle (a dongle being a plug-in device) or a USB-to-Ethernet adapter. If you use the latter method, you can connect the Raspberry Pi to more than one network. One reason for doing this would be a typical server setup where the Raspberry Pi connects to both the Internet and a more secure local network. Using Raspbian, for example, you can turn your Raspberry Pi into a classic LAMP (standing for Linux, Apache, mySQL, PHP) server. The Raspberry Pi serves up websites with database back ends and so on, just like on much larger servers using the same software.
Using a wireless USB dongle comes in handy if you want your Raspberry Pi to be portable. With an external battery power supply and wireless access, you can carry it anywhere! Or at least anywhere with wireless access, which is true of more and more places these days.
Using a wireless USB dongle comes in handy if you want your Raspberry Pi to be portable. With an external battery power supply and wireless access, you can carry it anywhere! Or at least anywhere with wireless access, which is true of more and more places these days.
Audio Out
On the bottom of the board is the 3.5 millimetre (mm) audio input/output jack (see coming figure). Here you can plug in headphones, a computer sound card, speakers or anything thing else that takes and plays audio input.
The Model A and Model B did not have this feature but instead had separate connectors for video and audio.
Audio output socket |
Poles are the tip and rings of conductors. Four-pole had a tip and three rings; three-pole a tip and two rings.
Above figure shows how the connector appears on the Model B+ and later, and picture below shows the connector’s wiring.
Connector for Audio socket |
No worries, folks—like the limitations in Raspberry Pi power, solutions abound. For example, Adafruit sells a USB audio adapter, which works on the Raspberry Pi, for a very low price. It puts out better sound and allows for microphone input as well. This lets you use the Pi as a voice or music recorder or teach it to work via voice commands. Various computer sound boards designed specifically for the Raspberry Pi are also available.
Even better, you can obtain high-quality sound using the I2S interface into an external digital-to-analogue converter (DAC).
Composite Video
Using the same 3.5mm socket described in the previous section, old-style composite video is also available.
When it boots up and finds a composite video device attached, the Raspberry Pi attempts to select the right resolution. Mostly it gives a usable display but sometimes it gets things wrong.
Having video composite output may seem old school in light of the modern era’s profusion of HDMI devices hanging off every wall, but it fits in with the design philosophy Raspberry Pi Foundation co-founder Eben Upton recently described. He said, “It’s a very cheap Linux PC device in the spirit of the 1980s, a device which turns your TV into a computer; plug in to TV, plug a mouse and a keyboard in, give it some power and some kind of storage, an operating system and you’ve got a PC”.
CSI Camera Module Connector
Camera modules for the Raspberry Pi give you 5-megapixel stills and 1080 high-definition video. The Camera Serial Interface (CSI) connector shown in below (located between the HDMI socket and the 3.5mm audio socket) provides a place to plug the camera module into the Pi.
CSI and HDMI connectors |
CSI connects the camera module via a 15-conductor flat flex cable. Getting this cable connected and the camera module working is a bit tricky sometimes. You can find a how-to video on the Raspberry Pi website at
https://www.raspberrypi.org/help/camera-module-setup/.
However, after the cable sits in the socket properly, the camera works great. You can program it to do all sorts of neat stuff, such as take time-lapse photos and motion-triggered shots or record video footage.
However, after the cable sits in the socket properly, the camera works great. You can program it to do all sorts of neat stuff, such as take time-lapse photos and motion-triggered shots or record video footage.
HDMI
There’s nothing as fine as a nice big display showing the colourful graphical user interface (GUI) of the Raspberry Pi. A display enables you to surf the web, watch videos, play games—all the stuff you expect a computer to do. The best solution for that involves HDMI.
High-Definition Multimedia Interface (HDMI) allows the transfer of video and audio from an HDMI-compliant display controller (in our case, the Raspberry Pi) to compatible computer monitors, projectors, digital TVs or digital audio devices.
HDMI’s higher quality provides a marked advantage over composite video (such as what comes out of the audio socket on the Raspberry Pi board). It’s much easier on the eyes and provides higher resolution instead of composite video’s noisy and sometimes distorted video.
The HDMI connector on the Raspberry Pi Model B is approximately centred on the lower edge of the Raspberry Pi board. See above figure for what it looks like.
SD card
Applying power to the Raspberry Pi causes a bit of computer code stored on the board, the bootloader, to check for the presence of the SD or (in newer Raspberry Pi versions) microSD card in its slot and look for code on the card telling it how to start and what to load into its RAM. If no card is there or that card has no information on it (because it’s blank or corrupted) the Raspberry Pi does not start.
The usual minimum size recommended for earlier editions of the Raspberry Pi was 8 giga-bytes (8GB), although the original recommendation was 4GB. However, a number of people on the Internet report using 32GB cards, and at least one person even boasted of using a
128GB card. It seems, though, that any card larger than 32GB, under Raspbian at least, requires partitioning (using a software to specially format the SD).
Of course, you can hang just about any size of USB drive from one of the USB receptacles, if you use an external power supply. A terabyte would be a good start. The SD card is still needed to boot.
Do not insert or remove an SD card while the Raspberry Pi has power attached. Doing so has a very good chance of corrupting the SD card, causing you to lose the data and programs on it.
The usual minimum size recommended for earlier editions of the Raspberry Pi was 8 giga-bytes (8GB), although the original recommendation was 4GB. However, a number of people on the Internet report using 32GB cards, and at least one person even boasted of using a
128GB card. It seems, though, that any card larger than 32GB, under Raspbian at least, requires partitioning (using a software to specially format the SD).
Of course, you can hang just about any size of USB drive from one of the USB receptacles, if you use an external power supply. A terabyte would be a good start. The SD card is still needed to boot.
MicroSD slot on the bottom side of Raspberry Pi 2 |
DSI Display Connection
Just right of the SD card slot but on top of the board is the Display Serial Interface (DSI) display connector. The DSI connector’s design accommodates a flat 15-conductor cable that drives liquid crystal display (LCD) screens. Figure shows the connector.
DSI display connector |
Python Programming for RasPi
The Python is choosen to program the RasPi for several reasons. First, and most importantly, it is a simple programming language to use, and most beginners can start to use it immediately with little to no trouble. Second, despite being simple to use, it is a real programming language and shares most of the attributes that are common with other high-level, high-powered languages, such as C++ or Java. You should visit the official Python website, http://www.python.org where you will find a wealth of information regarding Python. This site should be your primary resource to use to answer any of your questions regarding the language.
The Python is a free open source software and thus they provide us for right to modify, distribute etc. The Python has very less number of keywords and a rich number of inbuilt functions as well as rich number of reusable modules like math, time, calendar etc. This makes Python to program is less number of lines for given problem and thus, increasing readability. So it is not tedious to study and read Python programming for a novice people.
There is rare chances for occurring errors and omissions in this blog, since I am not simulated every program and there is chances for misprint. If you find out any errors, you just comment under that post. I will check that. Your feedback is inevitable for me.
Lot of works cited to create this blog. So if any copyright is violated, please inform me. I will take actions to remove those materials from this blog.
Comments
Post a Comment