1
\$\begingroup\$

I want to switch a 12 V pump from the digital output of an arduino. I have tried using 5 V relays by using this schematic:

and put two of these in parallel. The power they are getting is from the arduino itself which is connected by 12 V in V-in. The relays behave abnormally. Can I get an arduino to switch on a 12 V pump and a 24 V pump?

\$\endgroup\$
5
  • \$\begingroup\$ What is 'abnormally'? Putting relays in parallel could cause problems with current sharing. \$\endgroup\$ – calcium3000 Dec 29 '16 at 16:36
  • \$\begingroup\$ @calcium3000 Sir by abnormally i mean that when i have connected the relays and i send a signal to the arduino for one to switch on and off after 4 sec, sometimes it would stay on and sometimes the other relay is triggered. \$\endgroup\$ – Bhaamb Dec 29 '16 at 16:39
  • \$\begingroup\$ What's the value of the base resistor? Are you driving two transistors with a single Arduino pin or one for each transistor? \$\endgroup\$ – calcium3000 Dec 29 '16 at 16:40
  • 2
    \$\begingroup\$ An Arduino has a very limited capacity to supply 5V to external circuitry, especially when working from a 12V supply. The onboard regulator has little heatsinking and is subject to overheating/shutdown. Your two relay coils may be overloading it. It would be much better to use relays with 12V coils, and running them directly from the 12V supply. \$\endgroup\$ – Dave Tweed Dec 29 '16 at 16:47
  • \$\begingroup\$ @calcium3000 The base resistor is rated at 4.7Kohms and i am driving the relay from 1 arduino and from different pwm pins. \$\endgroup\$ – Bhaamb Dec 29 '16 at 16:54
3
\$\begingroup\$

What you show is a good topology. However, there are details in parts values that matter.

One problem may be that the relays require too much current from the 5 V supply. You say you have 12 V available, from which the 5 V is derived anyway. A better solution is to power the relays from 12 V. Very likely the same relay series you are using has a version with a 12 V coil. That is a very common coil voltage.

Relays in a series have about the same coil power. The 12 V version will need about 5/12 of the current the 5 V version does. For example, if the 5 V version requires 60 mA, then 12 V version will require about 25 mA.

Running the relays from 12 V does some good things:

  1. It doesn't load the 5 V supply with the relay coil current. That can be 10s of mA per relay, and could possibly be exceeding the 5 V current budget.

  2. It's more efficient. The 5 V supply is being made from 12 V somehow, and that process is not 100% efficient. Drawing the same power from the 12 V supply is therefore more efficient than drawing it from the 5 V supply.

    This can be a significant issue if the 5 V is being linearly regulated from the 12 V. A extra 100 mA, for example, from the 5 V supply cause additional 700 mW dissipation in the regulator. That might be the difference between OK and too hot.

  3. Since the 12 V version of the relay uses less current, there is more margin for the gain of the transistor, or the amount of base current needed.

The other issue is that you have to make sure the transistor is driven properly. That means it needs enough base current to be saturated when on.

Let's say the 12 V relay takes 25 mA, just to pick something as example. Let's say the transistor can be counted on to have a gain of at least 50. That means the base current needs to be (25 mA)/50 = 500 µA minimum. Figure the B-E drop is 700 mV, so that leaves 4.3 V across the base resistor. (4.3 V)/(500 µA) = 8.6 kΩ. That allows for the absolute minimum base current. To get solidly into saturation, I'd double the base current, which means half the resistance, or 4.3 kΩ. Any handy value from about 2 kΩ to 4.3 kΩ would be fine.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.