Strange problem with relay board



  • Hello to all!
    I'm having a strange issue on a mysensors node.
    The setup is the follow:

    • arduino mini pro 5V
    • relay board with 4 relays
    • HC-SR501 motion sensor
    • nrf24l01+

    The arduino is powered via USB FT232 controller (actually, later via raw pin)
    The radio is powered via 662K voltage regulator.
    The motion sensor is powered via 5V arduino
    The relay board is powered via separate 12V to 5V via LM7805 and connected following the guide to opto isolation (https://arduino-info.wikispaces.com/RelayIsolation).
    The controller is a MQTT gateway.

    What happens is that after turning ON/OFF some times the relays, the comunication between the node and the gateway fails and connecting a PC to show the console via serial I can see that the node sends messages and they are in FAIL state.
    If I reset the board, it works until I reuse again some times the relay.
    If I don't use the relays I can see the messages from the motion sensor are sent without any issues.
    Seems the relay board is creating some troubles, but have no idea how and why. And don't know how to debug it.

    Ideas?

    Thanks a lot!

    Simon


  • Hero Member

    Hi Simon, are all the grounds connected together, or are the power supplies all completely separate? I would make sure you have a common ground? Also, do you have a capacitor on the radio power pins?

    Cheers
    Al



  • Hello!

    The ground is separate. Relay Board takes the ground from the 12V adapter, also Arduino and the Relay Board have their own ground not connected together.
    Yes, I have a 4 uF capacitor on the radio. Do you think I need to increase the capacitor? Seems like powering on/off the relays (only the led connected to the IN[1-4], the relays itself are powered via AC 12V) are creating a kind of disturb....
    If I can make some tests to give more informations, let me know 😉

    Thanks!
    Simon



  • Hi,

    I saw the same problem in the past.
    what is "The radio is powered via 662K voltage regulator."
    What do you mean by 662K?



  • Hello @Gefkuz,

    I mean I'm powering the radio via 5V from the Arduino Pro Mini but using the Voltage Regulator 662K to have the 3.3V needed power.
    Could be that the radio looses power when the relays are turned ON/OFF?

    Simon


  • Hero Member

    @xefil Hi Simon, I would make sure that you have one common ground. You could try a larger capacitor as well. Also, maybe post which specific relay board you are using. Which power supply is connected to the Raw and Gnd pins on the Arduino?

    Cheers
    Al



  • Hello @Sparkman,
    This is EXACTLY the board I'm using:

    http://www.aliexpress.com/item/Brand-New-5V-4-Channel-Relay-Module-for-Arduino-PIC-ARM-DSP-AVR-Raspberry-Pi/1899443885.html

    I've seen it has only one ground pin which is connected to the external power supply.
    So, the wires are connected as follow:

    Relay Board:
    [IN1-4] -> Arduino digital PINS
    [VCC] -> Arduino 5V
    [JD-VCC] -> External power supply 12V (via 7805 to obtain 5V)
    [GROUND] -> External power supply 12V ground

    The Arduino is actually powered on via the FT232 adapter then via USB on a 1A power supply.

    I've seen that, if I remove the JD-VCC the relays are not working as expected, but the leds on the relay board, that are showing if the relay is on/off are working correctly. I mean, if I dont give power to the JD-VCC the board is working well without issues. I can send then on/off via Openhab to the relays without problems. As soon I connect the JD-VCC and I use the same relay, it stops to work after one or two tries. Seems really that the relay, powering on, creates a disturb to the antenna that brings it to stop to work. I need to reset all and then it works again for one or two times.

    Any suggestion?

    Thanks, Simon



  • On my system, I replace the main alimentation by a litle biggest one. Since that, all worked well.
    Sorry for my English.



  • @xefil said:

    [IN1-4] -> Arduino digital PINS
    [VCC] -> Arduino 5V

    Hi. relay board need not be powered by Arduino, but from a separate power supply is 5 volts. if you eat more than 1 relay from Arduino he lacks the power to instruct the other relays, it affects his work.


  • Hero Member

    As I understand it is the radio which stops working. I had similar issues which in the end made me to move to solid state relays. A few possible causes : ESD caused by the coil in the relay (you can try to change the orientation of the relay with respect to the radio) ; powerline spikes (careful layout of ground wires: no loops, solid wire, isolated vcc's ; bad components ie : fake optoisolators on the relay board ; sensitive radio.

    Happy debugging 😉



  • Hello @vampircik and @AWI
    Thanks for the replies!
    I've ended adding a 220uF to the radio. This helps definetly to send the commands well. Then I've added this little hack to gain the range, posted somewhere in this forum as well:
    Cheap DIY NRF24L01 Antenna Modification – 02:48
    — Pete B

    Now seems MORE stable. Well, it happens that turning on the first relay, the arduino reboots (takes 3 secs) and then all the other relays are working well, the first relay too. Maybe some spikes in power?

    Simon



  • Adding some cap to the arduino itself could help, i.e. between 5V and gnd. I've been able to get rid of some reboots by doing that. Power supplies can output rather noisy outputs.



  • Hello @Nuubi
    Sorry, as written I'm not so proof with electronic but, on the other hand, as soon I get something to work, I'm happy like a kid with his new gift 🙂
    BTW, what do you mean exactly? I should solder some capacitor between 5V and GND? Directly on the Arduino? Which size in case?

    Thanks a lot!

    Simon



  • Oh well, it can be actually extremely complicated. But, basically, add a larger cap + a small one together. Larger one acts as a power reservoir and smaller one filters high voltage spikes. Basically like that, as I understand the situation. Large ones are in the range of micro Fs, smaller ones nano Fs.


  • Hero Member

    I had the same problem a few months ago.
    The problem solved powering the arduino from a different power supply.
    You can read a bout it here

    Node freezing up

    No more problems since


Log in to reply
 

Suggested Topics

  • 87
  • 6
  • 5
  • 10
  • 7
  • 8

12
Online

11.4k
Users

11.1k
Topics

112.7k
Posts