background preloader

Tutorial: How to use your Raspberry Pi like an Arduino

Raspberry Pi, Python & Arduino | We Saw a Chicken … After the other night’s wonderfully slow detour into Processing, I thought I’d try the Raspberry Pi’s “native” language of Python to control an Arduino. This worked rather well, though I don’t have a slick GUI for it yet. pyFirmata is the magic that allows an Arduino running Firmata to talk to Python. It’s fairly easy to install under Raspbian: Get the required packages:sudo apt-get install python-serial mercurialDownload the pyFirmata code:hg clone cd pyfirmata sudo python install (If this succeeds, you can delete the pyfirmata folder.) Using pyFirmata is a bit different from other Arduino applications: Here’s some code that uses the same hardware as before, but simply reports the temperature and ramps the brightness of the LED up in 10% steps. The output from this might look like: If this doesn’t work, check the output of dmesg to see if you’re using the right port. which should generate something like Send the author to the moon!

Raspberry Pi Enclosure by builttospec This laser cut Raspberry Pi enclosure design features light pipes for the status LEDs and obscures the T-slots for a nice clean looking enclosure. All off board connectors are accessable with the top off and you can use standard ribbon cable connectors through the case to hook up the expansion header as well. Spacing of the top layers have been adjusted so these should be compatible with pi plates when they become availiable with minimal additional hardware. UPDATE: The design has been updated to support both the models of the Raspberry Pi board (A & B) and include better standoffs. Black acrylic kits are available here: And a limited number of translucent purple acrylic kits are available here:

RaspberryPi @Homelabs » RaspberryPi the Arduino Development Tool Not really too much to say here. There has been much talk on the forums about using arduino and similar systems to provide additional IO capabilities for the RaspberryPi. So I decided to take things a little further and discover whats needed to use the RaspberryPi itself as a development platform using the Arduino IDE. Following the simple steps below, it is possible to install, and run the arduino IDE, and then re program your USB connected arduino. I’m not going to go into too much detail, but simply provide you with the recipe to replicate my success Firstly log on using the pi user (I did it over ssh). wget tar zxvf arduino-1.0-linux64.tgz sudo apt-get install avr-libc sudo apt-get install libftdi1 sudo apt-get install avrdude sudo apt-get install openjdk-6-jre sudo apt-get install librxtx-java cd arduino-1.0 for i in $(find . pi@rasp:~$ cd arduino-1.0/ pi@rasp:~/arduino-1.0$ .

Raspberry Pi + Arduino + SPI This tutorial will show you how to communicate from your raspberry pi to your arduino using 3-wire SPI. Requirements 1 Raspberry pi (running Raspbian)1 Arduino4 wires Your raspberry pi should be running the newest version of Raspbian. To ensure your system is up-to-date please download and run rpi-update. Wiring Arduino Open your Arduino ide and flash the below code to your Arduino. Arduino code Raspberry Pi With your updated rasbian system you should have the drivers that you need. modprobe spi_bcm2708 modprobe spidev Check to be sure the modules loaded: lsmod Module Size Used by spidev 5944 0 spi_bcm2708 5350 0 snd_bcm2835 21681 0 snd_pcm 81170 1 snd_bcm2835 snd_seq 59528 0 snd_timer 21602 2 snd_seq,snd_pcm snd_seq_device 6924 1 snd_seq snd 57427 5 snd_seq_device,snd_timer,snd_seq,snd_pcm,snd_bcm2835 snd_page_alloc 5343 1 snd_pcm i2c_bcm2708 3822 0 Raspberry Pi Code Save the below code as spidev_test.c on to your Raspberry Pi and compile it gcc spidev_test.c -o spidev_test Running sudo . Debugging

Ultimate Raspberry Pi Set-up Kit ModMyPi's Raspberry Pi Ultimate Kit has everything contained in the Supreme Kit with the addition of a USB Hub, Wifi Dongle, Bluetooth Dongle, Heatsink Kit and SD Card Reader! We've carefully compatibility tested all components, and only selected the very best manufacturer guaranteed, high quality parts available! You won't find a better kit at a better price, and all our kits are fully customisable from our huge range of Raspberry Pi accessories, cases and cable colours! This kit does NOT include a Raspberry Pi ModMyPi's Raspberry Pi Ultimate Kit Includes: - Raspberry Pi Case of Your Choice - Including ModMyPi, Cyntech, PiBow's and more! Click the links above for information on the available choices, and customise your kit on the right hand side! Any EU, US or AUS products marked with *** consist of a UK plug with regional adapter. Set Up Kit Key - Includes Raspberry Pi - Starter Kit - Supreme Kit - Ultimate Kit

Dr. Monk's DIY Electronics Blog: raspberry pi The Raspberry Pi has some competition, in the shape of the BeagleBone Black. I thought it might be useful to compare these two boards and highlight their relative advantages. Both boards are Linux-based single board computers about the size of a credit card. About the Raspberry Pi The Raspberry Pi, managed to create a huge amount of interest around the world, even before its release. While the project started in the UK as a platform for getting kids to learn to program, the board has been adopted around the world as a platform for hobbyists and educationalists. About the BeagleBone Black Historically, the BeagleBone Boards have been around for a while selling at around the $85 mark. Features Lets start comparing some of the features of these two boards. Operating System Both devices have a number distributions available for them. The 'standard' and most used distribution for Raspberry Pi is 'Raspbian' which is based on Debian. Processor and Memory Connectors Expansion Boards Power Consumption

Raspberry Pi Raspberry Pi OpenCV Pan & Tilt Face Tracker Create your own face tracking, pan and tilt camera on the Raspberry Pi! This tutorial will demonstrate use of the OpenCV (computer vision) library to identify and track faces on the raspberry pi using two servos and a USB webcam. This project is based on the OpenCV face tracking example that comes along with the source-based distribution. Using the coordinates of the rectangle vertices, my script calculates the (X,Y) position of the center of the face. Hardware Parts needed: 512 MB raspberry pi2x Hobby servos (Turnigy 9g fom Hobby King)Pan & tilt bracket (from Foxtech FPV)USB webcam (Microsoft LifeCam Show from Amazon)Power supplyHook-up wireRaspberry Pi enclosure (from Built to Spec) Assembly Connect the red, power lines of the servos to +5v, the black ground lines to GND, and the yellow signal lines to the desired output pins, GPIO pins 22 and 23 in the example. And here is how it looks all put together: Software Get the source. Software Hardware

The proper way to put an Arduino in a Raspberry Pi For all their hoopla, the GPIO pins on the Raspberry Pi aren’t terribly useful on their own. Sure, you can output digital data, but our world is analog and there just isn’t any ADCs or DACs on these magical Raspi pins. The AlaMode, a project designed by [Kevin], [Anool], and [Justin] over at the Wyolum OSHW collaborative aims to fix this. They developed a stackable Arduino-compatable board for the Raspberry Pi. Right off the bat, the AlaMode plugs directly into the GPIO pins of the Raspberry Pi. A lot of unnecessary cruft is done away with in the AlaMode; There’s no USB port, but it can be programmed directly over the GPIO pins of the Raspberry Pi.

0.3.1a A module to control Raspberry Pi GPIO channels Latest Version: 0.5.4 This package provides a class to control the GPIO on a Raspberry Pi. Note that this module is unsuitable for real-time or timing critical applications. Downloads (All Versions): 281 downloads in the last day 2327 downloads in the last week 9880 downloads in the last month Raspberry Pi and Arduino via GPIO UART | In an attempt to get my Raspberry Pi talking to my Arduino I’m exploring various different options. The first was to just use the USB connection, but that was too simple. So, here is how to connect the two using the UART on the GPIO pins of the Raspberry Pi. To make testing easier I wanted to keep the Arduino’s serial connected via USB to my PC so I can print messages there and read it with the Serial Monitor. To show how this works the Arduino is running a small program that reads from the Raspberry Pi’s and copies this to my PC via USB. By default the Raspberry Pi uses the UART in two ways: Console Messages (including bootup messages)A getty so you can login via serial To use this serial port for your own uses you need to disable these two services. To change the console baudrate, edit /boot/cmdline.txt to look like this (this is all one line): dwc_otg.lpm_enable=0 console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait Connected to PC

WebIOPi : control your Pi’s GPIO with a browser ! | WebI0Pi 0.6 has been released, click here for details. I’m proud to present my new project, WebIOPi. This is a web application which allows you to control your Raspberry Pi’s GPIO. Just install it on your Pi, and use any browser from your network. It’s useful to start enjoying GPIOs and also to debug some circuits without writing any line of code. It also allows to control your Pi’s GPIOs over Internet, so it’s a good starting point for home remote control. You can even fully customize the included UI with few CSS modifications or use the REST API to build your own WebApp. Under Apache License, full doc, code, packages and examples are available on the Google Code project page. Features Supports binary GPIOs, in both input and output.HTML / Javascript / CSS client sideEasily customize UIREST/JSON Web APIServer side available in several technologies PHP/ApachePHP/lighttpdPythonSmartphone compatibleAuto-refresh Check the roadmap for upcoming features

Format SD Card Firstly, you need to install the Debian image onto an SD card (2GB or more). (The image can be downloaded from You can do this using the Win23DiskImager tool for Windows (downloaded from Insert your SD card. Once the write process has finished, you can remove the SD card, then the fun begins. The Adafruit Learning System Raspberry Pi WebIDE is Ready for Testing #piday #raspberrypi @Raspberry_Pi We finally have the Raspberry Pi WebIDE in a place where we think it is solid enough for an alpha release. First, a disclaimer: this release will likely have bugs, and minor issues, so we recommend that only experienced linux/python users install it for the time being. It is certainly our intention to get this solid and ready for all users, and we will let everyone know when we think it is at that point. Now, onto the good stuff. The quickest way to get up and running is to head on over to and follow the installation and setup instructions written there. As you can see, we are closely tied to Bitbucket, and any code changes you make will be synced to your Bitbucket account. So, first go to to learn how to install and use the WebIDE. Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Sorry, the comment form is closed at this time.

Bald Wisdom » Blog Archive » Introducing Raspbery Pi à la mode Our first prototypes are back, and working quite well! SeeedStudio fabricated the prototype boards and quickly sourced the parts. The boards were of excellent quality. If you haven’t been following, Anool Mahidharia, Justin Shaw and I from the OSHW collaborative have been developing a stackable Arduino compatible for the Raspberry Pi. While there are lots of emerging examples of interfacing hardware to the Pi, it’s just not as easy as the Arduino, and the Arduino already has hundreds of libraries for interfacing with motors, sensors, and displays. Here are the features including a few extra goodies: Flexible power. We’re in limited Beta right now, but as soon as it’s thoroughly tested, we hope to produce them for sale as soon as we can! share