Best way to power nano and relay?



  • Hello , i have a relay actuator connected to an arduino nano (powered by it's 5V pin) .
    When the nano is itself powered through it's usb mini connector by a small USB cable plugged into

    • a computer USB port...the relay does not work.

    • A 3 ports 5V 3A USB power adapter ...the relay does not work.
      (tested with 2 such adapters). for instance:

    https://www.amazon.fr/Chargeur-Universel-Adaptateur-Appareils-Portable/dp/B07DHFK73L/ref=sr_1_5?adgrpid=1360096819685179&hvadid=85006309617600&hvbmt=be&hvdev=c&hvlocphy=126943&hvnetw=o&hvqmt=e&hvtargid=kwd-85006576704758%3Aloc-66&hydadcr=16624_1866009&keywords=usb+chargeur+3+ports&qid=1642868249&sr=8-5

    • A 1 port 5V 3A USB power adapter of another brand ... the relay works (clicking the switch in domoticz , triggers the relay) most of the time but not all the time.

    So i'm wondering what is the correct way to power the arduino&relay so that it works all the time? why it does not always work even powered by standard 5v 3a usb power adapters ?

    Controller side, i tested it with domoticz on raspberry with mysensors usb gateway.
    thanks in advance.



  • Are you sure the messages are received by the node?
    I don't assume the relay uses that much power. Do you have more specifications and a wiring diagram?



  • Well, it can only be a problem of powering given that for one of my USB power devices everything works fine most of the time. The wiring diagram is completely defined by what i specified: exactly what you have here
    https://www.mysensors.org/build/relay
    except i use the 5V pin of a nano arduino to the Vcc of the relay...and that the nano is powered through it's usb connector.

    I intend to do some tests with a breadboard to see if it works better when the relay is powered directly instead of through the arduino ... as i'v seen such advice somewhere else on the web...
    somewhere else people were talking about reducing the power of the RF24 (MY_RF24_PA_LEVEL ) in Myconfig.h ...(?)



  • Is your relay coil connected directly to Arduino pin?
    It draws too much current, this needs to be powered through transistor or use ready made module:
    https://thesolaruniverse.files.wordpress.com/2020/10/079_relay_fig_01_96_dpi.png



  • @fhenryco
    I have employed that exact same circuit with an an nRF24 radio in four places to turn on pumps. I power the Nano's through the USB with very cheap USB power adapter (less than 250mA@5V). When I had problems like you describe, it was the relay that had failed. These have been running for three years, in enclosures, outdoors.

    The most common failure comes from switching too high of a current and the contacts fuse together. Again from too much current, the arcing caused a carbon build up on the contacts making the contact unreliable.

    Because of your reference, I assume that you are using the relay board and that is what has failed.

    The Nano will not drive the coil of a relay directly. I agree with @iguaan. That is why one uses the module: all the transistors, etc. are already built up for you.

    Signaling the Nano with nRF24 radios is another rabbit hole. The radios being too close (<10cm) to each other could be the problem and reducing the antenna power may help.

    I found that how you configure the software is very important. What I ended up doing was having a master control the flow of communication. That is, the master would send out a message to only one device and wait for the device to respond. Often the node would not respond (node did not receive message or master did not receive response) requiring the master to resend the message. The libraries should handle this, but seem to be insufficient. This is @electrik 's question. As an experiment, connect an LED in place of the relay.

    Yes, I have had other problems, but they were usually the connector coming off the relay board or incorrect wiring. The only time the Nano was defective was after I had shorted the +5V to GND. (oops)

    Keep at it, you'll get it to work.



  • @OldSurferDude

    Thank you for your comments.
    Indeed i'm using the relay module so in principle i avoid problems and it should be fine.



  • i tested that if the relay is powered directly and not through the aduino and for all my usb chargers, the switch is 100% responding. dont know really why but it seems better.


Log in to reply
 

Suggested Topics

  • 87
  • 7
  • 6
  • 2
  • 5
  • 5

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts