Shop OBEX P1 Docs P2 Docs Learn Events
Controling a 40ma 12volt relay??? — Parallax Forums

Controling a 40ma 12volt relay???

ArchiverArchiver Posts: 46,084
edited 2001-09-26 14:03 in General Discussion
Hi,



Ok real basic electronics question here. It's been too long since I
got out of school and it's showing. Here goes

I'd like to control a 12volt 40 ma relay using a stamp, naturally I
know I'll need a transistor to control the 12v to the relay. I'm
using a PNP (2907). My problem is I'm able to turn the relay on by
applying ground through a 1K resistor that's tied to the base,
however 5v will also turn on the relay. My circuit looks like this.


12v+
Collector


1K
stamp out put
/\/\/\
Base PNP


10K
Ground
/\/\/\\
Emitter

I'm guessing that I need to change the values of my resistors.

I need it so ground turns the relay ON and +5 from the stamp turns
the relay OFF. Vise versa is fine too. I just can't have it doing
what it's doing now and switching on with ground and with +5


Thanks for any help on this


Tim

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 05:03
    Hi,

    If you use a PNP the emitter should be tied to 5V, for NPN the emitter is
    tied to GND.
    The schematic below shows both methods. Values between () for PNP.

    +----+
    relay power supply + (-)
    | |
    | |
    | |
    diode | ---
    1N4148 --- | |
    / \ | | relay coil
    | | |
    | ---
    +----}
    }
    / collector
    1k /
    stamp --/\/\/--| NPN (PNP)
    base\
    \ emitter
    |
    |
    relay power supply - (+)
    |
    GND (5V)

    The NPN is the better option as it shares the GND of the stamp with the - of
    the relay.

    Hope this helps

    regards peter


    Oorspronkelijk bericht
    Van: timevex@o... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=xLDTfHUz6vp5LSyWB5zYXlGHk_ZP0-otzHyUn6MYKFAQtTiXLnwGAoTiqEAOsvI-NaVe_G3k6ppLhG5rTw]timevex@o...[/url
    Verzonden: dinsdag 25 september 2001 04:27
    Aan: basicstamps@yahoogroups.com
    Onderwerp: [noparse][[/noparse]basicstamps] Controling a 40ma 12volt relay???





    Hi,



    Ok real basic electronics question here. It's been too long since I
    got out of school and it's showing. Here goes

    I'd like to control a 12volt 40 ma relay using a stamp, naturally I
    know I'll need a transistor to control the 12v to the relay. I'm
    using a PNP (2907). My problem is I'm able to turn the relay on by
    applying ground through a 1K resistor that's tied to the base,
    however 5v will also turn on the relay. My circuit looks like this.


    12v+
    Collector


    1K
    stamp out put
    /\/\/\
    Base PNP


    10K
    Ground
    /\/\/\\
    Emitter

    I'm guessing that I need to change the values of my resistors.

    I need it so ground turns the relay ON and +5 from the stamp turns
    the relay OFF. Vise versa is fine too. I just can't have it doing
    what it's doing now and switching on with ground and with +5


    Thanks for any help on this


    Tim




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 05:26
    I prefer a 2N2222 -- NPN transistor. That, a small diode and a 10k resistor
    will switch any load up to about 80 ma.

    Original Message

    > Ok real basic electronics question here. It's been too long since I
    > got out of school and it's showing. Here goes
    >
    > I'd like to control a 12volt 40 ma relay using a stamp, naturally I
    > know I'll need a transistor to control the 12v to the relay. I'm
    > using a PNP (2907). My problem is I'm able to turn the relay on by
    > applying ground through a 1K resistor that's tied to the base,
    > however 5v will also turn on the relay. My circuit looks like this.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 15:47
    The problem is that it's switching with a high or a low from the
    stamp, I think it's because I'm switching a higher voltage I'm
    switching a 12volt relay with the transistor. I've tried the 2222 as
    well.

    Tim



    --- In basicstamps@y..., Rodent <daweasel@s...> wrote:
    > I prefer a 2N2222 -- NPN transistor. That, a small diode and a 10k
    resistor
    > will switch any load up to about 80 ma.
    >
    >
    Original Message
    >
    > > Ok real basic electronics question here. It's been too long since
    I
    > > got out of school and it's showing. Here goes
    > >
    > > I'd like to control a 12volt 40 ma relay using a stamp, naturally
    I
    > > know I'll need a transistor to control the 12v to the relay. I'm
    > > using a PNP (2907). My problem is I'm able to turn the relay on by
    > > applying ground through a 1K resistor that's tied to the base,
    > > however 5v will also turn on the relay. My circuit looks like
    this.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 15:53
    Peter,


    I'll give this a try, so I don't need a resistor on the emitter or
    collector? I'll try this tonight, hopefully it will switch with +5
    and GND before it was seeing both +5 and GND as GND and switching the
    relay.

    Thanks for your help.

    Tim




    --- In basicstamps@y..., "Peter Verkaik" <peterverkaik@b...> wrote:
    > Hi,
    >
    > If you use a PNP the emitter should be tied to 5V, for NPN the
    emitter is
    > tied to GND.
    > The schematic below shows both methods. Values between () for PNP.
    >
    > +----+
    relay power supply + (-)
    > | |
    > | |
    > | |
    > diode | ---
    > 1N4148 --- | |
    > / \ | | relay coil
    > | | |
    > | ---
    > +----}
    > }
    > / collector
    > 1k /
    > stamp --/\/\/--| NPN (PNP)
    > base\
    > \ emitter
    > |
    > |
    relay power supply - (+)
    > |
    > GND (5V)
    >
    > The NPN is the better option as it shares the GND of the stamp with
    the - of
    > the relay.
    >
    > Hope this helps
    >
    > regards peter
    >
    >
    >
    Oorspronkelijk bericht
    > Van: timevex@o... [noparse][[/noparse]mailto:timevex@o...]
    > Verzonden: dinsdag 25 september 2001 04:27
    > Aan: basicstamps@y...
    > Onderwerp: [noparse][[/noparse]basicstamps] Controling a 40ma 12volt relay???
    >
    >
    >
    >
    >
    > Hi,
    >
    >
    >
    > Ok real basic electronics question here. It's been too long since I
    > got out of school and it's showing. Here goes
    >
    > I'd like to control a 12volt 40 ma relay using a stamp, naturally I
    > know I'll need a transistor to control the 12v to the relay. I'm
    > using a PNP (2907). My problem is I'm able to turn the relay on by
    > applying ground through a 1K resistor that's tied to the base,
    > however 5v will also turn on the relay. My circuit looks like this.
    >
    >
    > 12v+
    Collector
    >
    >
    > 1K
    > stamp out put
    /\/\/\
    Base PNP
    >
    >
    > 10K
    > Ground
    /\/\/\\
    Emitter
    >
    > I'm guessing that I need to change the values of my resistors.
    >
    > I need it so ground turns the relay ON and +5 from the stamp turns
    > the relay OFF. Vise versa is fine too. I just can't have it doing
    > what it's doing now and switching on with ground and with +5
    >
    >
    > Thanks for any help on this
    >
    >
    > Tim
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@y...
    > from the same email address that you subscribed. Text in the
    Subject and
    > Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 15:59
    Shouldn't be a problem. I switch I/R LED's off a 9 volt supply with a 2N2222
    and it works quite well. A 12-volt relay should work also.

    Here is what you do to use a 2N2222:

    Connect one of the relay coil leads to +12. Connect the other coil lead to
    the collector of the 2N2222. You also need to connect a diode in reverse
    bias across the coil of the relay to prevent damaging the transistor. A
    1N4001 is fine for this.Ground the emitter of the 2N2222. Both the Stamp
    ground and the 12 volt ground need to be tied together. Connect one lead of
    a 10k resistor to a Stamp pin, and the other resistor lead to the base of
    the 2N2222.

    When the Stamp pin is set high, the relay should turn on.



    Original Message
    From: <timevex@o...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, September 25, 2001 9:47 AM
    Subject: [noparse][[/noparse]basicstamps] Re: Controling a 40ma 12volt relay???


    > The problem is that it's switching with a high or a low from the
    > stamp, I think it's because I'm switching a higher voltage I'm
    > switching a 12volt relay with the transistor. I've tried the 2222 as
    > well.

    > > I prefer a 2N2222 -- NPN transistor. That, a small diode and a 10k
    > resistor
    > > will switch any load up to about 80 ma.
    > >
    > >
    Original Message
    > >
    > > > Ok real basic electronics question here. It's been too long since
    > I
    > > > got out of school and it's showing. Here goes
    > > >
    > > > I'd like to control a 12volt 40 ma relay using a stamp, naturally
    > I
    > > > know I'll need a transistor to control the 12v to the relay. I'm
    > > > using a PNP (2907). My problem is I'm able to turn the relay on by
    > > > applying ground through a 1K resistor that's tied to the base,
    > > > however 5v will also turn on the relay. My circuit looks like
    > this.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 19:09
    Ok should like it should work, I'll give it a try tonight.

    Thanks for your help.

    Tim


    --- In basicstamps@y..., Rodent <daweasel@s...> wrote:
    > Shouldn't be a problem. I switch I/R LED's off a 9 volt supply with
    a 2N2222
    > and it works quite well. A 12-volt relay should work also.
    >
    > Here is what you do to use a 2N2222:
    >
    > Connect one of the relay coil leads to +12. Connect the other coil
    lead to
    > the collector of the 2N2222. You also need to connect a diode in
    reverse
    > bias across the coil of the relay to prevent damaging the
    transistor. A
    > 1N4001 is fine for this.Ground the emitter of the 2N2222. Both the
    Stamp
    > ground and the 12 volt ground need to be tied together. Connect one
    lead of
    > a 10k resistor to a Stamp pin, and the other resistor lead to the
    base of
    > the 2N2222.
    >
    > When the Stamp pin is set high, the relay should turn on.
    >
    >
    >
    >
    Original Message
    > From: <timevex@o...>
    > To: <basicstamps@y...>
    > Sent: Tuesday, September 25, 2001 9:47 AM
    > Subject: [noparse][[/noparse]basicstamps] Re: Controling a 40ma 12volt relay???
    >
    >
    > > The problem is that it's switching with a high or a low from the
    > > stamp, I think it's because I'm switching a higher voltage I'm
    > > switching a 12volt relay with the transistor. I've tried the 2222
    as
    > > well.
    >
    > > > I prefer a 2N2222 -- NPN transistor. That, a small diode and a
    10k
    > > resistor
    > > > will switch any load up to about 80 ma.
    > > >
    > > >
    Original Message
    > > >
    > > > > Ok real basic electronics question here. It's been too long
    since
    > > I
    > > > > got out of school and it's showing. Here goes
    > > > >
    > > > > I'd like to control a 12volt 40 ma relay using a stamp,
    naturally
    > > I
    > > > > know I'll need a transistor to control the 12v to the relay.
    I'm
    > > > > using a PNP (2907). My problem is I'm able to turn the relay
    on by
    > > > > applying ground through a 1K resistor that's tied to the base,
    > > > > however 5v will also turn on the relay. My circuit looks like
    > > this.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 19:28
    Tim:

    Formal schooling was just too long ago and I know the feeling. Add to that
    constant change from one aspect of system design to another - almost from
    day to day, and we begin to realize the former benefits of having a young
    mind.

    Here's a nice tutorial that may help yourself in brushing up, or others in
    getting acquainted with basic transistor biasing for switching and
    amplification:

    http://www.mitedu.freeserve.co.uk/Design/bjtbias.htm

    :Chris
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 20:42
    You understand the diode is hooked up across the relay coil with the banded
    end towards +12 ?? This keeps the relay from spiking the transistor when the
    relay is turned off (the coil on the relay generates a voltage spike as the
    magnetic field collapses.)

    Original Message

    > Ok should like it should work, I'll give it a try tonight.

    > > Shouldn't be a problem. I switch I/R LED's off a 9 volt supply with
    > a 2N2222
    > > and it works quite well. A 12-volt relay should work also.
    > >
    > > Here is what you do to use a 2N2222:
    > >
    > > Connect one of the relay coil leads to +12. Connect the other coil
    > lead to
    > > the collector of the 2N2222. You also need to connect a diode in
    > reverse
    > > bias across the coil of the relay to prevent damaging the
    > transistor. A
    > > 1N4001 is fine for this.Ground the emitter of the 2N2222. Both the
    > Stamp
    > > ground and the 12 volt ground need to be tied together. Connect one
    > lead of
    > > a 10k resistor to a Stamp pin, and the other resistor lead to the
    > base of
    > > the 2N2222.
    > >
    > > When the Stamp pin is set high, the relay should turn on.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-25 20:52
    I vaguely remember all this stuff from electronics in high school. Did the
    same kind of experiments with vacuum tubes also.

    Original Message

    > Formal schooling was just too long ago and I know the feeling. Add to that
    > constant change from one aspect of system design to another - almost from
    > day to day, and we begin to realize the former benefits of having a young
    > mind.
    >
    > Here's a nice tutorial that may help yourself in brushing up, or others in
    > getting acquainted with basic transistor biasing for switching and
    > amplification:
    >
    > http://www.mitedu.freeserve.co.uk/Design/bjtbias.htm
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-26 01:08
    Hello;

    Just my two cents on this issue I played around with transistors for
    a little while and finnally figured it out but I've never been very
    fond of the singly packaged transistors. I suggest if your just
    interseted in having it work (instead of the workings of electronics)
    a Transistor Array in IC form is much easier. I'm quite fond of the
    ULN2803a it also has the internal circutry to privide it with the
    right logic levels from the stamp. owever this is an NPN device which
    means you'll have to attach one end of your relay coil to +12 and the
    other to the transistor output.

    You can also order free samples from Allegro Microsystems
    http://www.allegromicro.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-26 01:56
    Yeah I had that much down. A few years back, I had to add diodes to a guys
    circuit that had over 200 large power relays that A/C controlled the power
    to individual hotel rooms. They kept blowing out the BJT that powered each
    one. That was my painful lesson in the field of collapsing fields with
    relays. I got tried of always going to solder in a new transistor, so one
    day I suggested that I add diodes to all the relays to prevent this problem,
    I did and now they haven't called me for a problem since. Now I'm not making
    money from them week after week, I'm not sure what's better. Hehe

    Hey thank for all your help on this the circuit works like a charm, before I
    had the -12 going into the collector instead of going into the emitter.
    Switched it around after getting your advice and it works perfectly.


    Tim

    Original Message
    From: Rodent [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=r-k5NXyELVKGJcoohCXXKPz_QBfeqmZQoh2RpdLR6XkrR2TL23XIE6dluaZzY9G3vxuW2v0VeJeXgw]daweasel@s...[/url
    Sent: Tuesday, September 25, 2001 3:42 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Re: Controling a 40ma 12volt relay???

    You understand the diode is hooked up across the relay coil with the banded
    end towards +12 ?? This keeps the relay from spiking the transistor when the
    relay is turned off (the coil on the relay generates a voltage spike as the
    magnetic field collapses.)

    Original Message

    > Ok should like it should work, I'll give it a try tonight.

    > > Shouldn't be a problem. I switch I/R LED's off a 9 volt supply with
    > a 2N2222
    > > and it works quite well. A 12-volt relay should work also.
    > >
    > > Here is what you do to use a 2N2222:
    > >
    > > Connect one of the relay coil leads to +12. Connect the other coil
    > lead to
    > > the collector of the 2N2222. You also need to connect a diode in
    > reverse
    > > bias across the coil of the relay to prevent damaging the
    > transistor. A
    > > 1N4001 is fine for this.Ground the emitter of the 2N2222. Both the
    > Stamp
    > > ground and the 12 volt ground need to be tied together. Connect one
    > lead of
    > > a 10k resistor to a Stamp pin, and the other resistor lead to the
    > base of
    > > the 2N2222.
    > >
    > > When the Stamp pin is set high, the relay should turn on.




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-26 01:56
    Aaron,


    I'm looking at the pin out for this chip I'm trying to understand how to
    wire it up, for a hypothetical 4 relay project. From looking at the diagram
    I'm having trouble understanding which of the pins would connect up to the
    stamp and how I would connect the coils of the relays. Can you give me a
    rough break down (with pin numbers) how I would connect this IC up to
    control several loads independently from each other. This chip will work
    perfect for a project that I've put on the back burner that has many relays.


    Thanks for your help

    Tim


    Original Message
    From: Aaron [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ouFS265tFqZwslLFZUmDJF8RubMZ4vCP6eLgyETF_6nHC0uCJPx5dW-HqlkXRmiGf7sHNj3GKq-jgng]snazzyguy2@y...[/url
    Sent: Tuesday, September 25, 2001 8:09 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: Controling a 40ma 12volt relay???

    Hello;

    Just my two cents on this issue I played around with transistors for
    a little while and finnally figured it out but I've never been very
    fond of the singly packaged transistors. I suggest if your just
    interseted in having it work (instead of the workings of electronics)
    a Transistor Array in IC form is much easier. I'm quite fond of the
    ULN2803a it also has the internal circutry to privide it with the
    right logic levels from the stamp. owever this is an NPN device which
    means you'll have to attach one end of your relay coil to +12 and the
    other to the transistor output.

    You can also order free samples from Allegro Microsystems
    http://www.allegromicro.com/




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-26 05:23
    Its one of those basic circuits you use alot on robots. I use them to drive
    high-current LEDs, relays, amplify sensor signals, etc... Everyone should
    have a box of 2N2222 transistors and 1N4002 diodes.

    Original Message

    > Yeah I had that much down. A few years back, I had to add diodes to a guys
    > circuit that had over 200 large power relays that A/C controlled the power
    > to individual hotel rooms. They kept blowing out the BJT that powered each
    > one. That was my painful lesson in the field of collapsing fields with
    > relays. I got tried of always going to solder in a new transistor, so one
    > day I suggested that I add diodes to all the relays to prevent this
    problem,
    > I did and now they haven't called me for a problem since. Now I'm not
    making
    > money from them week after week, I'm not sure what's better. Hehe
    >
    > Hey thank for all your help on this the circuit works like a charm, before
    I
    > had the -12 going into the collector instead of going into the emitter.
    > Switched it around after getting your advice and it works perfectly.
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-26 13:29
    Since no one else has pointed it out I need to say that Peter's
    schematic has an error. The 1N4148 diode needs to have its connections
    reversed in the PNP situation.

    --- In basicstamps@y..., timevex@o... wrote:
    > Peter,
    >
    >
    > I'll give this a try, so I don't need a resistor on the emitter or
    > collector? I'll try this tonight, hopefully it will switch with +5
    > and GND before it was seeing both +5 and GND as GND and switching
    the
    > relay.
    >
    > Thanks for your help.
    >
    > Tim
    >
    >
    >
    >
    > --- In basicstamps@y..., "Peter Verkaik" <peterverkaik@b...> wrote:
    > > Hi,
    > >
    > > If you use a PNP the emitter should be tied to 5V, for NPN the
    > emitter is
    > > tied to GND.
    > > The schematic below shows both methods. Values between () for PNP.
    > >
    > > +----+
    relay power supply + (-)
    > > | |
    > > | |
    > > | |
    > > diode | ---
    > > 1N4148 --- | |
    > > / \ | | relay coil
    > > | | |
    > > | ---
    > > +----}
    > > }
    > > / collector
    > > 1k /
    > > stamp --/\/\/--| NPN (PNP)
    > > base\
    > > \ emitter
    > > |
    > > |
    relay power supply - (+)
    > > |
    > > GND (5V)
    > >
    > > The NPN is the better option as it shares the GND of the stamp
    with
    > the - of
    > > the relay.
    > >
    > > Hope this helps
    > >
    > > regards peter
    > >
    > >
    > >
    Oorspronkelijk bericht
    > > Van: timevex@o... [noparse][[/noparse]mailto:timevex@o...]
    > > Verzonden: dinsdag 25 september 2001 04:27
    > > Aan: basicstamps@y...
    > > Onderwerp: [noparse][[/noparse]basicstamps] Controling a 40ma 12volt relay???
    > >
    > >
    > >
    > >
    > >
    > > Hi,
    > >
    > >
    > >
    > > Ok real basic electronics question here. It's been too long since
    I
    > > got out of school and it's showing. Here goes
    > >
    > > I'd like to control a 12volt 40 ma relay using a stamp, naturally
    I
    > > know I'll need a transistor to control the 12v to the relay. I'm
    > > using a PNP (2907). My problem is I'm able to turn the relay on by
    > > applying ground through a 1K resistor that's tied to the base,
    > > however 5v will also turn on the relay. My circuit looks like
    this.
    > >
    > >
    > > 12v+
    Collector
    > >
    > >
    > > 1K
    > > stamp out put
    /\/\/\
    Base PNP
    > >
    > >
    > > 10K
    > > Ground
    /\/\/\\
    Emitter
    > >
    > > I'm guessing that I need to change the values of my resistors.
    > >
    > > I need it so ground turns the relay ON and +5 from the stamp turns
    > > the relay OFF. Vise versa is fine too. I just can't have it doing
    > > what it's doing now and switching on with ground and with +5
    > >
    > >
    > > Thanks for any help on this
    > >
    > >
    > > Tim
    > >
    > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    > Subject and
    > > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-09-26 14:03
    Hi Fred,

    I corrected that error myself by posting a second message directly
    after my initial response. Maybe you missed that message.

    regards peter



    Oorspronkelijk bericht
    Van: Fred Davidson [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=z6rz6iIlrZ-LuIJjppN2aZpLrs9JGkwAWLT064xrZsR5qUxeQvR0yRI2hYrnQqT7lRPkreaWzK2OuBZUZJpm]fdavidson@m...[/url
    Verzonden: woensdag 26 september 2001 13:30
    Aan: basicstamps@yahoogroups.com
    Onderwerp: [noparse][[/noparse]basicstamps] Re: Controling a 40ma 12volt relay???


    Since no one else has pointed it out I need to say that Peter's
    schematic has an error. The 1N4148 diode needs to have its connections
    reversed in the PNP situation.

    --- In basicstamps@y..., timevex@o... wrote:
    > Peter,
    >
    >
    > I'll give this a try, so I don't need a resistor on the emitter or
    > collector? I'll try this tonight, hopefully it will switch with +5
    > and GND before it was seeing both +5 and GND as GND and switching
    the
    > relay.
    >
    > Thanks for your help.
    >
    > Tim
    >
    >
    >
    >
    > --- In basicstamps@y..., "Peter Verkaik" <peterverkaik@b...> wrote:
    > > Hi,
    > >
    > > If you use a PNP the emitter should be tied to 5V, for NPN the
    > emitter is
    > > tied to GND.
    > > The schematic below shows both methods. Values between () for PNP.
    > >
    > > +----+
    relay power supply + (-)
    > > | |
    > > | |
    > > | |
    > > diode | ---
    > > 1N4148 --- | |
    > > / \ | | relay coil
    > > | | |
    > > | ---
    > > +----}
    > > }
    > > / collector
    > > 1k /
    > > stamp --/\/\/--| NPN (PNP)
    > > base\
    > > \ emitter
    > > |
    > > |
    relay power supply - (+)
    > > |
    > > GND (5V)
    > >
    > > The NPN is the better option as it shares the GND of the stamp
    with
    > the - of
    > > the relay.
    > >
    > > Hope this helps
    > >
    > > regards peter
    > >
    > >
    > >
    Oorspronkelijk bericht
    > > Van: timevex@o... [noparse][[/noparse]mailto:timevex@o...]
    > > Verzonden: dinsdag 25 september 2001 04:27
    > > Aan: basicstamps@y...
    > > Onderwerp: [noparse][[/noparse]basicstamps] Controling a 40ma 12volt relay???
    > >
    > >
    > >
    > >
    > >
    > > Hi,
    > >
    > >
    > >
    > > Ok real basic electronics question here. It's been too long since
    I
    > > got out of school and it's showing. Here goes
    > >
    > > I'd like to control a 12volt 40 ma relay using a stamp, naturally
    I
    > > know I'll need a transistor to control the 12v to the relay. I'm
    > > using a PNP (2907). My problem is I'm able to turn the relay on by
    > > applying ground through a 1K resistor that's tied to the base,
    > > however 5v will also turn on the relay. My circuit looks like
    this.
    > >
    > >
    > > 12v+
    Collector
    > >
    > >
    > > 1K
    > > stamp out put
    /\/\/\
    Base PNP
    > >
    > >
    > > 10K
    > > Ground
    /\/\/\\
    Emitter
    > >
    > > I'm guessing that I need to change the values of my resistors.
    > >
    > > I need it so ground turns the relay ON and +5 from the stamp turns
    > > the relay OFF. Vise versa is fine too. I just can't have it doing
    > > what it's doing now and switching on with ground and with +5
    > >
    > >
    > > Thanks for any help on this
    > >
    > >
    > > Tim
    > >
    > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    > Subject and
    > > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.