Some networking fun: 28 arduinos linked in a network

I'm planning a project that will do 254 Arduinos over (theoretically) 300km

Solenoid released puffs of smoke from BBQ's ? It worked for the Souix !

Seriously though, has anyone modulated laser pointers? and what range is possible? Of course there would be environmental interference from rain and mist, but I have a specific project I want to test sometime.

Thanks for the responses.

Boffin1:
Some fairly inexpensive radio transceivers ( RFM22B or the SIM20 433 MHz, or the 2.4 GHz RFD21733 ) can be connected as a mesh with multiroutes, aknowledge, and autoresend.

I get 500m from the SIM20 outdoors, but it might be better using the 2.4 GHz does WiFi work OK in the factory ? its basically the same frequency.

A standard RF circuit will not work in the environment I plan to implement. Have you seen the inside of your standard cereal factory? Think of all the motors that drive the lines and multiply their HP by around 30-600 and you get what I'm working in. The factory manufactures puzzles so we have a large amount of motors and controls running an this will be the first arduino ever present in the factory. Almost all the systems there are industrial-grade PLC's from Allem Bradley or Mitsubishi.

PeterH:
What is the spreadsheet for? I mean, what calculations is it performing and what is being done with the results?

Although you've specified that the results must be displayed in a spreadsheet, use of a spreadsheet is a solution not a requirement; the fact you're also asking for 'live' updates make me suspect the spreadsheet is not actually suitable for you. What is the actual requirement here?

Do you want a tabular display of the counters in some order? Over some period? Any of that user-defined? Charts of the rate of change or absolute values over time? The real requirements will imply the most appropriate way to store and present the data, and it may not be a spreadsheet.

My dad wants it in spreadsheet because that's what his employees know how to manipulate. He wants it to be user friendly. I told him repeatedly that Spreadsheet isn't designed for this stuff, especially with it being live. I'm thinking I will have to make a web interface that the arduinos link into with actual live data rather than programming a batch file to reopen a spreadsheet file every 5 minutes. Just another thought, if I got a Mux shield linked to an arduino and connected that to the PC, would that be about ideal for something like this or would it be more of a hassle to do that? I'm thinking of how hard it will be to integrate all the connections from the different arduinos to one page.

Boffin1:
Seriously though, has anyone modulated laser pointers? and what range is possible? Of course there would be environmental interference from rain and mist, but I have a specific project I want to test sometime.

Lazer pointers have been modulated before with an extremely simple circuit containing an op-amp and an audio transformer connected to the lazer. I tried it with some success. It would have been better if I had an op-amp though. The range was fairly limited since I couldn't keep it aimed correctly for more than 10 minutes. I have heard of some people using small telescopes with a photoresistor/photodiode connected to the eyepiece. They would take a light bulb like you would find in a scrolling billboard with the light grids and turn it on and off with amps designed for speakers. They were successful at transmitting audio with a half-decent quality of sound.

And a side note, my dad is going by Radioshack to get an arduino for me to start learning. I already have a breadboard so no issues there.

A standard RF circuit will not work in the environment I plan to implement. Have you seen the inside of your standard cereal factory? Think of all the motors that drive the lines and multiply their HP by around 30-600 and you get what I'm working in. The factory manufactures puzzles so we have a large amount of motors and controls running an this will be the first arduino ever present in the factory. Almost all the systems there are industrial-grade PLC's from Allem Bradley or Mitsubishi.

Say what? What have you actually done to measure the RF noise in the factory? Most industrial motors are probably three phase squirrel cage induction types that may not produce much RF issues. What does the HP rating of a motor have to do with its potential RF production?

zoomkat:
Say what? What have you actually done to measure the RF noise in the factory? Most industrial motors are probably three phase squirrel cage induction types that may not produce much RF issues. What does the HP rating of a motor have to do with its potential RF production?

We have taken radios that are tuned to a good strong radio station and brought them inside the building and the signal degrades to the point you can barely hear the music over the static. My point is that radio won't work in there. There are too many metal structures in there that would block the radio signal. We would get into issues of the signal getting blocked by the 2-ton presses and all the other things in between.

Update: arduinos bought from Fry's Electronics and my dad is getting the ethernet shields from Radioshack.

Well if you write off wireless that only leave Ethernet and RS-485.


Rob

I don't know anything about RS-485 (will start to read on wikipedia now) but I wrote some info if you would go the Ethernet way:

Would it be possible to use ethernet network? To skip any type of radio completely?
Switches for this would be cheap if you can get them 2nd hand. 10 Mbps (10Base-T) switches are so obsolete than there only value are the raw materials they are made of. But 10 Mbps would be more than enough for a network where Arduinos sends small data packets to some central machine.
But don't use ethernet hubs (switches are not hubs). It won't create separate collision domains and regarding the size of the plant you might actually hit the wall there (I don't remember the exact numbers). And all packets would bounce around to all Arduinos.
The actual cabling perhaps should be done by a professional network installer.
And for when the deployment takes place perhaps you should buy the Arduino Ethernet (without PoE) which will save you some money (and you only need one interface card for programming them).

The sink for all data I think should be a PC. For ethernet it will be piece of cake as PC:s have the network interface or can be extended with more if you need. I don't have much knowledge at all about xBee but I saw interfaces for PCs via USB are available. Don't put an Arduino as data collector.

And if you are forced into that option I think the easiest way is to produce a .csv file (comma-separated values) that excel can load.

Regarding the programming, well it is a lot different from batch files, don't assume it will help you.

Edit:
Okay so RS-485 is preferable used as a bus network and over large distances can not have so much speed. And it will be large distance if all the machines would be hooked up on a single long line.

The ethernet idea I proposed is to get a good stock of ethernet switches and place them around the factory, connect the switches in a line and have a star topology of cables out to Arduinos in the vicinity of the switch.

If I had to roll up data from 200+ devices, I'd use a Redis database (http://redis.io) to receive and stage the data. Then it's easy to write small programs that can grab the data from the database and format it for spreadsheet and web display.

Any database would work, of course. But if you go the Ethernet route, you can use the (free) Bitlash Redis client to make the Arduino part of the problem very simple. Count pulses, report up the line to the server every N seconds. It's a couple of lines of Bitlash. This approach reduces the software problem to database reporting and format conversion.

Be sure to get a big bottle of aspirin for the practical problems that go with managing so many devices. Consider staging a small pilot project with just one arduino, and then scale it to a dozen machines before you rewire the whole factory...

-br

Redis: http://redis.io
Bitlash: http://bitlash.net
Bitlash redis client: bitlash/BitlashRedisClient.pde at master · billroy/bitlash · GitHub

You can use RS-485 with nodes daisy-chained, with that topology you get 4000' for each link. Normally however it is used as a bus so the 4000-5000' is a max, and that's at ~100kbps.

I know nothing about Ethernet so won't argue for or agin it, except to say that it has to be more expensive I would think.


Rob

No matter what transport system you use (Serial, Network, RF) there could be a lot of traffic (depends on switch frequency) and I worry your going to have either a lot of missed data or network collisions.

The most robust and extendible network for noisy environments is CAN, but it has a steep learning curve. It is an arbitrated, error-checking, asynchronous messaging system that runs at up to 1Mbit over km lengths. Messages normally are continuously resent until correct receipt is acknowledged. It is used in automobiles, earth moving equipment, medical devices, wheelchairs, aerospace. There is a "basic" CAN standard and a wide variety of higher-level overlays that while not easy to implement can provide even higher levels of protection. For example, in the most safety critical flavor of CANopen (think overhead load cranes or atomic submarines) both the message and its complement are sent so that, over and above CRC and so on, if these two don't match the message is rejected. But that's extreme; for most applications, even a wheelchair who's user can't jump out if there's a problem, basic CAN, properly implemented, is very reliable. If you're going to use your network to control machinery and if errors induced by factory noise might put people at risk, I would seriously consider learning CAN. If your network is only going to be monitoring information, then RS-485 or ethernet should be fine. Ciao, Lenny

Very intersting project. I hope you'll keep us updated :slight_smile:

My 2 cents worth of advice is about data collection: excel is going to prove a very limiting choice IMHO. You should plan for a data collection program to be run on a (possibly industrial type) pc with an ethernet port or a rs485 interface card, that would put the read values into a database.
A simple table with timestamp, sensor number and sensor value would probably be enough, at least at the beginning. From there on you have endless possibilities regarding graphs, averages, etc.

(I'm sure there are countless commercial packages that can do this already - haven't done any search yet - but as always it comes down to choosing the balance point between time-to-completion and DIY fun :wink: )

RyanF121:
Can I get a small list of pros and cons of each of the three connection types you posted?

RS-485
Least expensive. Assuming you use proper cables, you will be able to span the distance you mentioned (3132 feet) using a "low" baud rate. Differential signal provides a reasonable immunity to electrical noise. You are responsible for the on-wire signal. Need a CRC on that packet? You do it. Need a way of addressing nodes? You do it.

Ethernet
Most expensive. There is no way you can cover that distance without repeaters or using fiber optic cable. Differential signal provides a reasonable immunity to electrical noise. Ethernet controller is responsible for the on-wire signal.

CANBUS
A bit more than RS-485. Assuming you use proper cables, you will be able to span the distance you mentioned (3132 feet) using a "low" baud rate. Highly resistant to electrical noise and cable faults. CANBUS controller is responsible for the on-wire signal.

@LROBBINS' reply above is spot-on (with one exception: you can have high speed or long distance but not both).

If "CRC", "address", or "state machine" are unfamiliar terms, Ethernet or CANBUS are better choices unless you have the time and inclination to learn the gritty details about network protocols.

If you can afford it, fiber optic cable is usually a slightly better choice in a factory. All three can be made to work over fiber optic cable.

Thanks everyone. I have decided on ethernet. We already have a 24 port gigabit switch that we can mount in the ceiling of the center of the building. From there we can go the furthest distance the ethernet cables will go and then just use two wires from the arduino to the switch. Simple, right? I have been playing with some of the stuff at home with our apple time machine to connect the arduino to the LAN, but for some reason the computers don't recognize it as a web page even though I'm running the examples included in the arduino programming software. Is this due to the network collisions? Its using just 8' of cable right now. And one more issue, my 2nd arduino doesn't want to accept software. I select upload and the computer compiles the program and starts uploading but stops and this shows up:
avrdude: stk500_getsync(): not in sync: resp=0x00
Does anybody know how to fix this issue? I have re-installed the driver repeatedly but still cant get it to work.

I have just bought an e-book about the arduino. Up to this point I have been learning by reverse-engineering the code and haven't learnt much. Now that I have some literature to go by I might actually be able to learn this.

In the arduino IDE have you looked at Help > Getting started?

RyanF121:
for some reason the computers don't recognize it as a web page even though I'm running the examples included in the arduino programming software.

What do you mean by "computers don't recognize it as a web page"? Please explain what you're doing, in as much detail as possible. Are you trying to access the Arduino with a browser? Which browser? What URL are you entering? What happens on the screen - does the browser connect? Does it get an HTTP response back? Does the HTTP response include a page? Does the page render? If not, what is in the page source?

RyanF121:
Is this due to the network collisions?

No.

Do you have a proxy ? Is the browser configured to use it ? If yes, try to select "direct connection to internet". Ask the company sysadmin if you need help with these details.

PeterH:
What do you mean by "computers don't recognize it as a web page"? Please explain what you're doing, in as much detail as possible. Are you trying to access the Arduino with a browser? Which browser? What URL are you entering? What happens on the screen - does the browser connect? Does it get an HTTP response back? Does the HTTP response include a page? Does the page render? If not, what is in the page source?

I mean that the computer (a mac running google chrome)doesn't recognize it as being a valid address. I load the original example with the arduino software and change the IP address that it uses to 192.168.1.187. The shield flashes like it is connected to the network but when I enter the IP address in the browser it doesn't even act like it found a server on its IP.

tuxduino:
Do you have a proxy ? Is the browser configured to use it ? If yes, try to select "direct connection to internet". Ask the company sysadmin if you need help with these details.

There is no proxy around my house and our browsers work just fine although verrrrrrrrrrry slow due to the fact we live in the middle of nowhere. I am currently using an Apple Time Machine for the network switch, so no issues with LAN speed. I can't contact the sysadmin without looking like a seriously mentally ill child. Reason why? I am the sysadmin around the house. I would have to talk to myself. I already have enough issues related to aspergers and autism, the last thing I need is to be seen talking to myself.

"Please contact your system administrator"

I love that, it gets MS off the hook and tells me that I'm out of my depth :slight_smile:


Rob

RyanF121:
I mean that the computer (a mac running google chrome)doesn't recognize it as being a valid address. I load the original example with the arduino software and change the IP address that it uses to 192.168.1.187. The shield flashes like it is connected to the network but when I enter the IP address in the browser it doesn't even act like it found a server on its IP.

Exactly what URL are you entering in the browser's address field?