Offline
Newbie
Karma: 0
Posts: 1
|
 |
« on: July 18, 2012, 05:25:05 pm » |
been messing around with my arduinos for a few months, and i'm trying to think out a my next project using communication
Setup: 2 arduinos to communicate to 1 raspberry pi one arduino will be right next to the pi, the other will be 10-20 feet away from it. I would plan to connect using Cat5e
Data rate -not that much. Pi will just periodically poll for switch states on the arduinos / tell them to turn led's on.
I'm new to non-ethernet communication, I'm trying to sound out which communication standard would work the best / easiest, and looking if anyone has any recommendations
USB to Serial: Positives: this would be ideal if i could make it work, have the arduino's connected to the pi, and then able to communicate via usb to serial. Allows me to "update firmware" by using the IDE from the pi -Wouldn't have to worry about 5v vs 3.3 Cons: Not sure how easily compatible it is with 2 arduinos - a little bit more work playing w/ linux to recognize the ports. expandibility might be limited if i want to add more chips. -Not sure if the USB signal would carry that far.
direct into UART on pi: Cons: I think i'd need to "convert" the 5v to 3.3 to not blow up the pi. Question: Can i communicate to more than one chip? is there a library for that, or do wire software to set up one as a "master" and "poll" for responses continuously from the chips. Question: any thoughts on the signal traveling through 10-20 feet of cat5?
i2c: Pros: Easy expandibility in software if i increase the project Question: any thoughts on 10-20 feet of cat5? Question: any thoughts on the signal traveling through 10-20 feet of cat5?
Xbee: Pros: Easy expandibility in software if i increase the project Cons: prefer not to go wireless if i don't have to, increased cost / complexity
Anything else i'm missing? i don't know what i don't know.
thanks
xbee: would prefer to not have to go wireless, but could be an option
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 6
Posts: 1398
Arduino rocks
|
 |
« Reply #1 on: July 18, 2012, 07:46:18 pm » |
A somewhat cheaper wireless solution suitable for 20 feet is Bluetooth.
I2C is not recommended for distances longer than 1m (3 feet). UART (TTL serial) should be ok for 20 feet cables. Using the SoftwareSerial library, you can use any pin for Rx/Tx.
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
God Member
Karma: 9
Posts: 895
Twitter: @simonmonk2
|
 |
« Reply #2 on: July 20, 2012, 04:11:31 pm » |
Arduinos with Ethernet?
Though I think the USB is the neatest option. With 2 Arduinos connected to a USB hub, I'm not sure whether you would get to /dev/tty devices, or one device with 2 Arduinos talking on it.
Either way I would imagine its possible, if they share a serial connection I guess you would have to use IDs to see who sends / gets the message.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 2
|
 |
« Reply #3 on: August 15, 2012, 03:46:32 am » |
Have you considered RS-485? Looked into it myself for a project, its fairly easy to implement with the right driver chips (I can't remember which ones I decided on for my project I think it was MAX485s but I'll check on the weekend if you'd like), cable run can be up to about 1km (yep really!), allows multi point connection and can use twisted pair cabling. Covers everything you asked for I think  Have a look at this: http://arduino-direct.com/sunshop/index.php?l=product_detail&p=323
|
|
|
|
« Last Edit: August 15, 2012, 06:20:10 am by CyHamster »
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #4 on: August 15, 2012, 07:45:05 am » |
RS-485.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 18
|
 |
« Reply #5 on: August 15, 2012, 08:52:35 am » |
you could try apache2 and PHP on the raspberry and the arduinos in client mode, perhaps... you can take a look to an example of what i'm talking at here
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 3
Posts: 1713
|
 |
« Reply #6 on: August 15, 2012, 09:09:34 am » |
Regular ttl serial would be byfar easiest I would imagine, then you can still upload new code no problem if you bring over the reset line(Two pairs= (tx,rx,)&(reset,gnd)), you could even make a custom board or just perboard the atmega328's and run them 8Mhz 3.3v to save any level shifting, I've done it before, usually doesn't even need a crystal, all you really need is decoupling caps and you get two extra I/O, hardest part is chaanging the fuses for 8Mhz internal oscillator and loading the 8Mhz bootloader, which isn't bad once you know how and with a 328p@ < 4$ your entire remote board would be less than 5$ ea and is easier/cheaper to expand on
|
|
|
|
|
Logged
|
|
|
|
|
|