Shop OBEX P1 Docs P2 Docs Learn Events
Driving a Relay and another load — Parallax Forums

Driving a Relay and another load

Chicago MikeChicago Mike Posts: 88
edited 2006-09-05 20:48 in BASIC Stamp
So I read the how to drive a relay topic thread, and knoewledge base article. Makes complete sense, but I'm also trying to add an LED so when the relay trips it also drives the LED (via the transistor). See· attached schematic.


Here are my specs:
The relay coil is 180Ohms, and has an Hfe of 200
The stamp gives 5 volts, and my main supply to trip the relay and LED are 9V

So with just the relay is easy to calulate the needed value of R1.
Stall=(9-.6V)/180=.0467
Sat=.0467/200=.0002335
R1=(5-.6V)/.0002335 = about an 18K resistor (Please tell me if I'm wrong here).

So with adding a .02mA LED and a 350Ohm protective resistor in the fashion that my drawing shows, how to I compensate for this in my formula. Do I need to recalcute R2 as well?

I guess I'm a bit confused, using the attached schematic, how to add this load in the position its in and calulate R1, (and if needed recalculate R2). As you'll see in my schematic, I need the LED to go on when the relay goes on.

Any help would be great. Thanks!

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-05 13:18
    Note the LED drops 1.4 volts across it, no matter what current you put through it (until it burns out at like 30 mA. Don't do that.)

    So calculate the voltages and currents using 1.4 volts as the LED's drop.
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2006-09-05 17:15
    The circuit is just fine, the LED and Relay are basically in Parallel, with each other, so the current
    going through Q1 can be determined by ADDING the Relay current and the LED current together

    Relay current = (9V - .6V) / (Coil resistance) 
                  = 8.4V / 180 
                  = 47mA
    

    Led current = ( 9V - .6V - VLED ) / R2 
                = 7V / 330 
                = 21mA
    

    Working Backwards:
    

             R2 = ( 9V - .6V - VLED ) / ILED
                = 7V / 21mA
                = 333
    

    Note: Vled can be determined with a DMM that has a diode check. Depending
          on the type of LED this can vary greatly.  MOST LED's will work just
          fine between 5-10ma, few will be able to handle much more than 30mA.
    

    Total Current = 68 mA                             Relay Current + LED current 
    A good rule of thumb double this value...
    

    Total Current = 136mA
       Saturation = 136ma / 200 Hfe
                  = .00068
     
     
               R1 = (5V - .6V)/ Saturation
                  = 4.4V / .00068  
                  = 6470 Ohms
                  = 6.8K <- Close standard value
    

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 9/5/2006 5:24:53 PM GMT
  • Chicago MikeChicago Mike Posts: 88
    edited 2006-09-05 20:48
    This is fantastic! Thank you so much. I'm keeping this for future reference!
Sign In or Register to comment.