Hardware Reference
In-Depth Information
Connect Arduino Shields to Your
Raspberry Pi
HACK 58
Because there are already many available shields for extending the func-
tionality of an Arduino, Raspberry Pi hackers have found ways to bring
those parts to Raspberry Pi.
The idea behind the Raspberry Pi to Arduino shields connection bridge is to allow the
Raspberry Pi to make use of any of the shields, boards, and modules designed for
Arduino. It also includes the possibility of connecting digital and analog sensors, using
the same pinout of Arduino but with the power and capabilities of the Raspberry Pi.
In order to make the compatibility complete, Cooking Hacks created the arduPi library,
which allows you to use the Raspberry Pi with the same code used with an Arduino.
To do so, they implemented conversion functions so that you can control all the I/O
interfaces (I2C, SPI, UART, analog, and digital) in the same way you would control
them with the Arduino. Options with this shield and the arduPi library include con-
necting:
• Any Arduino wireless module to the Raspberry Pi, such as the XBee 802.15.4/
XBee ZigBee, RFID, NFC, Bluetooth, Bluetooth Pro, WiFi, GPRS, or 3G
• Any sensor (analog 0-5 V, digital) to the Raspberry Pi with a precession of 16b
using the integrated ADC.
• Complex sensors through I2C and UART buses
• Arduino-specific shields, like the radiation sensor shield, CanBus, and relay shield
• Any electronic module or actuator that works over I2C, SPI, UART
The bridge board connects to the Raspberry Pi's GPIO pins from below. As shown in
Figure 6-3 , the top includes the following items:
• 8 digital pins
• Socket for wireless modules
• RX/TX pins
• I2C pins (SDA, SCL)
• SPI pins (SCK, MISO, MOSI, CS), which can be used also as GPIO
• 8-channel analog-to-digital converter
• Switch to enable external power supply
Search WWH ::




Custom Search