Author Topic: ? strange relay behavior?  (Read 4727 times)

0 Members and 1 Guest are viewing this topic.

Offline snailFuryTopic starter

  • Contributor
  • Posts: 13
  • Country: 00
? strange relay behavior?
« on: December 22, 2013, 12:24:14 am »
I have four relays connected to my breadboard as shown in the attached photo. I am using an arduino and transistors to trigger the relays.
I am running the code below.
When I send a voltage to multiple pins as HIGH without sending them a LOW signal, that is leaving the relay and LED "on", then some of the following pins I send a voltage to and their associated relays won't close even though the LED comes on. Is there some reason that having some relays switches closed would cause other relays switches to not close?

Thanks!

//Arduino Code:
 #include <math.h>
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;



// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  pinMode(pin5, OUTPUT);
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
 
  digitalWrite(pin5, HIGH);   
  delay(1000);
  digitalWrite(pin4, HIGH);
  delay(1000);             
  digitalWrite(pin3, HIGH);
  delay(1000);
  digitalWrite(pin2, HIGH);
  delay(1000);
  digitalWrite(pin5, LOW);   
  delay(1000);
  digitalWrite(pin4, LOW);
  delay(1000);
  digitalWrite(pin3, LOW);
  delay(1000);   
  digitalWrite(pin2, LOW);
  delay(1000);
}
 

Offline DrLuke

  • Contributor
  • Posts: 11
  • Country: de
    • Opensat.Space
Re: ? strange relay behavior?
« Reply #1 on: December 22, 2013, 12:32:07 am »
Which relays are you using? Which circuit are you using?
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3076
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ? strange relay behavior?
« Reply #2 on: December 22, 2013, 12:40:26 am »
Circuit diagram required.

At a guess you probably just can't provide sufficient current for the coils.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline snailFuryTopic starter

  • Contributor
  • Posts: 13
  • Country: 00
Re: ? strange relay behavior?
« Reply #3 on: December 22, 2013, 12:44:25 am »
Relay I'm using:
http://www.mouser.com/search/ProductDetail.aspx?qs=dLWB%2FtR6aAb0iRPw5CU5kw%3D%3D

Here is a video of the behavior:


The circuit is something like the attached image below, except that I've added an LED off the emitter of the transistor with a 100 ohm resistor going to ground. And I've duplicated the circuit 4 times.

thanks!

 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3076
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ? strange relay behavior?
« Reply #4 on: December 22, 2013, 12:49:00 am »
The circuit is something like the attached image below, except that I've added an LED off the emitter of the transistor with a 100 ohm resistor going to ground. And I've duplicated the circuit 4 times.

Draw on your diagram how you have these leds connected.  It sounds wrong.
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline TheBay

  • Supporter
  • ****
  • Posts: 1016
  • Country: wales
Re: ? strange relay behavior?
« Reply #5 on: December 22, 2013, 12:52:38 am »
What is the 12v source? sounds like not enough current for coils, are you sure transistors are supplying power and the relays are not being energised directly.

What happens if you do the reverse and have a common ground for the relay coils and switch the +12v with transistors?
 

Offline snailFuryTopic starter

  • Contributor
  • Posts: 13
  • Country: 00
Re: ? strange relay behavior?
« Reply #6 on: December 22, 2013, 12:59:20 am »
I removed the LED's and 100ohm resistor at the emitters of the transistors and now the relays sound like they are clicking appropriately in sync. So the lack of appropriate current appears to have been the culprit.

BTW, as a novice here, what is the best way to present a circuit one makes up to the forum, draw it on paper and take a picture?

thanks!
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3076
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ? strange relay behavior?
« Reply #7 on: December 22, 2013, 01:17:05 am »
I removed the LED's and 100ohm resistor at the emitters of the transistors and now the relays sound like they are clicking appropriately in sync. So the lack of appropriate current appears to have been the culprit.

I suspect that you had a circuit like

12v -- COIL -- TRANSISTOR (C, E) -- RESISTOR -- LED -- GND

Ignoring that raising the emitter above ground isn't very common, lets do some basic analysis.

The coil of your relays specify a current of 30mA at 12v to trip, so we can use Ohm's law to work out the resistance, 400 Ohms.

Let's for the sake of argument just say that the Collector to Emitter resistance is effectively Zero so we can ignore the transistor.

Add in your 100 Ohm resistor, you now have 500 Ohms over 12v.

Let's assume your LED has a forward voltage of 2v.  If you started with 12, and your led is eating 2 of them, how many are left.  You now have 500 Ohm over 10V.

How much current is flowing, using Ohm's law,  10 divided by 500 = 20mA at the best theoretical case.  That might be enough to trip, or it might not, it's well below the specified current either way.

If you put your resistor and LED in parallel with the relay coil instead of series, you will give the relay coil the current it wants, and your led too.  (Assuming that the base resistor of the transistor, and the transistor itself, is appropriate).

« Last Edit: December 22, 2013, 01:23:04 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3076
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: ? strange relay behavior?
« Reply #8 on: December 22, 2013, 01:19:32 am »
BTW, as a novice here, what is the best way to present a circuit one makes up to the forum, draw it on paper and take a picture?

Whatever works for you, pencil and paper is fine.  Or a screenshot, image export, or PDF from a circuit design software (Fritzing, Diptrace, Eagle, DesignSpark, Circuits.io ......).
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline DrLuke

  • Contributor
  • Posts: 11
  • Country: de
    • Opensat.Space
Re: ? strange relay behavior?
« Reply #9 on: December 22, 2013, 01:26:56 am »
I removed the LED's and 100ohm resistor at the emitters of the transistors and now the relays sound like they are clicking appropriately in sync. So the lack of appropriate current appears to have been the culprit.

I suspect that you had a circuit like

12v -- COIL -- TRANSISTOR (C, E) -- RESISTOR -- LED -- GND

Ignoring that raising the emitter above ground isn't very common, lets do some basic analysis.

The coil of your relays specify a current of 30mA at 12v to trip, so we can use Ohm's law to work out the resistance, 400 Ohms.

Let's for the sake of argument just say that the Collector to Emitter resistance is effectively Zero so we can ignore the transistor.

Add in your 100 Ohm resistor, you now have 500 Ohms over 12v.

Let's assume your LED has a forward voltage of 2v.  If you started with 12, and your led is eating 2 of them, how many are left.  You now have 500 Ohm over 10V.

How much current is flowing, using Ohm's law,  10 divided by 500 = 20mA at the best theoretical case.  That might be enough to trip, or it might not, it's well below the specified current either way.

If you put your resistor and LED in parallel with the relay coil instead of series, you will give the relay coil the current it wants, and your led too.  (Assuming that the base resistor of the transistor, and the transistor itself, is appropriate).

This sounds like the solution here.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf