The idea behind the Raspberry Pi to Arduino shields connection bridge is to allow to use any of the shields, boards and modules designed for Arduino in Raspberry Pi. It includes also the possibility of connecting digital and analog sensors, using the same pinout of Arduino but with the power and capabilities of Raspberry.
In order to make complete the compatibility we have created the arduPi library which allows to use Raspberry with the same code used in Arduino. To do so, we have implemented conversion functions so that you can control in the same way as in Arduino all the I/O interfaces: i2C,SPI, UART, analog, digital, in Raspberry Pi.
Let’s summarize what we can do using this shield along with the arduPi library:
- Connect any Arduino Wireless module in Raspberry. Some examples: XBee 802.15.4/XBee ZigBee, RFID, NFC, Bluetooth, Bluetooth Pro, Wifi, GPRS, 3G
- Connect any sensor (analog 0-5V, digital) to Raspberry Pi with a precession of 16b using the ADC integrated. Connect also complex sensors through i2C and UART buses
- Connect any Arduino specific shield such as: Radiation sensor shield, CanBus, Relay shield,…
- Connect any electronic module or actuator which works over i2C, SPI, UART
Version 2 of the shield:
- This version includes a Digital Switch to enable/disable the socket for wireless modules using GPIO23 (Digital Pin 3).
Get the schematics here
Get the Raspberry Pi to Arduino shields connection bridge here.
Version 1 of the shield:
- 8 Digital pins.
- Socket for wireless modules.
- RX/TX pins.
- i2C pins (SDA, SCL).
- SPI pins (SCK, MISO, MOSI, CS). Can be used also as GPIO.
- 8 channel analog to digital converter.
- Switch to enable external power supply.
Get the schematics here
3. The library: arduPi
arduPi is a C++ library that lets you write programs for Raspberry Pi as if you were writing an arduino program. All the functions in order to control Serial port communications, i2C, SPI and GPIO pins are available using the arduino syntax.
Once installed Raspbian, download and install arduPi library in a new folder, for example: “home/pi/ardupi”
For Raspberry Pi:
wget http://www.cooking-hacks.com/media/cooking/images/documentation/raspberry_arduino_shield/raspberrypi.zip && unzip raspberrypi.zip && cd cooking/arduPi && chmod +x install_arduPi && ./install_arduPi && rm install_arduPi && cd ../..
For Raspberry Pi 2:
wget http://www.cooking-hacks.com/media/cooking/images/documentation/raspberry_arduino_shield/raspberrypi2.zip && unzip raspberrypi2.zip && cd cooking/arduPi && chmod +x install_arduPi && ./install_arduPi && rm install_arduPi && cd ../..
You can find a library changelog here.