Chapter 3. The Arduino Raspberry Pi Interface

In this project, we will look into interfacing the Raspberry Pi to the Arduino microcontroller development platform. Arduino (www.arduino.cc) is a popular microcontroller platform that is widely used to prototype different projects. We will discuss installation of the Arduino development environment and discuss an example of its usage.

Raspberry Pi and Arduino have become popular platforms among hobbyists, and it is being widely used by people from different backgrounds, including school and university students, artists, and engineers. This project explains how the Raspberry Pi can be used in combination with Arduino.

Note

The Raspberry Pi comes with a GPIO pin set that is quite capable of interfacing and control devices. We would like to discuss the Arduino Raspberry Pi interface because you may have projects that were originally built using an Arduino, especially in scenarios where a remote firmware update needs to be performed on the Arduino platform using the Raspberry Pi. This project presents the options of enhancing the capabilities of the Arduino microcontroller using a Raspberry Pi.

Mission briefing

In the first part of the project, we will discuss programming the Arduino for the first time, and in the second half, we will look into the control of a Weasley weather clock. We will also look into the Raspberry Pi AlaMode , stackable add-on arduino hardware (http://wyolum.com/projects/alamode/).

Why is it awesome?

Arduino is an open source microcontroller development platform based on the Atmel series of microcontrollers. It has brought engineers, artists, and students to the same table. The programming interface (programs are written in C/C++ usually) is so simple and this was the sole reason that made the platform so popular. Hence, it is widely used for prototyping in product development.

Over the years, there have been several hardware add-ons that aided in hardware development using the Arduino. Some of these add-ons can be stacked on top of the Arduino development platform, and they are commonly referred to as shields. There are shields for medical devices, interfacing sensors, GPS units, and actuators such as stepper motors, servo motors, and so on. The ecosystem of the gadgets that are built around the Arduino is so vast that the microcontroller platform was launched into the stratosphere along with a helium balloon.

Where can you buy an Arduino?

Since the Arduino is an open source microcontroller board, there are many resellers for the product. The basic version of the Arduino is the Arduino Uno and costs about $29.95. Arduino-related products are sold at websites such as Sparkfun, Adafruit, and Seeed Studio.

Your Hotshot objectives

In this project, we will do the following:

  • Install the Arduino IDE
  • Program the Arduino using the Raspberry Pi
  • Raspberry Pi AlaMode (or any other Arduino development board)
  • Introduction to Weasley Weather Clock and Bill of Materials
  • Control the stepper using the Arduino
  • Control the RGB LED Strip using the Arduino
  • I2C Communication using the Arduino (optional)
  • Serial port communication with the Raspberry Pi

Mission checklist

We need a Raspberry Pi along with an SD card flashed with the Raspbian OS, a micro USB power cable, display setup, and an Arduino to get started. In the later section of this project, we will need some additional hardware such as RGB LED Strips, motors, wires, and so on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.132.123