Hello, i want to create a system that controls relays with buttons using arduino. I want to have 3 or more seperate boards at different locations which will be conected to the same LAN. For example the first arduino will have 4 relay outputs that can be controlled from all arduinos, the second has 4 other outputs etc.
I know how to do it using logo! but it is going to be expensive, so I am looking for alternatives.
Is it possible to create this project using arduino controllers with ethernet shields and relay modules?
Thanks
yes?
So i need to write code in order to:
1)create digital varibles to control the outputs etc..
2)send the changed variable over the network to the other arduinos
3)receive changed variables from the other arduinos
Right?
i think you're describing this in too much detail
i think you would need code to accept a message (IP) over the LAN containing commands to query the state of the relay(s), turn a specified relay on and off.
i think developing the code to receive an IP message is more involved than being able to turn on/off a relay
paulos_k:
So i need to write code in order to:
1)create digital varibles to control the outputs etc..
2)send the changed variable over the network to the other arduinos
3)receive changed variables from the other arduinosRight?
Have a look at the example on this site:
https://virtuino.com/index.php/virtuino-se/code-examples
Hopefully that should give you the kickstart you need!
the first link at the end of that page will give an example for very basic webserver how I do it:
https://werner.rothschopf.net/202001_arduino_webserver_post.htm
it will look like:
sorry for linking a German site, but that's my native language and I haven't found time to translate it so far.
The reasons why I think it is a far better solution than the IDE example or on the virtuino page:
- data is tranfered with POST (not GET)
- webserver sends http 404 pages if you request non existing pages
- it handles the browser favicon correct
- it avoids usage of Arduino-Strings
- it keeps the loop() tidy