Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Raspberry Pi 3 Projects for Java Programmers

You're reading from  Raspberry Pi 3 Projects for Java Programmers

Product type Book
Published in May 2017
Publisher Packt
ISBN-13 9781786462121
Pages 286 pages
Edition 1st Edition
Languages
Authors (3):
Rajdeep Chandra Rajdeep Chandra
John Sirach John Sirach
Profile icon John Sirach
Pradeeka Seneviratne Pradeeka Seneviratne
Profile icon Pradeeka Seneviratne
View More author details

Table of Contents (8) Chapters

Preface Setting up Your Raspberry Pi Automatic Light Switch Using Presence Detection A Social and Personal Digital Photo Frame Integrating a Real-Time IoT Dashboard Wireless Controlled Robot Building a Multipurpose IoT Controller Security Camera with Face Recognition

Getting started with the Raspberry Pi

With the release of the Raspberry Pi 3, the Raspberry Pi foundation has made a very big step in the history of the Raspberry Pi. The current hardware architecture is now based on a 1.2 GHz 64 bit ARMv7. This latest release of the Raspberry Pi also includes support for wireless networking and has an onboard Bluetooth 4.1 chip available.

Even though the Raspberry Pi 3 has 64-bit ARMv8, the operating system of the Raspberry Pi which is Raspbian confusingly report it is an 32-bit ARMv7. This is because of the Raspbian OS is currently only available in 32-bit.

To get started with the Raspberry Pi you will need the following components:

  • Keyboard and mouse: Having both a keyboard and mouse present will greatly help with the installation of the Raspbian distribution. Almost any keyboard or mouse will work.
  • Display: You can attach any compatible HDMI display, which can be a computer display or a television. The Raspberry Pi also has composite output shared with the audio connector. You will need an A/V cable if you want to use this output.
  • Power adapter: Because of all the enhancements made, the Raspberry Pi foundation recommends a 5V adapter capable of delivering 2.5 A. You would be able to use a lower-rated one, but I strongly advise against this if you are planning to use all the available USB ports. The connector for powering the device uses a micro USB cable.
  • MicroSD card: The Raspberry Pi 3 uses a MicroSD card. I would advise using at least an 8-GB class 10 version. This will allow us to use the additional space to install applications, and as our projects will log data, you won't be running out of space soon.
  • The Raspberry Pi 3: Last but not least, a Raspberry Pi 3. Some of our projects will be using the on-board Bluetooth chip, and this version will also be focused on in this book.

Our first step will be preparing a SD card for use with the Raspberry Pi. You will need a MicroSD card as the Raspberry Pi 3 only supports this format. The preparation of the SD card is being done on a normal PC, so it is wise to purchase one with an adapter fitting a full-size SD card slot. There are webshops selling preformatted SD cards with the NOOBS installer already present on the card. If you have bought one of these preformatted cards you can skip to the Installing Raspbian section.

Getting a compatible SD card

There is a large number of SD cards available. The Raspberry Pi foundation advises an 8-GB card, which leaves space to install different kinds of application and supplies enough space for us to write log data. When you buy an SD card, it is wise to keep your eyes open for the quality of these cards. Well-known and established manufacturers often supply better quality than the counterfeit ones. SD cards are sold with different class definitions. These classes explain the minimal combined read and write speeds. Class 6 should provide at least 6 MB/s, and class 10 cards should provide at least 10 MB/s. There is a good online resource available that provides tested results of using SD cards with the Raspberry Pi. If you need a resource to check for compatible SD cards, I advise you to go to the embedded Linux page at http://elinux.org/RPi_SD_cards.

Preparing and formatting the SD card

To be able to use the SD card, it first needs to be formatted. Most cards are already formatted with the FAT32 filesystem, which the Raspberry Pi NOOBS installer requires, unless you have bought a large SD card it is possible it is formatted with the exFAT filesystem. These then should also be formatted as FAT32. To format the SD card, we will be using the SD association's SDFormatter utility, which you can download from http://elinux.org/RPi_SD_cards, as default OS supplied formatters do not always provide optimal results.

In the following screenshot, the SDFormatter for the Mac is shown. This utility is also available for Windows and has the same options. If you are using Linux, you can use GParted. Make sure when using GParted you use FAT32 as the formatting option. As shown in the screenshot, select the Overwrite format option and give the SD card a label. The example shows RPI3JAVA, but this can be the label of your choice so you can quickly recognize the card when it's inserted:

Press the Format button to start formatting the SD card. Depending on the size of the SD card, this could take some time, enabling you to get a cup of coffee. The utility will show a done message in the form of Card Format complete when the formatting is done. You will now have a usable SD card.

To be able to use the NOOBS installer, you will need to follow the following steps:

  1. Download the NOOBS installer from https://www.raspberrypi.org/downloads/.
  2. Unzip the file with your favorite unzip utility. Most OSes already have one installed.
  3. Copy the contents of the unzipped file into the SD card's root directory so that the copy result is as shown in the following screenshot:
When selecting the NOOBS for download, only select the lite version if you do not mind installing Raspbian using the Raspberry Pi's network connection.

After we have copied the required files into the SD card, we can start installing the Raspbian OS.

You have been reading a chapter from
Raspberry Pi 3 Projects for Java Programmers
Published in: May 2017 Publisher: Packt ISBN-13: 9781786462121
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}