This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.
The Raspduino can be bought in the BitWizard shop.
- 1 Features
- 2 Software Installation
- 3 Connectors and pinout
- 4 LEDs
- 5 Jumpers
- 6 Powering the Raspduino
- 7 Future hardware enhancements
- 8 Changelog
- Fully Arduino compatible
- Plugs directly on a Raspberry Pi
- Compatible with (almost) all Arduino shields
- Equipped with an ATmega328 microcontroller
- Upto 8 analog inputs
- Upto 20 digital I/O
- Breaks out the Raspberry Pi's SPI and I2C busses
Using the Arduino IDE
Running the Setup Script
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script here.
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup sudo ./raspduino-setup sudo reboot
Uploading a sketch
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for headless servers.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script For setting up the Arduino IDE.
Secondly, we need to install pip, the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program for the RaspDuino!
Creating a Project
Create a new empty directory:
Change into the newly created directory:
... and initialize a new project:
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board] platform = atmelavr framework = arduino board = raspduino upload_port = /dev/ttyAMA0 # enable auto-uploading targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino. An example main.c that blink the led can be found here. More can be found are in among the project examples. platformio.ini has to be modified in all cases to work with RaspDuino.
Connectors and pinout
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
Raspberry Pi connectors
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our Raspberry_Pi_Serial board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
Extra analog connector
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the BitWizard SPI expansion boards from the Raspduino.
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
Serial busses voltage selection jumper
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
AVR voltage selection jumper
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
Powering the Raspduino
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
Future hardware enhancements
Suggestions are welcome.
- Initial public release