Announcement

Collapse
No announcement yet.

Basic question on driving relays

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Basic question on driving relays

    So being new to this, I've found conflicting information on the output current of my Mega board which I want to use to drive a relay with.
    I have a relay board (4 relays) on and it works find. I also have a 25 Amp SSR which I can seem to drive as well (input is opto coupler voltage 3-24 volts).
    When I activate the later, my LCD display dims down quiet a bit.

    I was reading that to protect the output pin of the arduino, a resistor should be used to limit the current. Can others out there confirm this?
    I was under the impression that enough voltage/current is provided by the on-board regulator.

    What are others experiences with driving relays? Is it safe without a resistor?

    Robert
    HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

    #2
    A pullup resistor is safe (& cheap) insurance.

    Comment


      #3
      An output pin on the Arduino can only source 40mA of current. If the SSR control pin requires more current than that, you'll need an intermediate circuit. What are the make/model of the SSR?

      Cheers
      Al
      HS 4.2.8.0: 2134 Devices 1252 Events
      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

      Comment


        #4
        Al,

        I think this is the same one you recommended a ways back. Looks like the input is 20 ma.
        https://www.amazon.ca/dp/B0087ZTN08/...800_TE_3p_dp_1

        I'm also driving a 4-channel relay board https://www.buyapi.ca/product/4-chan...spberry-pi-5v/ each needing 15-20 ma.

        So basically each output pin would be driving 20ma. Should I still use a pull up resistor? What resistance is recommended? 10k?


        Robert
        HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

        Comment


          #5
          You should only need a pull up resistor if the pin is used as an input. In that case the pullup resistor ensures that the pin is not "floating". For an output pin, it is not required. I don't use any on the output pins of any of the Arduinos that I use. Double check to make sure the pin is explicitly set as an output pin in your sketch.


          Sent from my Phone using Tapatalk
          HS 4.2.8.0: 2134 Devices 1252 Events
          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

          Comment


            #6
            Originally posted by langenet View Post
            So being new to this, I've found conflicting information on the output current of my Mega board which I want to use to drive a relay with.
            I have a relay board (4 relays) on and it works find. I also have a 25 Amp SSR which I can seem to drive as well (input is opto coupler voltage 3-24 volts).
            When I activate the later, my LCD display dims down quiet a bit.

            I was reading that to protect the output pin of the arduino, a resistor should be used to limit the current. Can others out there confirm this?
            I was under the impression that enough voltage/current is provided by the on-board regulator.

            What are others experiences with driving relays? Is it safe without a resistor?

            Robert
            I came across this page and thought it might be helpful.

            https://www.arduino.cc/en/Tutorial/DigitalPins

            Comment


              #7
              The fact that your LCD dims down suggests that you may want to add a series resistor -- which is different from a pullup resistor.

              A series resistor is in-line with the signal, while a pullup resistor is connected between a signal and Vdd (power). (Similarly, a pulldown resistor is connected between signal and ground).

              An optoisolator input is a diode (LED). A diode has a characteristic known as forward voltage V(f) [V sub f], typically around a volt. The diode will do its darndest to maintain the voltage across it less than this. So say you connect your Arduino to this load (with the other side ground). When the Arduino tries to drive the signal high (~3.3V), the diode tries to clamp the voltage to around a volt. Result is much more current flows than is necessary for operation. It works, but the extra current generates heat in both the Arduino drivers and in the diode load, which can stess them and shorten their lifetime. Solution is a current limiting series resistor.

              An easy way to see if this is an issue is to measure the voltage across the load when driven. Unloaded of course the Arduino output will be ~3.3V. Once the load is attached, if the voltage drops more than say 0.75 volts, I'd say you'd want to add a resistor.

              Current thru a resistor is given by I = V/R, so given the Arduino logic high is 3.3 and the diode drop is say a volt, so voltage across resistor is 2.3V. You said the optoisolator load is rated at 20mA, but these often will trigger with a fraction of that. So WAG range of 2mA to 20mA would yield a resistor value of (2.3V/2mA) to (2.3V/20mA) or ~ 1K max, 120 ohms min.
              Attached Files

              Comment


                #8
                My 5cts...

                A pull up resistor will not help you in this case, as a matter of fact it will theoretically worsen the situation because it will add extra current to the load.... If a output is set to low and using a 10K pull resistor, the additional current will be: 0.5 mA (I=U/R).

                If the LCD dims, it suggests you have a power problem, this could be using the wrong source, to much power consumption by the SSD or a under provisioned power supply,

                What I typically do is separate the Arduino from the relays, SSD's and inputs that are connected. This can be done very easy by implementing a opto- coupler, in case of an input the connected system will drive the led in the optocoupler and the transistor will pull down the input; if your using a relay or SSD, the Arduino output will drive the optocoupler led and the transistor will drive the relay.

                This approach has two major advantages:
                1. You fully isolate the connected system from the Arduino.
                2. You can use a different power source for your connected relays, ssd's or devices.

                Have a look at this: https://forums.unrealengine.com/atta...3&d=1480742998 it shows a basic schematic on how to connect.

                Comment


                  #9
                  Thank you very much for clearing this up. I read the article on the DigitalPins from Arduino which confused me. It's been many, many years since I've thought about electronics...

                  Robert
                  HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                  Comment


                    #10
                    Originally posted by langenet View Post
                    Thank you very much for clearing this up. I read the article on the DigitalPins from Arduino which confused me. It's been many, many years since I've thought about electronics...

                    Robert
                    Maybe one of these might be what you could use.

                    https://www.amazon.com/arduino-relay...rduino%20relay

                    Comment


                      #11
                      Yep, you can see the optocouplers if you take a close look. A lot of the relays are 12V operated but you can also find 5V ones.

                      Be sure to check e-bay, even cheaper than the Amazon ones....

                      Comment


                        #12
                        Originally posted by cowinger View Post
                        Maybe one of these might be what you could use.

                        https://www.amazon.com/arduino-relay...rduino%20relay
                        Yes, my project uses the 4-relay board version. I also wanted to control a higher current device so added the larger SSR as well.

                        I do have some optocouplers in my possession and will look at implementing one for the larger SSR. I think the small ones are ok.
                        HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

                        Comment


                          #13
                          These are the ones i like as they have built in led indicators, optocuplers for arduino protection and jumpers for high or low trigger (also makes it nice for testing)
                          https://www.amazon.com/Icstation-12V...er+for+Arduino

                          They are cheap enough i just use them to feed any small/medium loads directly or relays/SSR for larger loads

                          Comment

                          Working...
                          X