in your case I'd start of the playground on the arduino website, that's a good starting point. There are quite a few examples and you may also want to buy one of those simple shield with a lot of different hardware (I think it is called dangershield?!). If you want to get your hands dirty with I2C or SPI the BusPirate may be intersting for you, it's a good board to learn/understand how bus communication works.
It's probably also a good idea to learn a bit C, if you plan on working with hardware with the arduino or the R-Pi.
Hope I could help a bit
Julian mentioned the Bus Pirate if you're going to be messing with I2C or SPI, and I second that. It's a very cheap but highly useful little gadget. You can even use it as a very slow 'scope, lol. Here are some links for it:
Hi Morgaine, that is very interesting, thank you for the recommendation.
The elinux wiki is a good place to watch as information on interfacing progresses. This page indicates that right now the GPIO, SPI and I2C drivers are a work in progess:
Like many aspects of the project, I'm sure this will improve rapidly once boards start getting into more hands. Also on that page, there is an interesting example of memory-mapped GPIO:
I think we'll eventually see easy-to-use abstractions for interfacing like Matt Richardson has done for Python on the BeagleBone:
On the hardware side, I'm sure there will be plenty of interesting interface boards. I'm very excited to see how Adafruit's Pi Plates progress:
low-level driver support looks great... thumbs up
I built my own GPS board but has a separate microcontroller that can talk to sensors. The RPi and the MCU talks via serial connection through the onboard UART on the headers. So in essence, I can send a command to the MCU to grab sensor data. Something like root:>$GPS#LAT? root:>$LED1#ON? root:>$SENS#TEMP1? root:>$SERV#145? of course, the MCU would have to be programmed to grab sensor data continuously and respond to command received from its serial port that's just example. its better (at least for me with MCU experience) than messing around with Linux SPI/I2C kernel drivers. also makes it easier to interface with higher level applications like php/java/etc.
if anyone will be using the gpio ports directly (i.e., w/o an expansion board such as adafruit or gertboard) I strongly recommend that they use buffers as found on this page: http://elinux.org/RPi_Tutorial_EGHS:GPIO_Protection_Circuits.
The LED tutorial works for sure with the shell script previously mentioned.
Morgaine, I have taken your advice and bought a bus pirate with assorted leads (arrived yesterday) so those links will come in useful i'm sure :-)
Simon, I will be trying the wireless approach :-)
To followup months later , the I2C bus is a simple way to interface sensors that support it. I just wrote a post about interfacing the TMP102 temperaute sensor. It is aided by the fact that it is very similar to how computers monitor internal temperature, so the standard 'sensors' utility "just works" and will print the temperature.
I also have I2C accelerometer and magnetometer boards from SparkFun which I'm planning to interface in the future. These will probably take a bit more work as I don't believe there are any existing Linux utilities to read from them. But I don't think it should be too hard to port their Arduino librabies to something like Python on the Pi.
I also have a ton of analog sensors, so I was happy to see Adafruit's Raspberry Pi analog input tutorial which shows how to interface an external ADC with the Pi.
I also have I2C accelerometer and magnetometer boards from SparkFun which I'm planning to interface in the future. These will probably take a bit more work as I don't believe there are any existing Linux utilities to read from them.
It'll depend on exactly which accelerometer, but linux certainly has some drivers for i2c accelerometers. They're quite often used in laptops to detect that you've picked the laptop up off the desk, or have dropped it, and park the heads on the hard drive. Probably lots of android drivers too, so that they can detect when you turn the phone on its side and rotate the display.
A quick search reveals in-kernel drivers for
"MMA8450 - Freescale's 3-Axis, 8/12-bit Digital Accelerometer"
"Kionix KXTJ9 tri-axis digital accelerometer"
"Analog Devices ADXL34x Three-Axis Digital Accelerometer"
"VTI CMA3000 Tri-axis accelerometer"
"STMicroeletronics LIS3LV02Dx three-axis digital accelerometer"
as well as the WIIMOTE, Apple SMC and various others under staging/iio
I've used the LIS3LV02Dx one as my laptop has one..
Terrific. I believe I have an but will have to check tonight.
Sorry if this has been asked before
I have experience playing around with the Arduino platform and interfacing sensors such as temperature, pressure etc.
I would like to know how this would be possible with the PI. I have seen the 'Gert Board' and also the board produced by Ciseco here: http://shop.ciseco.co.uk/slice-of-pi/. Is it as simple as plugging in sensors (and of course the odd LED or two) to the general I/O pins mentioned in the description for the last item and writing some code to read / write to these (I'm hoping in Python?).
Would I do better to learn more about I2C and SPI to get the most of the Pi ( I have seen you can do this on the Arduino, but i'm somewhat a beginner so keeping it simple at the moment). If so, can anyone recommend a good primer on I2C and SPI for the Arduino?
Given the power differential of the Pi to the Arduino in terms of processing power I think this would be a great platform to work on for this type of exercise.
Thanks for any pointers.