Going Further
The nitty-gritty of serial protocols is beyond the scope of this
book, but there are a lot of interesting examples of how oth-
er people have solved problems in the “Interfacing with Soft-
ware” (bit.ly/1o17nGY) section of the Arduino Playground (www.
arduino.cc/playground). In addition, you may want to try:
MIDI
If your project is musical, consider using MIDI commands as
your serial protocol. MIDI is (basically) just serial, so it should
just work.
Arduino-compatible Raspberry Pi shields
There are tons of shields, or PHATs (Pi HATs—Hardware
Attached on Top) on the market that connect the GPIO pins on
the Raspberry Pi with an Arduino-compatible microcontroller.
WyoLum’s AlaMode (bit.ly/1EylgRM) shield is a good solution
and offers a few other accessories, including a real-time clock.
Talk over a network
Finally, you can ditch the serial connection altogether and talk to
the Arduino over a network. A lot of really interesting projects are
using the WebSocket (www.websocket.org) protocol along with
the Node.js (nodejs.org) JavaScript platform.
Using the serial pins on the Raspberry Pi header
The header on the Raspberry Pi pulls out a number of input and
output pins, including two that can be used to send and receive
serial data bypassing the USB port. To do that, you’ll first need
to cover the material in Chapter 7, and make sure that you have
a level shifter to protect the Raspberry Pi 3.3V pins from the
Arduino’s 5Vpins.
If you’re looking to get deeper into making physical devices com-
municate, a good starting point is
Making Things Talk, 3rd Edition
(www.makershed.com/products/making-things-talk-third-edi-
tion), by Tom Igoe.
88 Getting Started with Raspberry Pi
GSW_RASPI_4ED_FIN.indd 88GSW_RASPI_4ED_FIN.indd 88 10/28/21 10:54 AM10/28/21 10:54 AM