Raspberry Pi

Introduction

../../_images/RaspberryPi0WH.jpg

The esieabot is equipped with a Raspberry Pi 0 WH. - 0: Raspberry Pi edition, the Raspberry Pi 0 being the “small” low-power model. - W: wireless edition, equipped with Wi-Fi 2.4Ghz and Bluetooth 4.1 - H: “headers” edition, i.e. with pre-soldered pins (top of image)

../../_images/RaspberryPi0WH-with-infos.jpg

It’s a mini-computer, as powerful as a mid-2010s smartphone, capable of running Linux. It’s equipped with a single-core processor running at 1Ghz and 512 MB of RAM. Not much compared with your personal computer, but more than enough for a wide range of tasks.

Differences with your personal computer

The operating system you’ll be installing is based on Debian, a popular Linux distribution. If you use Ubuntu on a daily basis, you should know that it too is based on Debian. All commands are therefore extremely similar. The fundamental difference between your Raspberry Pi and your computer is the processor architecture. On your computer, you should all have an AMD or Intel processor of x86 architecture. On the Raspberry Pi, the processor has an ARM architecture, just like on a phone or tablet. It’s simply a different design of the processor and how it works. But from your point of view, it doesn’t make much difference. The only difference you need to know is that a program compiled on your personal computer by gcc will be compiled for your computer, i.e. in x86. Whereas if you compile the same program on your Raspberry Pi with gcc too, it will be compiled for ARM architecture processors. So there’s no difference in your C code. The only difference is in the compiled executables, which are not interchangeable.

Connecting to the Raspberry Pi

Since this is a real computer, you could plug in a micro-SD card to act as a “hard disk”, a USB power supply to the “PWR” port, a keyboard to the “USB” port and a screen to the micro-HDMI port. You could then control your Raspberry Pi like a conventional computer. But that’s not very practical. We’re still going to need the micro-SD card as a storage medium for the operating system, but we’re going to use a USB battery to power the Raspberry Pi instead. Instead of plugging in a keyboard and screen to have a terminal, we’re going to open a remote network terminal instead. To install the operating system and open a remote networked terminal, please consult the document Using an esieabot.

GPIOs

Warning

The Raspberry Pi 0 is not equipped with a fuse. Incorrect connection may destroy it.

GPIO (General Purpose Input/Output) ports are literally general-purpose input/output ports. They are generally pin-type ports found on microcontrollers and development computers. As their name suggests, they can be used for a wide range of functions. You may already have worked with them on Arduino. You then had at your disposal a series of ports that could be used for logic input/output or analog input. Each development board has different GPIOs. For example, the Raspberry Pi has more ports than an Arduino Uno, but no analog input.

Your esieabot is equipped with a Raspberry Pi Zero WH computer. Here’s a diagram explaining the function and numbering of the pins:

../../_images/RaspberryPi0-GPIO.png

Power” ports correspond to the power supply, 3.3V or 5V. Ground” ports correspond to ground. GPIO” ports are our famous GPIOs. Note that some ports have special functions (I²C, UART, SDI, etc.). Note also that you can find diagrams with different numbering on the Internet. Each numbering corresponds to a different programming library. Be careful not to get confused. WiringPi numbering is deprecated, as the library no longer exists.

Warning

The Raspberry Pi uses a voltage of 3.3V for its GPIOs. If you try to send 5V to one of the GPIOs, you risk destroying your esieabot.

You’ll find a detailed, dynamic view of the Raspberry Pi’s GPIOs at https://fr.pinout.xyz/. You’ll also find information on special GPIOs, such as those that can output a hardware-clocked PWM signal.

Note

Diffirent ways of counting GPIOs exist. In this documentation, we will only talk about “BCM” pinout like “GPIO21” for the bottom-right one.