Arduino and Raspberry Pi: using a microcontroller in your projects
By Russell Barnes. Posted
Advertisement
Head to head: Raspberry Pi + Raspberry Pi Zero + Raspberry Pi Pico.
If you want your next project to break beyond the limits of code and screens, you might want to consider adding an Arduino board to your Raspberry Pi. These simple, cheap controllers come in all shapes and sizes and allow you to easily measure, monitor, and manipulate the physical world.
Arduinos are microcontrollers that make physical computing projects quick and easy to build. Whether you’re flashing LEDs, activating motors, or sensing changes in the real world, an Arduino is worth considering as part of your project.
In issue 61 of The MagPi, we take you through the first steps of using an Arduino, and provide examples of fun and useful projects to make. Whether you’re building a weather station, constructing a robot, making an alarm for your bedroom, or planning an automatic watering system for the greenhouse, Arduino and Raspberry Pi make a powerful tag team.
This article first appeared in The MagPi 61. Click here to download your free copy.
Looking at the Arduino Uno
The Arduino Uno looks like a smaller Raspberry Pi board, but works differently. While the Raspberry Pi is a versatile computer, the Arduino board is a highly focused microcontroller.

Digital I/O
The Arduino has 14 digital input/output pins (female header) of which six can be used as PWM (pulse-width modulation) outputs to control devices such as servos, RGB light levels, and other devices that need precision.
Microcontroller chip
An ATmega328P microcontroller is used to control the hardware on the Arduino board. It is programmed using the Arduino IDE (accessed via the Raspberry Pi).
Reset Button
On one corner of the Arduino board sits a reset button. When you reset an Arduino it reboots and immediately starts running the same program.
Analogue Inputs
On the lower half of the Arduino Uno are six analogue input pins (female header). These can be used to read information from devices such as potentiometers and photoresistors.
USB Type B
The larger USB Type B connector on the Arduino is used to draw power, and provides a connection between the Raspberry Pi and Arduino. Programs are created on the Raspberry Pi using the Arduino IDE and uploaded via USB to the Arduino board.
Quartz Crystal
A 16MHz quartz crystal chip is included on the board. This helps the Arduino control devices with precision.
Russell runs Raspberry Pi Press, which includes The MagPi, Hello World, HackSpace magazine, and book projects. He’s a massive sci-fi bore.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
All right all right!! Artificial Intelligence, Hollywood style
When we get AI right, odds on it’ll be thanks to small firms, motivated individuals, and Raspberry Pi
Read more →
Pironman 5 Mini review
Compact and bijou, this Raspberry Pi 5 case looks cool
Read more →
E-ink shipping monitor
The display comprises a Raspberry Pi Zero 2 W, a Pimoroni Inky Impression 7.3-inch display, and a Wegmatt dAISy Mini AIS receiver. AIS stands for ‘Automatic Identification System’, and it’s this device that picks up the signals coming from the ships themselves, which goes to the display via the Raspberry Pi Zero 2 W. There’s probably a […]
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.