Go Down

Topic: Interface with Raspberry Pi (Read 3186 times) previous topic - next topic

hamiljf

It looks like the Raspberry Pi and the Arduino complement each other very well.  Has anyone defined the 'best' way to connect the two ?  Is there scope for a topic in the Playground ?

pylon

There is no best way, the best way depends on the problem to be solved. Sometimes a connection over the UART is best, sometimes it's I2C or maybe SPI, in some cases connecting a few GPIOs is much better.

bperrybap

Do some searches for firmata.
It allows a host to manipulate the Arduino pins as well as read their inputs.
There are packages/libraries out there for languages like python as well as a few others
to make it quite easy.

When using firmata you can connect to the Pi using USB so you don't have to mess with
any connections to the i/o connector or have any 3v worries.

If you want to go the Firmata route, the Teensy (http://www.pjrc.com/teensy/)  makes
a great external i/o interface for the Pi since it uses native USB which is fast and
won't suffer character loss like the standard Arduinos which use a USB to serial chip.

--- bill


I want to have a raspberry pi run a webserver with php to and communicate to the arduino via usb. I have the arduino powering some tlc5940 driver chips and they are powered by an ATX power supply.

I am not able to use the usb serial monitor to my laptop when it is powered by the atx power supply (seperate grounds i'm assuming). Will I have any issues if the usb is plugged into the PI, like it does with my laptop?

pylon

Describe the wiring of your Arduino, I guess there has the problem to be located. Usually the serial monitor should work even if it's powered externally. You cannot expect the serial connection to work with the PI if it won't work with your laptop.

The TLC5940's and arduino are powered off a computer power supply. Whenever I introduce the usb just as a serial monitor everything shuts down, if I unplug it ever thing comes back on. I'm assuming it is because of introducing an additional ground to the circuit.

pylon

Quote
The TLC5940's and arduino are powered off a computer power supply.


That computer power supply probably delivers 5V and 12V. Which one are you using and to which connector do you have it connected? That's what I mean by wiring: describe every wire going to or from the Arduino. Tell us which pin/connector you use on the Arduino and where it goes to. Connecting multiple grounds usually isn't a problem. So it must be somewhere else.

Circuit taken from here http://arduino.cc/forum/index.php/topic,17106.0.html tlc's are powered by the 5v. V1 is also 5v. 12v going to V2 and the arduino.


This is what I want to control with the raspberry pi webserver

http://www.youtube.com/embed/kwIKgy6EBoQ

oric_dan

#9
Jan 30, 2013, 07:31 pm Last Edit: Jan 30, 2013, 09:29 pm by oric_dan Reason: 1
The r.Pi I/O pins are 3.3V only and can supply only 5 mA of current. You cannot connect
them directly to Rx,Tx, I2C, or SPI on 5V Arduino boards.

One of the books shows using a USB cable between r.Pi and Arduino as the easiest interface.
It says the r.Pi can supply at least enough current [50 mA] to run the Arduino, as long as
there are no significant loads on the Arduino pins. The r.Pi itself is a current hog, 700 mA or
so, and the on board power ckts cannot supply very much current to anything connected to it.

holmes4

The PC's USB port is good 500mA your TLC5940 can use more than tht when driving 16 LEDs.

Mark

Go Up