I'm totally new to Arduino but have a project that i want to do that involves 5 to 7 units in an network
so for example an input on unit 1 can control outputs on unit 3 an unit 7. I will only use switches to control the outputs that will only control relays. Anybody out there that has done anything like this?
Your explanation is not very clear. Do you have one Arduino that you want to connect to 5 to 7 other Arduinos?
If so how far appart are these?
There are many ways to connect Arduinos together:-
Serial
I2C
SPI
Direct connection with output pins.
The best answer depends on what you want to do and how far appart they are.
Also a common beginners mistake is to think they need more Arduinos just for more pins. Running longer wires and port expansion chips are often much easier.
The word network implies that any of the Arduinos can talk to any other, is this true?
How far apart are the Arduino units?
What are you going to use for power for the controllers?
Do you need communication in both directions or just one?
Sorry for a bad explanation, I have today a bus system (about 10 years old) in my 30 foot boat that starts to fall apart. These units are connected via a bus so I only want one new cable between these 7 units because at each point all input and output cables are already in place wich would make the hardware installation simple if it possible to connect the Airduino's in a network.
I would be wary of the quality of a cable if the boat operates in salt-water, or, indeed, if the cable has been seriously exposed to fresh water, including condensation.
If the cable is in good condition and is of suitable quality maybe RS485 could be used for communication.
You have not told us what the Arduinos will be used for - will any of them have a safety-critical role?
And is the boat is constructed of grp or metal? Wireless communication would be an option in a grp boat.
captainevil60,
you say the bus is falling apart, but that means a replacement of the bus would be in order.
With a new bus will your existing controls work perfect ?
Or is the failing of the parts the problem ?
also, having 7 or so controllers in a ship is not a big deal, but the first thing I would want to know is what is the existing bus ?
if you have a CAN bus, then you might want to have the new Arduino's communiate in CAN
if you can run a whole new wire, then you can pick what you want to use for the Arduino's to communicate.
There are many choices and each has benefits.
If you have 7 controllers, then each has a specific task. to replace any one controller would require that the current task be defined, evaluated for your needs, expanded if more functions are needed, higher accuracy things incorporated into that device.
As a note, the Arduino is a Micro-Controller, by itself it does nothing. It needs sensors or things to connect to the outside.
a simple wire touching another wire can be a switch. A particulate sensor can make it detect water quality. So the sensors are the key in any implementation. to replace each existing controller will be a small project by itself.
All this is possible, but at this time, there is much we do not know.
Please help us focus on the important task you want to accomplish. Give us a better description of what you have and what you want to accomplish.
I want to throw out my old bus system because it's old and spareparts if I can get them are very expensive. I want to build an Arduino system because of flexibility and price. My system shall in princip consist of the following modules:
No:1 – distance to No:2 about 10 feet
8 – Outputs that can control relays
No:2 – distance to No:3 about 6 feet
12 – Inputs controlled by switches
11 – Outputs that can control relays
No:3 – distance to No:4 about 12 feet
7 – Inputs controlled by switches
8 – Outputs that can control relays
No:4 – distance to No:5 about 8 feet
12 – Inputs controlled by switches
8 – Outputs that can control relays
No:5 – distance to No:6 about 12 feet
8 – Inputs controlled by switches
12 – Outputs that can control relays
No:6
2– Inputs controlled by switches
6 – Outputs that can control relays
Because inputs on for example on module 2 can control output's on module 1, 2 and 5 i need
to connect all modules in some sort of network.
captainevil60:
I want to throw out my old bus system because it's old and spareparts if I can get them are very expensive. I want to build an Arduino system because of flexibility and price. My system shall in princip consist of the following modules:
Does that mean that you do not plan to use any parts (or wiring) from the existing system?
And please read back over this Thread and answer the other questions so we have a good concept of what you are trying to achieve.
The old system comes from EmpireBus a Swedish company now owned by Garmin. https://www.empirbus.com/ but you will not see my old system there.
From my old system I will keep input switches (including cables), output cables and power distribution cables. the only new cables will be the "network cable" linking the Arduino modules togheter.
The challenge is building a high reliability switching system that can survive 100% humidity, engine vibration, short circuit conditions and provides feedback to confirm that outputs are properly energized. For example, if you turn on the navigation lights then you need to know with absolute certainty that they are truly on. If a circuit breaker has popped then the system must automatically alert you.
Forget any hardware that you find on Ebay, or Aliexpress. You need to buy UL rated components, not fake components with UL markings. All wiring needs to be multi strand tinned copper. All electronics needs to be conformally coated or potted. All connectors need O ring seals. Every circuit needs to be protected by a resettable breaker. Once you start adding up the cost you will understand why the commercial systems are so expensive.
For such a project, I would make two or three units, both with the switches
Then make them work on the bench.
A waterproof enclosure to hold the bits for the logic and switches, a second with just the relays.
Assuming that each box has 8 switches and 8 relays gives a starting point
Wire them up and then try them out for function.
Once you are set on the project, have a PCB made and then get the parts to stuff them
none of this is very hard and if mikb55 is correct about the networking not being too hard, then this project might be something you can make without any major road blocks.
at some point you will need to draw out each control box and label the inputs (switches) and outputs (relays and LEDs)
I thing we would all agree that such a set of drawings should be done very early, actually some would have expected it already.
Since you get 10 PCBs when you order, I would make at least one extra and keep it ready for the replacement in high seas.
As has been pointed out, you want to make them waterproof. But as anyone who has been on a boat for very long, it is not so much making them water proof but how to repair after the water gets in.
dave-in-nj:
As has been pointed out, you want to make them waterproof. But as anyone who has been on a boat for very long, it is not so much making them water proof but how to repair after the water gets in.
Being on a fresh-water boat as I type this and having previously had a sea-going sailboat I reckon keeping things dry is more important than making individual parts waterprooof. Either put them in a waterproof container (with waterproof glands as appropriate) or mount them "indoors" where they won't get wet. If a rogue wave takes away the cabin I doubt if the electrical system will be of much use, even if it worked.
Dealing with vibration may be a bigger challenge than dealing with moisture.
And a system that is easy to repair with available spares is important.
If the whole system was for my own use I would be content with lower standards (and lower cost) than I would expect from commercial products. The important thing is to spend enough time identifying failure modes, consequences and the ease of repair in the circumstances where the failure is likely to occur.
The other critical thing that we have not been told is whether, or to what extent, the systems will be responsible for safety. For example losing the ability to navigate at night in a storm would not be acceptable - even if a spare part was available.
I'd be inclined to make all modules the same so that they and some spares are interchangeable. You could use an extra switch to put the board in program mode where it reads the other switches to determine which module it's supposed to be and then write that information to EEPROM.
I'd expect that the data for each module's switches and which outputs they control could be put in a table (in progmem if necessary) and the amount of code required for running any module from that data would be relatively small. The only complication is the networking protocol, but even that can be made relatively simple.
Thank you all for your input now I know that I can do it with Arduino. When it comes to the hardware, vibrations moisture etc. I don't see any major problem I haver been working with Electronics over 45 years and with boat electronic for about 30 years.