topamax once a day

Arduino on Raspberry Pi

Connecting an Arduino to a Raspberry Pi is simple. In a terminal, install the Arduino IDE:

sudo apt-get install arduino

This will take a while to download and install all of the dependencies. Once completed, you can start the IDE from the terminal:

arduino

Or, from the LXDE menu, Electronics->Arduino IDE. Note: This is IDE version 0018, and does not seem to recognize boards newer then the Duemilanove. Update: The IDE version in the package manager has been updated to version 1.01 and should work with newer boards like the Uno and Leonardo now as well.

The 1 amp power supply I have connected to my Raspberry Pi was not sufficient to power both the Pi and the Arduino through the USB port, so I connected the Arduino through a powered external USB hub. This may not be necessary with a larger power supply connected to the Pi. Update: A larger power supply will not overcome this limitation; the micro USB port on the Raspberry Pi is fused with 1100mA. –Thanks cavebeat

 

Alternatively, the 5V GPIO R_Pi Pin can be used to power the Arduino. Just connect the 5V GPIO pin on the Raspberry Pi to the VIN pin on the Arduino, and respectively GND from one board to the other.

 

This eliminates the need for the externally powered USB hub, but can make development more of a chore due to the USB port restriction: the keyboard and Arduino will need to be swapped in and out to flash the Arduino.

  • cavebeat

    micro USB from R-Pi is fused with 1100mA. a better power supply above 1A will not change anything. only a more stable 5V out.
    have you tried to power the arduino from the 5V GPIO R_Pi Pin? This should bypass the polyfuse, which is rated at 140mA per USB Port and causes a Voltage drop.

    • Thanks for the clarification and suggestion cavebeat! I was successful in using the 5V GPIO R_Pi Pin to power the Arduino, eliminating the need for the external powered USB hub!

  • What distribution are you running on the Rpi? I installed Arduino which opens, but loads and operates very slow and I cannot get it to recognize the Arduino. The Serial port option under ‘tools’ is greyed out. Any Advice?
    Thanks,
    Pete

    • The tutorial uses the most recent Raspbian (2012-08-16-wheezy-raspbian). The Arduino IDE does run a bit slow, but is fully functional. What kind of Arduino are you trying to connect? Are you powering it through a USB hub or via the 5V pin on the Raspberry Pi?

      • Thanks for your reply. I am trying to connect an Arduino Uno R3 (I have an older version as well, but it’s currently integrated into another project) via powered USB hub. I have also tried directly to the USB on the Pi.

        When I say the IDE is slow, I mean it takes almost 60 seconds for the IDE to load and the response time for drop down menus (file,tools, etc) can take 20-30 seconds. At that rate, I’d consider it unusable for uploading or modifying sketches to the Arduino. Is it that slow for you?

        • The IDE is definitely slow for me, although seemingly not quite as bad as your experience. The updated apt package (which updates the IDE to version 1.01) seemed to improve the responsiveness a bit at least, but I agree it is not particularly useful for any real development tasks. Maybe manual use of the avrdude command line tool would be a better option?

  • Hassan El Salamouni

    Thanks a lot! it worked very fine for me!

  • Pingback: Anonymous()

  • Doug

    I just did this download and I can launch the IDE in the lode only. My serial menu is also frayed out so I can’t upload a sketch. Any help making the serial menu appear?

  • Doug

    Sorry for the ipad spelling errors. I am using an r3 UNO.

  • Bill

    One of the first things I added to my Raspberry Pi was a powered 10-port USB hub. The one I bought from DX had a direct connection (no diode) between the USB host port power supply input and the external power adapter (it would even back feed the Pi powering it up via the USB port!). So I opened the cheap hub up and cut a trace so the Host (Raspberry Pi) provides zero power to the hub. Makes life so simple.

  • no rep

  • tuxun

    don’t forget, all the pi is on 2100mA fuse, this include the 5V line of P1 header

  • dgatwood

    This seems like a bad idea to me. The Arduino’s Vin pin goes to a linear regulator, and you would typically power those with a voltage higher than the desired output voltage (it varies from model to model, but IIRC the minimum for Vin is typically closer to 7 volts, not 5). I’d expect various aspects of the Arduino to misbehave if you drive Vin with 5V, because it won’t be getting the full 5V power supply that it expects.

    It’s probably safe to drive the 5V pin with clean 5V, as long as you don’t have anything hooked up to Vin.