Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Best way to power nano and relay?

Best way to power nano and relay?

Scheduled Pinned Locked Moved Hardware
7 Posts 4 Posters 107 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • fhenrycoF Offline
    fhenrycoF Offline
    fhenryco
    wrote on last edited by fhenryco
    #1

    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.

    1 Reply Last reply
    0
    • electrikE Offline
      electrikE Offline
      electrik
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • fhenrycoF Offline
        fhenrycoF Offline
        fhenryco
        wrote on last edited by
        #3

        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 ...(?)

        OldSurferDudeO 1 Reply Last reply
        0
        • I Offline
          I Offline
          iguaan
          wrote on last edited by iguaan
          #4

          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

          1 Reply Last reply
          0
          • fhenrycoF fhenryco

            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 ...(?)

            OldSurferDudeO Offline
            OldSurferDudeO Offline
            OldSurferDude
            wrote on last edited by
            #5

            @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.

            fhenrycoF 1 Reply Last reply
            0
            • OldSurferDudeO OldSurferDude

              @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.

              fhenrycoF Offline
              fhenrycoF Offline
              fhenryco
              wrote on last edited by fhenryco
              #6

              @OldSurferDude

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

              1 Reply Last reply
              0
              • fhenrycoF Offline
                fhenrycoF Offline
                fhenryco
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                23

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular