What you can do when a Raspberry Pi teams up with an Arduino

We thought that connecting an Arduino to a Raspberry Pi was overkill, but one thing caught our attention. [Jan Stevens] mentions that the RPi is less expensive than the Ethernet Shield. Interesting. As we looked into his writeup a bit more we began to think he’s onto something. [Jan] uses the PHP serial class to communicate between the RPi and Arduino. This ends up being a very inexpensive way to bring some of the more powerful web programming options to your hardware devices.

Sure, he’s just driving three RGB LEDs. But the demo video after the break gives us a glimpse as some of the interface options that become available when an embedded Linux machine is in play. He’s using jQuery, AJAX, PHP, and JSON to name a few. If you want to give this a try yourself you can grab the code from his Github repo. Of course we’re going to want to hear about any projects you develop from this starting point!

Comments

  1. barbudor says:

    The TP-Link WR703N is even less expensive than a RPi. Once hacked with OpenWRT it can behave as a Wifi+Ethernet shield and more…

    • saulverde says:

      It’s also not a computer. The pi is upgradable.

      • Squonk42 says:

        It is not because it has video out that the RPi is a useable computer…

        And you can put OpenWRT on the TP-Link WR703N, so you get bleeding-edge package updates with opkg, too.

        For its low $23 price, the TP-Link WR703N has built-in 802.11n Wifi + working USB 2.0 port with the ability to drive a 3G dongle with 200/300 mA avg. and 2A peak current. So yes, it has a real, good efficient switching mode power supply vs. a cheap LDO heat radiator!

        Also it’s 1/2 size compared to RPi.

  2. Matt says:

    looks like an awesome starting point for some powerful home automation projects. can’t wait to see what people do with this.

  3. Tony says:

    Raspberry Pi & Arduino!!!!

    Squeeeeeeeeeeeee!!!!!! Squeeeeeeeeeeee!!!!!

  4. saulverde says:

    I plan on using my pi to trip an optically isolated relay board made for arduino projects. Turning the lights on and off with a 6$ relay board rather than using an arduino board and I can control mains power with it instead of LED’s.

  5. Leif says:

    I dunno… I get using a pi rather than an ethernet shield because it’s lest expensive. But.. once you have all the power of the raspberry then what is the point of the Arduino? Is it the pwm output? Is that a problem for the raspberry pi? If so can it be done with an i2c gpio chip?

    • AP says:

      This is what I was wondering as well.

    • Ac says:

      The Arduino has analog I/o pins, and each pin can handle way more current than the Pi GPIO. You can’t directly drive a relay with Pi pins. The Arduino is more limited in memory, but at least it is real time.

      These two devices together at far less overkill/redundant than people make it out to be. All depends on your goals.

      There’s a world of difference between Arduino Sketches and Python. I love Python, but Processing/Sketch has a big head start in terms of libraries.

      • R says:

        You can get I2C DACs/ADCs for a few bucks. A darlington driver array would be even less.
        The only point I’d agree on is real time applications, though I do wonder if a RasPi would achieve better performance most of the time anyway, given the difference in their clock rates.

  6. doronbc says:
  7. mofoq says:

    it might be cheaper than the official eth shield yes…but it’s not cheaper than a nanode or those ENC28J60 shields on ebay/etc.

    of course, the official shield has other limitations; it can’t do ipv6.
    the ENC28J60 based ones have a memory limit so it usually can only do one packet worth.

    • Elias says:

      Since you’ve mentioned the ENC28J60 modules, how hard would it be to interface them to another microcontroller, say, a ARM Cortex M3 STM32F103? On the hardware side it seems it will just require a SPI interface, but how hard is it to make it work on the software side? Are there some libraries ready for such? Decent free TCP/IP stacks?

  8. nothelpful says:

    I bought a Pi with the intention of using it for home automation / measurement and have made decent progress using a teensy running arduino code. At $19 it seems pretty good value.
    Rather than use the gpio pins though, I’m using serial (from php) to send instructions to the teensy, which seems less likely to damage the pi when I screw it up. Also has the advantage I can do all the development on my laptop then just move the hardware.

  9. Suresh says:

    Rpi can not only act as ethernet/wifi shield, but also provides sd card storage option. Ofcourse we can use rpi gpio pins, but arduino has whole world of shields/ sensor interfaces built around it which makes the dfference.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,095 other followers