Serial communication makes run other ardunio board

Hi everyone!

I'm making a system where I have a master arduino and maximum 4 slave arduinos. For the communication I'm using software serial, and it is working.
My problem is, the modules can turn on and off in different times. Whe the slaves finished its job, it is turning off, and some seconds later the master also. But till the master is running the slave device still runing.
I quess the Serial communication is giving enougt power to the other connected board(s) to make these runs.
Is there any way to avoid this issue? I'm thinking on an opto-isolation, but I'm not sure this is the easiest way.

Thanks!

Which Arduino boards are you using for the master and slaves ?

All arduinos are Pro Minis.

Just for information, when I say the modul turned off, I mean it turns of a relay what cuts the 230V from the power supply. To turn on the modul I'm using a wall switch to give him the 230v for a short time, and when the modul starts, it is turning on the power relay.
I was not 100% right, the slave board is not running, because in the setup block I set the output for the power relay, but this is not turning on, when only the master is running but the slave don't. But in the serial communication I still geting some bad vaules (from slave to master) when only the master runs. And some other devices are also half working, for exampe there is an I2C controlled 7 segment display, what starting to showing the last value (before the module turned off) with very low brightness. On the slaves in these time the normal VCC is not exist, the voltage is only coming on RX pins.

robotsyte:
All arduinos are Pro Minis.

Please post your code for the master and slaves

It will be interesting to see how you are using SoftwareSerial

Please be patient, the codes are not 100% finished (i.e.: I never tested how it's running with more than one slave boards).

Master.ino (14.1 KB)

Slave.ino (12.3 KB)

robotsyte:
Please be patient, the codes are not 100% finished (i.e.: I never tested how it's running with more than one slave boards).

You have posted two very long programs.

Perhaps you can write some short programs (perhaps 20 or 30 lines each) to illustrate the communication issue only.

A diagram showing how everything is connected also seems essential.

...R
Serial Input Basics - simple reliable non-blocking ways to receive data.

SoftwareSerial SlaveBoard1Connection(RXs[0], TXs[0]); // Rx, Tx
SoftwareSerial SlaveBoard2Connection(RXs[1], TXs[1]); // Rx, Tx
SoftwareSerial SlaveBoard3Connection(RXs[2], TXs[2]); // Rx, Tx
SoftwareSerial SlaveBoard4Connection(RXs[3], TXs[3]); // Rx, Tx

You are trying to use 4 instances of SofttwareSerial on the same Arduino

I have never seen a successful use of even 2, let alone 4 even using the listen() function

Robin2:
You have posted two very long programs.

Thanks for your aswer.
For sure I can make easier programs to check the communication issue. But I've no communication issue at the moment. My problem is, when some voltage is arriving on a DI pin on the slave device it's starts to doing something, not a normal run, but some display has enought voltage to showing the last stored value with small brightness.
Easy solution is to use optocouplre, but not for Serial communication. That is my real question. Is that normal, that the voltage what arrives to a DI pin can goes trought the controller and light on some leds and others?

UKHeliBob:

SoftwareSerial SlaveBoard1Connection(RXs[0], TXs[0]); // Rx, Tx

SoftwareSerial SlaveBoard2Connection(RXs[1], TXs[1]); // Rx, Tx
SoftwareSerial SlaveBoard3Connection(RXs[2], TXs[2]); // Rx, Tx
SoftwareSerial SlaveBoard4Connection(RXs[3], TXs[3]); // Rx, Tx



You are trying to use 4 instances of SofttwareSerial on the same Arduino

I have never seen a successful use of even 2, let alone 4 even using the listen() function

What other solution you prefer, for this combination what I have. I was thinking on I2C but the distance between a master and a slave board can be 10-15m.

Thanks!

Robin2:
A diagram showing how everything is connected also seems essential.

Here are two wire diagramm, about the connections. I hope this helps :slight_smile:

robotsyte:
For sure I can make easier programs to check the communication issue. But I've no communication issue at the moment. My problem is, when some voltage is arriving on a DI pin on the slave device it's starts to doing something

It would make it much easier to deal with that if the programs are short. Someone may even be prepared to reproduce your problem.

And I suspect there are also a lot of connections in your schematics that are irrelevant to the problem.

When trying to diagnose a problem I always find it best to make things as simple as possible - especially when seeking advice from people who are not as familiar with your project as you are.

...R

What other solution you prefer, for this combination what I have. I was thinking on I2C but the distance between a master and a slave board can be 10-15m.

That distance would be a challenge for TTL serial comms unless the cables were shielded

How about a wireless solution ?
Are you stuck with using Pro Minis or can you change to say ESP32s ?

Robin2:
It would make it much easier to deal with that if the programs are short. Someone may even be prepared to reproduce your problem.

...R

Yes you are right!
Later I will make some better diagramm for example.

UKHeliBob:
That distance would be a challenge for TTL serial comms unless the cables were shielded

How about a wireless solution ?
Are you stuck with using Pro Minis or can you change to say ESP32s ?

I'm using (LI-Y(ST)Y) 6x0,22 mm2.
The reasone that I'm using wired connection, that I don't want to have power all the time on the panels. With wires, the panels can "wake up" each others. I'm not a familiar to have some home made electricity run all the time when it need's to run you less than 10 times per day and each run is around 1min. I'm a bit scare about a fire maybe.
Just for you to know what is my project:
I want to make a hot water circualtion in my house. This circulation is only starting when you need hot water to wash your hand or something. First I will push a switch on the wall. This starts the slave modul, what starts the master modul in the basement. The slave modul measure the temperature in the pipe, inside of the bathroom for example. And the master board starts the water pump and open the valve. And I would like to make the circulation circle paralell (kitchen, 1-2 bathroom etc). When one asking for hot water the master opens it's valve and close the others. Starts the pump.....
So these modules will be inside of the bathroom furniture, and I'm afraid about fire if the cheep powersupply has power on it all the time.

First I will push a switch on the wall. This starts the slave modul,

As you have power available why not leave the slaves powered up ?

UKHeliBob:
As you have power available why not leave the slaves powered up ?

It is working like this. I've to push the switch just till the modul starts up. And the modul switch a relay. When the modul finish it's job, switch this relay back. This raley connect the 230V to the powersupply.

robotsyte:
and I'm afraid about fire if the cheep powersupply has power on it all the time.

Isn't the simple solution to buy a good quality power supply that you will have confidence in.

...R

Yes that is right too. But it does not solve the main problem.

Just a thought that may help ...

Serial idles HIGH. So the Rx pin of any Arduino will normally see a HIGH from the Tx pin of the corresponding Arduino. That is probably why one Arduino is powering the other through the Serial line.

An alternative is to fit a diode at the Tx pin oriented so that the HIGH cannot reach the Rx pin of the other Arduino. Also fit an external pullup resistor to the Rx pin. Then the power from the Tx cannot reach the Rx but the Tx can pull the Rx low when data needs to be transmitted.

R2-multiTX.jpg

...R