Arduino and Raspberry Pi: using a microcontroller in your projects
By Russell Barnes. Posted
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
Mighty Projects – 1GB Computer in Raspberry Pi Official Magazine 164
It’s normal for computers to get faster and more pwerful, but the new-ish Raspberry Pi 5 1GB is a step in the other direction: it has all the processing power and the same GPIO pins of its more costly siblings, but with only 1GB of RAM it’s at a price that’s friendlier on the wallet […]
Read more →
Win one of five 256GB Raspberry Pi Flash Drives
If you’ve been around long enough, you know that every Raspberry Pi accessory is top quality, and the latest Flash Drive is no different. Fancy a big one? We have five up for grabs, and you can enter below… Win 1 of 5 256GB Raspberry Pi Flash Drives
Read more →
Full-Colour ePaper Display HAT+
A spectacular Spectra 6 display for your Raspberry Pi
Read more →