Anyone help with 4 relays please?
-
Good day everyone,
in case someone faces the same issues I did:- controlling multiple relays from one arduino and sharing the same power (powering relay board from Arduino
or - controlling relay which switches high loads circuit causing connected LCD to show garbage and again powering the relay from Arduino...
...the solution proposed above is the only one which helps - provide separated power supply for the relay boards. Once this is done with an extra little bucket power source for 5V (3W) all the issues with relays not working, domoticz not switching relays, LCD going crazy - all solved. I should have done this long before.
Thanks everyone!
P.S. For those, who still do not follow, the relay boards for Arduino contain extra jumper connecting VCC and JD-VCC (plus sometimes extra GND pin). So remove the jumper and connect the standalone, not common sharing 5V power source to this extra JD-VCC and GND (or GND near the IN1 pin) and disconnect the GND from Arduino and then you have a full optosiolation and then there are no interferences and other garbage breaking the Arduino functionality by switching relays coils. (also explained here: https://forum.arduino.cc/index.php?topic=470134.0)
- controlling multiple relays from one arduino and sharing the same power (powering relay board from Arduino
-
If this really solves the problem...would have saved me a lot of headaches. Got rid of all my relay nodes in the meantime.
-
If this really solves the problem...would have saved me a lot of headaches. Got rid of all my relay nodes in the meantime.
@parachutesj I do say it does. I have about 50 nodes in my house, 15 relays or so, temperature sensors and some others. All the relays i power now with standalone little china made 5V, 3W adapters and as I sit now in my house I do switch on and off lights, turn on gate, control pumps in greenhouse, all works on the first tap. I am finally happy with my mysensors equipped domoticz, first after 2 years. It took my so long to just give it a try.
-
@parachutesj I do say it does. I have about 50 nodes in my house, 15 relays or so, temperature sensors and some others. All the relays i power now with standalone little china made 5V, 3W adapters and as I sit now in my house I do switch on and off lights, turn on gate, control pumps in greenhouse, all works on the first tap. I am finally happy with my mysensors equipped domoticz, first after 2 years. It took my so long to just give it a try.
@petr-nosek my problem was maily unrealiability. They worked for minutes or weeks and then stopped (or anything in between).
All other nodes work flawless.
Maybe give it a try at next project -
@gohan I have tried all kinds of things. I believe that the fact that I used watchdogs which checked the MySensors nodes every 8 seconds (or less) helped me to recover from relay failures so the nodes appeared to be functional, but only randomly. In real life it looked good when I started them. did several turn on and off and it worked. In 2-3 minutes I did try again, it worked for 2 out of 4 attempts and then it stopped responding. In another 20-30 seconds I did try again and then again it appeared to work - I believe it was thanks to the watchdogs recovering the frozen node after the relay peak caused them to stop working. But only a theory, I have no deeper knowledge to prove this.
-
@gohan Hmm, then I dare to say I have never seen such entry. I could see in the past (before I added second power supply for relay boards) many information about repeating last command and lately issues with sending gmail notifications (caused by securing gmail account) but I do not recall seeing an information about node restart and by that I mean even manual restarts I did by unplugging the node. But I guess you refer to watchdog driven from the controller - Domoticz Gateway. I was perhaps answering on another "watchdog" - a internal Arduino node code which monitors the Arduino internally and checks whether it is running and if not, then it restarts itself. I cant imagine a remote restart of a node which is not responding to commands, how could it react on a remote restart? I suppose it can work just in case the arduino works, only the node itself is somehow not reporting data or so, right?
-
@gohan OK, then this one I never saw in logs doing anything, or it perhaps actually never worked for me :)
-
I Know this is quite an old topic now but mine is working quite stable (for at least one day)
I noticed the sketch has
#define MY_RF24_PA_LEVEL RF24_PA_HIGH
If you are too close to the gateway or using a capacitor across the 3v rail on the NRF24L01 and switching quickly you really have no chance of it being stable. (or any of one these 3 things)
I have mine set to:-
#define MY_RF24_PA_LEVEL (RF24_PA_MIN)
and using a 5v to 3v NRF plugin module, search ebay for 'NRF24L01 Wireless RF Transceiver Socket Adapter Board 3.3v' -
come back in a year and let us know :-)
Well, I have only two single relay nodes left in my setup (lamps). They work good without issues, but need to mention that those are solid state.
-
Ah ok, good to know. I also spoke too soon....
Today they were unstable, I noticed that some of the on /off commands were not being recieved (small LED flash on the arduino) looked at the logs on domoricz they were fine, however the serial monitor on the arduino node confirmed they weren't always being seen.
Have changed the mysensors libraries on the node to be the same as the usb gateway and its all stable again.
next action will be to monitor the logs on the gateway, node and domoticz at the same timeI have one of those blue 4 relay units from ebay, the jumper has been removed so only the LED lights when i activate the channel.
-
I tried so much and never reproduced it. had a test setup with a 4 and 8–way relay switching every couple of seconds something. Guess what: after 10 days I gave up because it worked flawless. But then again under load it failed.
But everything except relays work very reliable. -
I tell you guys, I have about 10 nodes at home with relays, some switching lights, some doors, some 12 motors. All I had to do was to provide separate source to the relay from the source to the arduino. Since then, last 2 years I get 98% reliability.
-
With relays involved that usually means switching of higher current devices so I suggest that whether or not you use separate power supplies that you add capacitors everywhere.
Capacitors on the pro-mini or whatever device, the 5V/3.3V power supply and across the power input to the relay board.You will need to add more than one capacitor at each point. I suggest a good ceramic or electrolytic of 100uF or more for a little reserve and 10n or 100n (better both) to remove 'glitches' from the power lines. (All capacitors should be in parallel across the +/- DC terminals).
If you have access to an oscilliscope then it will be a great help in tracking this down. But switching of high powered loads or inductive loads can send emf pulses that get picked up by the wiring in your project, hence the need to add caps on all boards.
As soon as (or if) my gateway/controller combo becomes stable enough I will proceed with this sort of work and will share any findings with you all. But the above should help and is good practice to follow as the boards from China will only have the bare minimum components they need to work.
-
With relays involved that usually means switching of higher current devices so I suggest that whether or not you use separate power supplies that you add capacitors everywhere.
Capacitors on the pro-mini or whatever device, the 5V/3.3V power supply and across the power input to the relay board.You will need to add more than one capacitor at each point. I suggest a good ceramic or electrolytic of 100uF or more for a little reserve and 10n or 100n (better both) to remove 'glitches' from the power lines. (All capacitors should be in parallel across the +/- DC terminals).
If you have access to an oscilliscope then it will be a great help in tracking this down. But switching of high powered loads or inductive loads can send emf pulses that get picked up by the wiring in your project, hence the need to add caps on all boards.
As soon as (or if) my gateway/controller combo becomes stable enough I will proceed with this sort of work and will share any findings with you all. But the above should help and is good practice to follow as the boards from China will only have the bare minimum components they need to work.
@skywatch, thanks for the reply. I read about using capacitaators, but never in such a complex and straightforward way. I can surely try it as well and switch back to one power supply and see "the difference".
I look forward your tests and findings, if you can post them here. Is there any "formula" to calculate the capacitor values - when you say 100 uF or more - what can you propose as more and what is already too much?
Also when you say "good ceramic or electrolytic" - what do you refer to as "good"?
Basically if I read you well, it is the same as having the capacitors on NRF24 radio on + and GND to avoid issues with signal glitches?
Thanks again to take time to reply here. Really appreciate this kind of feedback! -
@skywatch, thanks for the reply. I read about using capacitaators, but never in such a complex and straightforward way. I can surely try it as well and switch back to one power supply and see "the difference".
I look forward your tests and findings, if you can post them here. Is there any "formula" to calculate the capacitor values - when you say 100 uF or more - what can you propose as more and what is already too much?
Also when you say "good ceramic or electrolytic" - what do you refer to as "good"?
Basically if I read you well, it is the same as having the capacitors on NRF24 radio on + and GND to avoid issues with signal glitches?
Thanks again to take time to reply here. Really appreciate this kind of feedback!@petr-nosek said in Anyone help with 4 relays please?:
Is there any "formula" to calculate the capacitor values - when you say 100 uF or more - what can you propose as more and what is already too much?
This can be trial and error as there is no critical value to calculate. Just make sure that you use the next available voltage above what you are using for power (i.e. 6.3V capacitor for 5V power supply ).... I think that once you get above 1000uF it will be dimishing returns and increasing cost/size as well.
Also when you say "good ceramic or electrolytic" - what do you refer to as "good"?
From a reputable electronics supplier like digikey, mouser, rs components, element14 etc - but preferably NOT from ebay, aliexpress etc.
Basically if I read you well, it is the same as having the capacitors on NRF24 radio on + and GND to avoid issues with signal glitches?
Thanks again to take time to reply here. Really appreciate this kind of feedback!Yes. The smaller capacitors will reduce any spike or impluse noise in the cables and the larger capacitor will act like a resevoir to give a little boost when needed as well as smoothing out any ripple from the DC power supply.
And speaking of which, get a really good power supply (again from a reputable seller). It may cost 2-3 times of the online junk, but you will have a good quality certified power supply that is safe to use.
-
I tell you guys, I have about 10 nodes at home with relays, some switching lights, some doors, some 12 motors. All I had to do was to provide separate source to the relay from the source to the arduino. Since then, last 2 years I get 98% reliability.
@petr-nosek
sure with the 2nd power supply it looks different. However mine were all in-wall and there is just not enough space for this.