Updated for the 8 GB version running the Raspberry Pi 64-bit operating system.
The Raspberry Pi is a small low-cost Linux-based computer that when mounted inside a suitable custom casing is about the size of a pack of cards. It can be used very much like a normal personal computer as well as having a use as a hardware controller through its GPIO bus. It is very useful as a learning tool for everyone interested in the operations of the software and hardware of a computing system, as well as an actual device for carrying out real-world computing or hardware interfacing.
The device has evolved over time, from the Raspberry Pi model 1 in 2012 all the way to the subject of this article, the model 4B released in June 2019, with the 8GB version released in late May 2020. If you are starting out with Pi now, I would advise buying the latest model, as there is no advantage buying previous models unless you specifically want the smaller footprint or require far fewer capabilities for slightly less cost.
I am making the assumption here that you are somewhat familiar with personal computers in general and are likely the owner of a typical Windows home computer. Familiarize yourself with the Pi and get a good feel for the layout of the components on the single board device and especially know where the input and output ports are and what they are used for.
The procedures I present here are a common and workable way of installing the Pi from scratch and although there may be some variation of the steps involved for other people, this outline should serve the purpose.
Differences between Pi 4 and Pi 3B+
The Pi 3B+ was the prior major version of the Pi and was released in March 2018 (there was a minor A+ version released a short time later). I will not go through the differences between the two models in too much detail as this article is more to get up and running with the Pi 4. The important things to know are:
There were three models of the Pi 4 and the only difference between them is the amount of RAM memory installed. There are 1GB or 2GB or 4GB and this time it is the faster DDR4 technology rather than the previous DDR2 RAM.
The later 8GB model uses DDR4 memory and the memory size increase is significant because it means that with the new 64-bit operating system the memory can be addressed as a single process.
The CPU has a slightly faster clock speed, but additional factors make it a much faster processor than on the Pi 3.
A big difference is the video output. Instead of a single HDMI HD output, the Pi 4 has two outputs to support two HDMI monitors. You can have one at 4K 60Hz and one at 1080p, or you can have both at 4K but each at 30Hz. Also of note is that the HDMI ports on the Pi 4 are now micro-HDMI format rather than the full format type found on the video monitors, so new cables or adapters to convert your old cables are required. Note that you still have the option of composite video from the jack connector, but then you cannot run HDMI.
Another change is the power supply. It now has a USB-C type connector rather than the micro-USB connector previously used. Also, as the Pi 4, especially the CPU, draws a lot more power, the power supply is recommended to be 3 Amp instead of the previous 2.5 Amp. You could still use your old power supply with a suitable adapter if you are not going to draw too much power from devices connected to the Pi 4. Also there are reports of the USB-C circuitry on the Pi 4 being of a somewhat odd design that may cause issues with some power supplies and therefore it may be prudent to use the recommended power supply that is designed for the device.
One thing that may cause some slight frustration is that the Pi 4 board layout has been altered slightly and it means that older Pi cases are not compatible and therefore if you require a casing then you will need to buy a new one.
There are four USB ports as before, but now two of those ports are USB 3.0.
The Ethernet port previously was gigabit capable but because it shared resources with the USB controller then it ran at only about a third of its supposed speed. Now the Pi 4 has true gigabit capability due to a dedicated controller.
Both devices have the same wi-fi and Bluetooth capabilities, with the Pi 4 having an improved Bluetooth version.
The microSD card interface is quite a bit faster but now with the USB 3.0 ports you may be able to use one as an alternate and faster boot option.
Finally, the GPIO pins are backward compatible with the addition of some new pins. A faster CPU means the IO ports will be able to operate faster.
The hardware required
It is advisable to read through the whole of this section first before carrying out any of the tasks as it will depend upon what peripheral devices you have available as to the order you may want to accomplish things when setting up.
Note that the 8GB version of the PI 4 model has the same port layout so that you can use the same case, and the other peripherals are the same, including the power supply.
You may already have some if not all of the additional parts required, especially if you already have a computer that you can ‘borrow’ the components from – at least for the initial setup. Later, we can eliminate most of the peripherals from the Pi if we want, by directly accessing it from our Windows computer.
There are kits for sale from some suppliers that will supply the Pi board as well as some other parts required. The most vital extra component that you will need is a power supply. This is normally the block type that plugs into a wall outlet and supplies the required power to the device. Make sure it is compatible with the Pi 4. I would also advise buying a suitable plastic casing to keep the Pi protected. A low-cost transparent clear case is ideal for Pi experimentation. If you want to use the Pi GPIO bus to interface with hardware later, then make sure the case will accommodate the GPIO cable required.
You will need a way to monitor the Pi output in the way of a monitor screen. If your current PC monitor has an HDMI input connector, then you can use that. Connect it to the Pi using a micro-HDMI to standard HDMI video cable. It does have dual monitor capabilities, but just connect one to begin with while setting it up.
Now we need some input devices for the Pi, in the form of a keyboard and mouse. These are standard USB devices, so again you can use your PC components temporarily, or use inexpensive dedicated parts. There is also an official Raspberry Pi keyboard and mouse that will also work with the Pi 4, but note that the keyboard has a USB 2.0 incorporated hub only.
The Pi does not have a disk drive of any kind, so you must add data storage in the form of a MicroSD card. This card will hold the operating system and all the software applications we may add. A size of 16GB will cover pretty much everything you will need, but a 32GB card may be good for future-proofing. My recommendation is a SanDisk Extreme 32GB microSDHC UHS-1 card. It will also make life very much easier if you also purchase a MicroSD card reader for your Windows PC for when we prepare the SD card by downloading and installing the required operating system. Some SD card deals actually include a small card reader that just plugs into a spare USB port, but they are inexpensive to buy otherwise. If you have a laptop, then you might have a card reader already incorporated into it. The card reader I have used quite successfully is from Sandisk.
The last thing you need to add is a network cable that you will plug between the Pi Ethernet port and the modem or switch that connects to the Internet in your home.
If you have all of those things above, then for setting up the Pi you have everything required.
Some additional hardware items you might consider:
If you are repeatedly connecting and removing the power supply plug, then consider acquiring an in-line USB-C switch so that you can power it on and off far more conveniently.
The Pi 4 CPU chip gets quite hot and if it reaches a certain temperature under heavy loading then it will cause it to throttle back the operating speed. I would advise getting a passive heat sink for the CPU chip and you may even consider adding a small fan if you really find it necessary, though a simple heatsink should be enough in most cases.
Acquire the operating system
The Pi is a Linux-based device. If you have not used Linux before, then don’t despair – the Pi is not difficult to use if you have a reasonable knowledge of computing in general, even if it is just Windows that you are used to using. The variation of Linux that is best suited to the Pi was previously called Raspbian but has changed name now to Raspberry Pi OS and is the option you should go for if you are starting out learning the Pi.
Using your regular computer (a Windows PC, for example) go to the download site here: https://www.raspberrypi.org/downloads/
I am going to assume Windows here as your computer system where you will create the operating system image for the SD card, but there are install options for MacOS and Ubuntu.
Although the Raspberry Pi Imager is the default method now used to create the SD card for the Pi, it does not appear to be trouble-free and may result in an Error writing to storage message. If this happens to you, then read the later section that offers an alternate way to create the OS onto the SD card.
Select Raspberry Pi Imager for Windows and this will download a single file called imager.exe.
Don’t attach the SD card to the computer yet. First, run the imager.exe file and in the first window select Install. This installs a program onto your Windows computer called Raspberry Pi Imager. Now go to your Start menu and find the program and run it. Now insert the SD card into your Windows computer. Understand that the SD card will be wiped clean during the following actions, so make sure there is no data on it that you want to keep!
On the imager start screen, select CHOOSE OS and select the OS you require. If the OS you want is not listed, for example it may still be in beta, then search the raspberry.org web site for what you need, and download the corresponding ZIP file for it, which when unzipped will result in a single IMG file. Now in this case, when making the selection in the Raspberry Pi Imager utility, you would select the Use custom menu option instead.
Now in the Imager utility, select CHOOSE SD CARD and select your SD card. Be careful to pick the correct entry if there is more than one choice. After that, select WRITE and the SD card should be set up.
Alternate method of creating the SD card
If you were not able to get the Raspberry Pi Imager utility to work properly, we can use the following method instead.
Firstly from the Raspberry Pi downloads page, find the image you need (you may have to search around for the file, especially if it is a beta form). You are looking for the ZIP format of the image. When downloaded, you unzip the file and retrieve the resultant IMG file.
So on our Windows computer, we need a small application to put the image onto the SD card and the best I have found is the freeware Win32 Disk Imager available here:
https://sourceforge.net/projects/win32diskimager/
Install the Disk Imager software onto your Windows computer by double-clicking the executable file you just downloaded. Do not opt to start it. Start the program after it is installed, with administrative rights, and you will see a small pop-up screen appear:
Insert the MicroSD card into your SD card reader and insert the reader with the card into a USB port (unless the reader is already incorporated). I should offer a caution at this stage that you must make sure if this SD card has been previously used then save any data on it you will need to keep, as the following process will remove any existing data!
If you get a prompt to format the card, then just ignore it by selecting Cancel. Also, make absolutely sure that when you have plugged in the SD card and it is recognized by Windows that you know the drive letter that is assigned to it. For safety, it is advisable to remove any other USB storage devices so you will not install in error (also this may prevent errors when writing to your intended SD card). Use the Windows Disk Management tool to see the layout of your drives and to determine the exact drive letter of the SD card.
In the Win32 Disk Imager window, select the small blue disk folder icon on the right and browse for and open the IMG file you downloaded earlier. Next to that icon, under Device, select the correct drive letter for your SD card. It should only show USB storage devices, but make sure you select the correct one if there is a choice.
Now just select the Write button lower down. Confirm the write. It will take a few minutes to copy the image to the SD card.
Now eject the reader and remove the SD card and it’s all ready to go!
Running the Pi for the first time
With everything connected to the Pi, but with the power supply disconnected, insert the newly made SD card into the Pi (the card socket is on the opposite end of the Pi to the USB connectors, on the underside of the board) then connect the power supply and it will start up the device and you will see the desktop screen appear on the monitor after a short wait.
Basic configuration of the Pi
In previous versions of Raspbian it was a slightly complicated affair to set up the Pi for the first run. In the very latest OS versions you will see at the first power on that there is a welcome screen and after pressing Next you will get some options for country; language; timezone. Enter the settings appropriate to your region, then press Next. There will be some other options to answer to, as well as running updates, which you should do.
So basically that’s all there is to it. You should see a nice desktop now, where you can test out different applications in the same way as with any other computer.
Linux has always relied a lot on the command prompt and there are still many uses for it. To access the command prompt just type CTRL ALT T or access the command prompt icon from the top of the screen.
Here you can run commands as required. For example, run this command: sudo raspi-config
This brings up a basic GUI that has all of the settings that you entered above, and many more, when you first set up the Pi, so that is the way to access those settings if you need to make changes later. In fact, this was the original way to set system settings on older versions of Raspbian. Go through some of the options here and see what settings there are.
Furthermore, you can right-click the desktop and select Desktop Preferences and make a few changes to the appearance.
Getting sound output
There are two ways to get audio from a Pi – either through the HDMI channel or using the headphone jack. Using the HDMI output, if the monitor has built in speakers then the sound will come through those. If there are no speakers in the monitor then you can use a HDMI audio extractor module to divert the sound to PC speakers or headphones. You may find that you have to manually switch between HDMI sound or jack socket sound by right-clicking the blue speaker icon at the top right of the screen and selecting the appropriate option.
Moving forward
These instructions so far have got you up and running with the Raspberry Pi system and you have enough information to play around and discover the capabilities. You are encouraged to read instructional texts and documents found all over the Internet about how to make full use of the Pi.
If you are low on hardware resources and you need to use your monitor, keyboard, mouse for your main Windows computer, then look into setting up SSH so that you can connect remotely through the Windows computer to the Pi, using the mouse and keyboard and monitor to access it. You can then open a window on your Windows desktop to see Pi activity as well as still operating your normal Windows capabilities.
To finish for the day, turn off the Pi by clicking the upper-left Raspberry Pi icon and selecting Shutdown or issue the command sudo shutdown