Pages: [1] 2   Go Down
Author Topic: 74HC595 output voltage  (Read 2205 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using an Arduino Uno and a 74hc595 shift register which I need to power eight relays.  The relays coil needs 5 volts and is about 170 ohms.  So I rigged up the 74hc595 and one relay on a bread board to test it.  The relay is drawing 5.3 milli-amps and not turning on.  I found that it is only being supplied with 1.83 volts.  I have confirmed that pin 10 and 16 of the 74hc595, the voltage supply, do have 5v.  Does anybody know what could cause this?
Thanks as usual!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8512
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

595s are not designed for high-current loads.

Quote
The relay is drawing 5.3 milli-amps and not turning on.
What does the relay spec say it needs [EDIT: 5v @ 170R = ~30mA, I could have worked that out myself smiley). 5.3mA would not be enough I would think. The smallest I've seen need about 20mA.

You can add a darlington array chip (ULN2803 or similar) or use a shift reg that's designed to drive loads (TLC5927 or similar).

______
Rob
« Last Edit: July 11, 2011, 09:33:13 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12164
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 74HC series standard outputs can only drive 4mA, so can't drive those relays at all.  You need a high-current buffer to boost the output drive current, or to use 74LS595 instead (schottky TTL family, much higher drive) as a pin-for-pin replacement.

Darlington buffer chips like the ULN2803 will lose you over a volt, which might be an issue with 5V relays.  ULN2803 also has protection diodes built in which is convenient.

[edit:  actually the 74LS595 can't provide the 30mA those relays need, the ULN2803 can provide 500mA...  Hopefully 4V is enough to energize them - if not you will need separate transistors to do the job (and don't forget those protection diodes).]
« Last Edit: July 11, 2011, 08:50:06 pm by MarkT » Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, the relays take around 30 mA.  I was planning on using the transistor/diode setup to drive the relays anyway but I was just doing it this way to test them and because I was kind of lazy.  I'm still curious why I'm only getting less than 2 volts from the output pin of the shift register though.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm still curious why I'm only getting less than 2 volts from the output pin of the shift register though.

The output driver on the 595 was dropping the rest of it in a vain attempt at providing ~8 times the amount of current it was designed to output.

If a source appears to be providing less voltage than expected, it generally means it is (trying to) output too much current.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well now I just put a 1k resistor and an LED in place of the relay coil and I got 2.24 volts between the output pin of the 74hc595 and ground and 1.3 mA between the resistor and the LED.  Shouldn't I be getting 5v out of the shift register?
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12164
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you weren't using protection diodes across the relay coils you will likely have damaged the 595 already...  You don't mention if you had diodes.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used an 1n4002 across the relay coil
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You've already established that you were over driving the pins of the 595.  It is pretty likely you have damaged it.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just tried two brand new, right out of the package 74hc595's and they did the same thing.  Only 2.24 volts at the output pin across a 1k resistor and an LED to ground.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Does your DMM have a frequency function?  Are you sure the output isn't toggling?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No frequency function.  Could it be a programming error?  This is the code pertaining to the shift register. 

const int latchPin = 8;   // Pin connected to latch pin 12 (ST_CP) of 74HC595
const int clockPin = 9;   // Pin connected to clock pin 11(SH_CP) of 74HC595
const int dataPin = 10;   // Pin connected to Data in 14(DS) of 74HC595

void setup(){
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT); 
  pinMode(clockPin, OUTPUT);
}
void loop(){
   digitalWrite(latchPin, LOW);
   shiftOut( dataPin, clockPin, LSBFIRST, 1 );
   digitalWrite(latchPin, HIGH);
}

Thanks a lot for the help so far guys.  I go around to a lot of forums during my boring day at work and this is by far one of the most helpful and knowledgeable ones.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, I don't know if this matters or not, but this is the second shift register my Arduino is running.  The other one is powering an LCD using the ShiftLCD.h library.  It uses pins 2,3 and 4 while the one I'm having problems with is using pins 8,9 and 10. 
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12164
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No frequency function.  Could it be a programming error?  This is the code pertaining to the shift register. 

const int latchPin = 8;   // Pin connected to latch pin 12 (ST_CP) of 74HC595
const int clockPin = 9;   // Pin connected to clock pin 11(SH_CP) of 74HC595
const int dataPin = 10;   // Pin connected to Data in 14(DS) of 74HC595

void setup(){
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT); 
  pinMode(clockPin, OUTPUT);
}
void loop(){
   digitalWrite(latchPin, LOW);
   shiftOut( dataPin, clockPin, LSBFIRST, 1 );
   digitalWrite(latchPin, HIGH);
}

Thanks a lot for the help so far guys.  I go around to a lot of forums during my boring day at work and this is by far one of the most helpful and knowledgeable ones.

That loop() function is repeated resending the data to the shift register so it isn't outputing a steady state. Add a delay(1000).
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

5 Volts! However then I have to time subsequent button presses carefully.  I lowered the delay to 150.  Any lower than that and the voltage starts dropping.  It's getting better though.  Thanks MarkT.
Logged

Pages: [1] 2   Go Up
Jump to: