sourcery
Posts: 1
Joined: Thu Sep 22, 2011 7:55 am

Re: Raspberry PI with an arduino...

Thu Sep 22, 2011 11:14 am

The idea of the Raspberry PI is awesome... So is the idea of the Arduino. One problem I have found when doing things with the Arduino is interfacing with it... It is possible to buy a Ethernet Shield to it, but this small shield actually costs more that a Raspberry PI is hoped to cost (usually Ethernet shield costs $40+)

But with a PI it would be possible to use the serial interface of the Arduino to talk to the outside world...

So well, my thoughts are...
1. Using USB it would be possible to use the PI as an IDE platform for the Arduino (Linux version of the IDE exist).
2. Using the PI and some software from this page: http://www.arduino.cc/playgrou.....thSoftware
It would be possible to control the Arduino over the network through the PI, for $35 one would even get a WiFi version of the PI enabling even more possiblities for the combo...

Anyone with a PI and Arduino that could see what works and what does not? IE. Does the Linux build of the IDE run on the PI?

/Kristian (man... am I rambling today...:/ )

User avatar
TonyD
Posts: 447
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Raspberry PI with an arduino...

Fri Sep 23, 2011 10:40 am

Connecting the RPi to Arduino using either a USB or Ethernet interface might be an overkill. I would consider using either a serial/UART, SPI or I2C interface. Both devices have them and they are easier to use than USB or Ethernet.

Once connected, you could use the Arduino as a cheap digital and analog front end for the RPi.
Tony

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Raspberry PI with an arduino...

Fri Sep 23, 2011 1:34 pm

The r-pi has GPIOs right on the board so using an arduino might be overkill in general ;) Of course, they are only digital 3V3 inputs so for analog applications you would need adurino.

Also the serial connections are only for debugging, so not really an interface option :(
Dear forum: Play nice ;-)

MarkSmith
Posts: 29
Joined: Sat Sep 17, 2011 3:58 pm

Re: Raspberry PI with an arduino...

Sat Sep 24, 2011 7:58 am

The R-Pi should talk to the Arduino via the FDTI USB interface out of the box. As for the IDE, it should work once it has been recompiled, any real issues will be performance, which is not an R-Pi issue. The simple text based Arduino IDE sacrificed a lot of performance for portability. This will also be an issue for anybody using processing to talk to their projects.

While you can just connect a microcontroller straight to the R-Pi board, you lose out on the huge amount resources the Arduino has, even, dare I say it, a printed text books containing a structured course program.

The question is, do you need the microcontroller at all? A lot of the sensors used are 3.3v SPI/I2C and the only selling point to beginners (things which the experienced have forgotten) are the setup() and loop() wrappers and lack of fuse settings. With experience these things mean little, but when you are just starting out they are big hurdles that have been move out of your path.

Personally, I think that just as the Arduino took the mainstream hobbist/student embedded market from Microchip who took it from the parallax basic stamp. The R-PI will take this market from Arduino.

The only thing the that R-Pi needs to tweet toilet flushes is a float switch. That’s $25 + the switch and for the cost of a $1 USB Bluetooth adapter you can get rid of the Ethernet cable.

User avatar
winkleink
Forum Moderator
Forum Moderator
Posts: 279
Joined: Mon Nov 07, 2011 9:12 am
Location: UK
Contact: Website

Re: Raspberry PI with an arduino...

Tue Nov 15, 2011 2:55 pm

How about Nanode (http://nanode.eu) at the edge for input then async over Ethernet back to the Raspberry Pi. Could have multiple Nanodes working with a single Raspberry Pi.
For home automation the multiple I/Os on a Nanode means you can use 1 per room with just a network cable going back to the hub/switch.

Raspberry Pi running a small web server offering up pages to allow the controlling of the devices at the edge.

Data can then be recorded on the SD card or post to an external web server/service.

Using 2 British inventions at the same time.
Twitter:Winkleink
Google+: Winkleink

Nutmeat
Posts: 35
Joined: Tue Oct 18, 2011 2:36 pm

Re: Raspberry PI with an arduino...

Tue Nov 15, 2011 6:13 pm

Quote from winkleink on November 15, 2011, 14:55
...
Raspberry Pi running a small web server offering up pages to allow the controlling of the devices at the edge.
...
This is in the ballpark of a solution I've been mulling over. The following is not a professional opinion.

I get a warm fuzzy feeling when I think of an Arduino programmed as a finite state machine and just left alone to do its thing. From what I'm reading into the discussion here, applications where a user might, say, remotely turn on a light in a room could reasonably be run using the GPIO on the Raspi alone. I get that.

The finite state machine is a different application. Once your states are defined and your logic established, you should be able to just walk away from the machine and let the logic do its thing. Given robust hardware and locking out the ability to alter the logic of the finite state machine, you should have a reliable automation solution. Would you want all of the lights in the house to turn off due to a web server crash? Worse, would you want your toaster oven to stay on because of a bug, a crash, or network congestion?

If your FSM is being controlled by a separate, reliable board, you should be able to separate and thus mitigate at least some of this risk.

I agree that there is elegance in using the Raspi to pull data from an Arduino and safely monitoring and reporting on a finite state machine. I'm assuming, of course, that the Arduino is itself a realiable board. I have no experience to dictate if this is the case. I would really like to hear more on the subject.

th3b0y
Posts: 1
Joined: Fri Nov 04, 2011 3:53 am

Re: Raspberry PI with an arduino...

Wed Nov 16, 2011 6:57 am

I'm thinking of putting them to talk. I'm thinking of build a robot whose brain would be a raspi and the spine would be an arduino. The goal is learning more about eletronics and tha ARM arch.

fireraisr
Posts: 81
Joined: Wed Nov 23, 2011 2:34 am

Re: Raspberry PI with an arduino...

Thu Nov 24, 2011 3:16 am

This is an area I plan on pursuing. The raspi has a ton of processing power when compared to an arduino. While the arduino is easily interfaced to hardware.

I compete annually in the international robosub competition and most of the big teams (that get upwards of $200k in funding) use laptops or mini-itx boxes as their computing platform. The reason for this is the computer vision portion of the course, which requires a lot of processing power.

If the raspi could run opencv and merely communicate what it is seeing to the arduino, it would be extremely easy to have a robot in this competition for under $500.

My team accomplished this last year using a $200 android phone as the computer and the hurdles to get it working due to lack of solid dev examples and time to port libraries was a deal breaker. While we eventually had something in the water that had a small measure of maneuverability, the time wasted on developing the android app ultimately led to us not placing well. This was also compounded by the fact that we decided to enter the competition 8 weeks before it took place with nothing but our determination to start with.

There was a great amount of difficulty securing a programmer for the android OS due to it not being standard curriculum at most schools. The ability to program in c++ would have allowed us to draw from a much larger pool of computer science majors.

It's my hope to be able to utilize the raspi + arduino connected over basic usb to increase the functionality of last years submarine. The arduino will handle all of the motion for the bot and the raspi will handle computer vision + any other software needed (data logging?).

My team and I are very excited about the raspi project because low cost and off the shelf availability is our primary focus.

andywe
Posts: 44
Joined: Thu Dec 01, 2011 5:09 pm
Contact: Website

Re: Raspberry PI with an arduino...

Thu Dec 01, 2011 9:30 pm

Arduino is evolving rapidly .. new PIC32 and ARM Cortex M3 based Arduino format boards and ports of the Arduino IDE open up the possibility of developing quite powerful Arduino applications that communicate with RaspberryPi. Add in various forms of wireless communication - WiFi, Zigbee, Bluetooth, NFC as well as USB and Ethernet and all kinds of possibilities arise. Add in libraries supporting protocols that lend themselves to building and home automation and control such as BACS and KNX (open source implementation of both are available) and all kinds of interesting school level and undergraduate level project are possible.
If you are interested in digging deeper ... send me an email awe at ftt dot co dot uk, and / or chase me up to post replies to this forum.

linuxboi
Posts: 13
Joined: Sun Aug 28, 2011 11:12 pm

Re: Raspberry PI with an arduino...

Fri Dec 02, 2011 1:32 pm

The thing to remember is that the Arduino handles power spikes and shorts very well, if you get something wrong on the GPIO's on the Raspberry Pi then you will more than likely kill the board. So i think is a great way to program/interface your Arduino without having to use a power hungry laptop or desktop computer.

car.cuevas
Posts: 2
Joined: Tue Dec 13, 2011 3:04 pm

Re: Raspberry PI with an arduino...

Wed Dec 14, 2011 12:11 pm

I think it is very interesting what you are discussing here, I was thinking in the same thing. But in reality I was thinking in the use of the I2C bus, and actually I do not need to use the complete Arduino I would like to use just the ATmega328 and take the chance of the input/outputs, in fact maybe I will need to use more than one ATmega328 so I guess because of the MultiMaster Capabilities of I2C it will be ideal.

My problem is I do not know if there are some libraries or some way to control the I2C from the RPI using Python or something like this, another concern I am having, if it will be needed to have some kind of Optical Isolation for connecting the ATmegas or some I2C sensor to the RPI?

Thanks

j0z0r
Posts: 52
Joined: Fri Oct 28, 2011 5:46 pm

Re: Raspberry PI with an arduino...

Fri Dec 16, 2011 6:03 pm

Quote from Nutmeat on November 15, 2011, 18:13
I'm assuming, of course, that the Arduino is itself a realiable board. I have no experience to dictate if this is the case. I would really like to hear more on the subject.
The Arduino board is pretty reliable really. I regularly handle it while it's running projects and have never had a problem. It travels in my pocket most places, and I have yet to have any of the headers even bent. Also it's reliable in that it's not that easy to short and takes a wide array of input voltages (I think 5-12). Sometimes when wiring up a servo, I'll just poke wires into the headers until I get some movement outta the motor :)
It's pretty easy to get started too. With most dev environments, you gotta download at least two or three different things, then link them together. Arduino is really easy for beginners because it's so simple to upload a "sketch" and get rolling.

SeanD
Posts: 121
Joined: Wed Sep 21, 2011 12:25 am
Contact: Website

Re: Raspberry PI with an arduino...

Fri Dec 16, 2011 7:12 pm

I believe that Arduino as a platform and RPi are very complimentary and I can see many uses in education and for the hobbyist where an RPi and one or more Arduinos will be the ideal solution. @nutmeat is spot on describing the Arduino as capeable of being a finite state machine and @fireraisr extends that nicely with a brain-spine.

I see lots of possibilities here of which the top 3 are:

Using the RPi to run the Arduino IDE to develop, program and debug RPis via the FTDI USB interface
Using the Arduino as an intelligent and extensible buffer device/subsystem for an application running on the RPi, with a multitude of ways to connect them both fixed and wireless
Using the RPi to create a mater console or GUI interface for one or more Arduino based systems such ashome automation.

joep
Posts: 17
Joined: Sat Nov 26, 2011 4:27 pm

Re: Raspberry PI with an arduino...

Fri Dec 16, 2011 8:36 pm

I'm planning on building an remote procedure call system over the SPI so that for example one could simply issue a call on the RPi and execute functions on the Arduino to do things like set outputs, read the A/Ds, input buttons or keypads, etc. Multiple Arduinos could be attached and addressed.

Wooloomooloo
Posts: 92
Joined: Fri Nov 25, 2011 10:52 am

Re: Raspberry PI with an arduino...

Fri Dec 16, 2011 10:21 pm

Quote from linuxboi on December 2, 2011, 13:32
The thing to remember is that the Arduino handles power spikes and shorts very well, if you get something wrong on the GPIO's on the Raspberry Pi then you will more than likely kill the board. So i think is a great way to program/interface your Arduino without having to use a power hungry laptop or desktop computer.
Pardon me please for asking, but would you mind explaining a dumb commoner such as myself what exactly are those assertions based on? From where I'm standing, I see GPIO on a common Arduino board (the duemillanove) connected directly, unprotected, to the pin headers. Also, the datasheet of its controller (the ATmega328) says the absolute maximum voltages on IO range from -0.5V to Vcc+0.5V and absolute maximum current is 40mA (whatever that may mean in sink or source terms, only Atmel knows) - go outside any of those ranges, and you're liable to kill it just as nicely (except MCU do indeed not die from a surprising amount of stuff that "could" kill them. Yes, I know).

All of these are dead-on bog standard values for an MCU (I haven't seen the Pi's datasheet unfortunately but I wouldn't expect it to be radically different). Hence my state of utter discombobulation at the quoted statement. Could I get enlightened please?

Wooloomooloo
Posts: 92
Joined: Fri Nov 25, 2011 10:52 am

Re: Raspberry PI with an arduino...

Sat Dec 17, 2011 3:17 pm

To keep in line with the actual topic, here's an idea: one - if not the top - reason I'm interested in the RasPi is to use it as a standalone CNC controller (yes I do find lugging around a big honking PC - with a parallel port no less - possibly with a monitor and keyboard just to control a small desktop CNC machine rather unpractical; and if you intend to use your main PC for that while also doing something else, you're a very brave person). I know that Arduino-based independent controllers do exist, but for one, they definitely can't display current status graphically the way EMC2 does on a PC, and I have some doubts regarding the MCUs capabilities regarding stuff like advanced route planning and similar which would involve non-negligible amounts of non-trivial math calculations. All this while having to time pulses to control the axes, of course. Obviously, the extra oomph of the RasPi would come in quite handy here.

The thing is, I'm not quite sure how well the RasPi GPIO could handle said control impulse timing; it's true than on the PC, this is handled by EMC2 through equally low-level bit-banging, but only with the support of real-time Linux extensions. The RasPi would need the same to do this job, some sort of RTOS. And this is where the Arduino might come in: if it would turn out that doing both high-level and real-time stuff is just a bit too much for the RasPi, combining it with an Arduino might help, leaving them both to do what they do best - impulse generation for the Arduino, handling strategy, network connectivity and/or GUI/3D stuff for the RasPi.

It might turn out that an Arduino is not necessary at all mind you, I'm just saying I can't make that judgement right now...

andywe
Posts: 44
Joined: Thu Dec 01, 2011 5:09 pm
Contact: Website

Re: Raspberry PI with an arduino...

Tue Dec 27, 2011 9:12 pm

joep said:


I"m planning on building an remote procedure call system over the SPI so that for example one could simply issue a call on the RPi and execute functions on the Arduino to do things like set outputs, read the A/Ds, input buttons or keypads, etc. Multiple Arduinos could be attached and addressed.



I'd be very interested in finding out more about the approach / protocol you are planning to use ...

Is it going to be a true RPC system or a command - response protocol ?

Have you come across some moderately recent discussions about linking a whole lot of semi-intelligent servos together using SPI ... and then co-ordinating them to get some interesting robotic-arm behaviour ?

If only we could harness some of the GPU capabilities of the Broadcom chip as a compute engine ...

On a related topic ... its a real shame that Sony "took away" Linux from the PS3 !!!

Ianw
Posts: 46
Joined: Sun Dec 25, 2011 10:54 am

Re: Raspberry PI with an arduino...

Thu Jan 05, 2012 11:59 pm

I have used Arduino connected to a FriendlyARM ARM7 board (firewalled and SSL enabled web server) running over the FTDI using serial commands and can report it works very well. Theres no reason that RasPi and debian also wont work well - worst case is some of the libraries might need a native compile.

The advantage of the Arduino as an interface is the existing hardware support (e.g. dallas 1-wire devices, RF, IR, stepper motors, servos etc) in addition to the advantage that if PI needs a reboot it shouldnt affect the arduino and vice versa.

I have posted quite a bit of info about using a PC/ARM board and Arduino for home automation in the topic  http://www.raspberrypi.org/for.....automation

I like the arduino for its simplicity, thats not to say RPi cant deal with the IO side of things (I dont know the capabilities yet as I still have to get my claws on one!) , however I am more inclined to use the Arduino for the HW control (and the Raspi for the processor intensive tasks such as advanced logic/AI, GUI, Server etc. In much the same way I use my PC now to control the Arduino.

I think its a case of using what your familiar with ultimately! there are several ways of doing things and sometimes all of them can be right

To make things even more complex Arduino are releasing an arm based board as well (not sure of the specs)!

CookieMonster
Posts: 46
Joined: Tue Dec 27, 2011 12:05 am

Re: Raspberry PI with an arduino...

Sat Jan 07, 2012 1:20 am

joep said:


I"m planning on building an remote procedure call system over the SPI so that for example one could simply issue a call on the RPi and execute functions on the Arduino to do things like set outputs, read the A/Ds, input buttons or keypads, etc. Multiple Arduinos could be attached and addressed.


Like this: http://firmata.org/wiki/Main_Page  ?

Tyggerjai
Posts: 14
Joined: Sat Jan 07, 2012 2:22 am

Re: Raspberry PI with an arduino...

Sat Jan 07, 2012 2:30 am

Wooloomooloo said:


To keep in line with the actual topic, here"s an idea: one - if not the top - reason I"m interested in the RasPi is to use it as a standalone CNC controller (yes I do find lugging around a big honking PC - with a parallel port no less - possibly with a monitor and keyboard just to control a small desktop CNC machine rather unpractical; and if you intend to use your main PC for that while also doing something else, you"re a very brave person).


I'm planning a similar thing for a mini Motion Control system. Traditionally, theatre style automation systems have a central controller and then each axis has a separate axis controller to track limits, speed, etc. The arduino is perfect for individual axis control, but you need a master controller for any serious interaction between axes - control groups, etc. So having a Raspberry Pi that can take ethernet from a PC console, or USB from a joystick, or whatever, and then speak RS-485 (well, RS232 via a MAX485) to the arduinos is an excellent solution. Give it a mini graphic LCD and a few buttons for basic axis configuration, and you're away.

hkyguy7
Posts: 1
Joined: Tue Nov 01, 2011 11:54 pm

Re: Raspberry PI with an arduino...

Sat Jan 07, 2012 2:58 am

First of all hello to everyone as this is my first post.

Have been doing a lot of reading just not posting.

So I figured it's time to give my two cents worth.

I have been using an Arduino(along with a home built signal isolation interface) with a Sheevaplug for quite sometime now (two years +) and it runs flawlessly.

I use it as an Alarm system for my basement sump pump.

The Arduino just handles the hardware end of things and communicates serially to a Perl script on the Sheevaplug that handles sending alarm emails/text messages out, logging every time the motor turns on etc.

The system sends out weekly (or daily if you like) test emails that must be acknowledged to verify system operation.

It has multiple contact number capability and automatic switching between them.

The Sheevaplug also runs a Web Server that displays Alarm System logs, pit water level,  and configuration options are available as well through the Web Interface.

In addition the SheevaPlug also runs a a Samba Server acting as a Windows Primary Domain Controller, a Proxy Server, Mail Server and a few other Linux goodies.

So with any luck I will be doing all this on just the Pi.

Can't wait to get started.

tonyblews
Posts: 3
Joined: Thu Dec 01, 2011 3:41 pm
Contact: Website

Re: Raspberry PI with an arduino...

Mon Jan 09, 2012 1:11 am

I've been thinking about this for a while now. Currently I have an Arduino mounted inside an old 12" radio control Dalek toy. So far I've just sorted out motor contol and distance sensing. I stopped work on it when I found out about the RPi as I realised it was going nowhere for the moment.

My new plan is to use the Arduino just for the motor control/distance sensing, passing data back to the the RPi for processing etc. The RPi would also be handling a camera, wifi connection, sound generation and external interfaces (such as video out, wired ethernet and a usb port for a hub connecting a keyboard, mouse, pendrive etc).

Its a utterly pointless project, but that sums up most of my projects anyway.

Ianw
Posts: 46
Joined: Sun Dec 25, 2011 10:54 am

Re: Raspberry PI with an arduino...

Mon Jan 09, 2012 8:22 pm

Hi,

I found this useful article complete with C code for communicating with Arduino from bash

http://todbot.com/blog/2006/12.....o-arduino/

I tested it on SuSE 12.1 and works flawlessly for sending serial to an Arduino – if you are after a way to communicate via a web server on the Pi you can always run it as CGI

As it's C it should compile on the Rasberry Pi - build instructions are included in the code.

Hope this helps!

ChaosSystems
Posts: 5
Joined: Wed Dec 28, 2011 2:13 pm
Contact: Website

Re: Raspberry PI with an arduino...

Tue Jan 24, 2012 1:57 pm

Hi

I've created a VM version of the PI with 256M ram using Oracle VM Virtual Box and a Debian Business Card iso. The Arduino IDE uses Java and X11 to display so I loaded a simple interface LDXE. Once I'd installed Java and the gcc-var and avr-libc libraries, the IDE was good to go. See the Pi Tutorials on youTube. The video misses out the use of the apt-get -f install which you'll need to execute before loading the lxde, xorg and xserver-xorg-video-all.

The easy way to get java is to download the relevant .bin file using the wget command and dump it on /opt. Use export PATH=$PATH:your java install directory so that Java can be found. Test this with java -version at the command prompt.

Running the linux top command showed I still had 5M left in physical memory left to play with.

I also loaded Fritzing on the VM which also works great. This means the combination of the Pi and Arduino is complimentary.

Good luck

moorsb
Posts: 3
Joined: Fri Feb 14, 2014 2:57 pm

Re: Raspberry PI with an arduino...

Sun Feb 16, 2014 1:33 pm

I see the main use of these two as a system is to use the RPI as a interface to the Arduino. Let the Arduino handle the real world I/O and control say of a PID loop. The RPI would send set point to Arduino and read status using Modbus TCP. A Arduino nano with enc28j60 is cheap. As long as you do not put too much load on the cpu it can handle both task, or move up to the wiznet chipset at more cost and off load the comm task.

Return to “Other projects”