Skip to Content
Raspberry Pi Cookbook, 3rd Edition
book

Raspberry Pi Cookbook, 3rd Edition

by Simon Monk
October 2019
Beginner to intermediate
608 pages
11h 41m
English
O'Reilly Media, Inc.
Content preview from Raspberry Pi Cookbook, 3rd Edition

Chapter 18. Arduino and Raspberry Pi

18.0 Introduction

Although a Raspberry Pi is ideal for projects that need a network connection or a graphical user interface (GUI), the low-power general-purpose input/output (GPIO) and lack of any analog inputs puts it at a disadvantage to microcontroller boards such as the Arduino (Figure 18-1). Fortunately, it is possible to have the best of both worlds by connecting an Arduino to a Raspberry Pi and allowing the Arduino to interface with external electronics.

Arduino boards are superficially a little like a Raspberry Pi in that they are small and essentially are computers. However, Arduino boards are very different from the Raspberry Pi in a number of respects:

  • They do not have any interface to keyboard, mouse, or screen.

  • They have just 2 KB of RAM and 32 KB of flash memory for storing programs.

  • Their processor runs at just 16 MHz, compared with the Raspberry Pi 4’s 1.2 GHz.

This might lead you to wonder why you would use such an apparently feeble board rather than the Raspberry Pi directly.

The answer is that Arduino boards, the most common being the Arduino Uno, are better than the Raspberry Pi at interfacing with external electronics in several ways. For example, Arduino boards have the following features:

  • Fourteen digital inputs/outputs (I/Os), like the Raspberry Pi’s GPIO pins, but each pin can provide up to 40 mA, compared with the original Raspberry Pi’s 3 mA. This enables them to power more devices without the need for ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Raspberry Pi Cookbook, 4th Edition

Raspberry Pi Cookbook, 4th Edition

Simon Monk
Arduino Cookbook, 3rd Edition

Arduino Cookbook, 3rd Edition

Michael Margolis, Brian Jepson, Nicholas Robert Weldin

Publisher Resources

ISBN: 9781492043218Errata PageSupplemental Content