Hi Guys,
I have this idea and therefore I would get two Arduino's to communicate with each other.
Both the intended Arduino's would have some output ports to control valves and other input ports are being used for temperature sensors. Well... That is the plan.
The distance between the two Arduino's would be about 20 meters.
This is all the info at hand.
Can this be done with some serial communication? I've heard people about RS485 protocols and such. The distance would be to great for i2c communication or SPI, so I was told.
There are ready to go prints on the market and even the wireless types, which are also an option.
All I want is the Master Arduino to monitor it's own sensor ports and the ones on the Slave's side and activate valves on it's own output port and on the output port of it's counterpart.
Both Arduino "spots" have their own power supply.
Afterwards, I'd like to get the data and the state of every valve posted on an MQTT server so I can monitor it on my smartphone.
But... In all fairness, I need to start with the question, which hardware is suitable for this?
What would one recommend? I have some knowlede of programming Arduino's but that is somewhat more than Basic. (I even might overestimate myself here )
@FTMZ
A couple of years ago, I helped a person do a similar project, where the states of the pins from one arduino were transferred to another. For communication, we used three different options - nrf24 radio, rs485 and Сan
as you require data upload using MQTT I would also recommed an ESP32 which has onboard WiFi, Bluetooth Classic (2.0) and BLE
inter controller communications impose significant complexity on a project
do you require two microcontrollers? how much IO do you require? give details
if you do go too two microcontrollers (e.g. if you have too much IO for one micro) I would recommend the slave having the sensors and transmitting the resultant data to the master which has the control algorithm to control the pumps, valves, etc and reporting information over MQTT
I guess on the slave side, I'd use about 5 or 6 sensors and 1 or 2 outputs to control valves and a PWM output to control a pump.
On the main (master) Arduino(?) site, I need about the same amount of sensors, and also 2 pumps, possibly PWM controlled. And an amount of 6 ports to control as many valves.
And a kind of display to determine the state of the valve, based on the steering signal, and some led indicators.
It would be a solution to use a external IO print, as the "slave" has got not much to do.
I'm not familiar with those electronics.
The distance between the two PCB's is about 20 meters.
a couple of ESP32 should be capable of supporting this project
remember the ESP32 uses 3.3V logic - if any of the devices use 5V logic use potential dividers or level converters to interface them
be careful how you power the devices
you could use ESP-NOW to transfer information from the slave to the master and then WiFi on the Master to upload to the cloud using MQTT - see esp32-esp-now-wi-fi-web-server
I've looked into some of the solutions and though I'm not convinced I can manage any one of them due to my lack of knowledge ;-), I still have doubts on how to implement those communication codes into the regular code of the arduino/ESP32.
Does that work with some kind of sub instruction which sends/receives every X ms to evaluate changed settings/incoming data?
if you have a couple of ESP32s try running some of the ESP_NOW example code - see File>Examples>ESP32>ESPnow
then attached some devices - transmit data between the ESP32s
I have some ESP01 modules. The ones with a relay along with it, so the relay can be controlled by Wifi, but I never managed to get that one to work eigter.
But are those PCB usable?
I bought this programmer and modified it according to the youtube instructions, but I do not recall even playing with it. A whole lot of projects in my head.
which programmer did you use - there are several? some easier to use than others
did you ever manage to program a ESP-01?
I use the LED blink program as a simple test of programmer and ESP-01
I guess I have a problem here now...
I thought to have this simple solution to steer my valves... In stead I encountered a heap of other -very interesting- topics I have to look into, to accomplish that goals.
And I have too much going on in my life to stack yet another project on top of that.
I will look into it, but not for the next couple of months.
I guess I have to arrange things with a long cable first, to steer those valves from over a distance of that 20 meters. They do not draw a lot of current, so I will manage, hopefully.
Programming a Arduino will not be the biggest issue.
Just to round up that question...
I have this Programmer:
if it is just control of valves a good multicore quality cable over 20 metres should be no problem
it is usually remote sensors which cause problems over long cables with signal loss, cable capacitance, noise etc
your programmer looks like this one
not as easy to use as some which have a switch to change from program to run mode
I use a ESP-01 Helper V3 which programs and runs the ESP-01 like a 'standard' ESP8266 - no switches, soldering wires, etc