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.

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.

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.

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:

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 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 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.

Cookies on the element14 Community website

We use cookies to ensure that we give you the best experience on our website. If you continue to use the site without changing your settings, we'll assume that you are happy to receive all cookies on the site. You can find out more about cookies and how to manage your cookie settings at any time by clicking here.