simple circuit for relay

Discussion in 'The Projects Forum' started by Lilian23, Oct 25, 2008.

  1. Lilian23

    Thread Starter Member

    Oct 7, 2008
    12
    0
    Hi

    I'd like to switch between two states depending on the output of the microcontroller. So for that purpose I'm using a 5V SPDT relay. The output of microcontroller is 3V. How can I connect this output to relay so it performs a switch? Is there a simple circuit I could use?

    Thank you very much
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
  3. Lilian23

    Thread Starter Member

    Oct 7, 2008
    12
    0
    I did saw that one, but is the transistor really necessary? :( Why can't i just put enough voltage through the coil to magnetize it and make the switch?
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Because your PIC outputs only 3 volts and because your PIC cant handle the current the relay needs to work unless it is small.
     
  5. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    Have you considered reversing your thought? Do you really need the relay? Your application may allow you to directly drive with a transistor. Can you provide more details of what you are doing?
     
    Last edited: Oct 25, 2008
  6. Lilian23

    Thread Starter Member

    Oct 7, 2008
    12
    0
    I worked on the math and connected my relay and it works fine as long as I'm using a power supply to provide the 3V (simulating the 3V output from microcontroller). However, when I use the microcontroller to provide 3V, the relay doesn't work and reading the voltages I get a drop from 3V to .87V
    at the input :confused:.
    I'm providing the 3V from the output of uC to a 7k resistor tied to base of 2N7000 transistor. The emitter is tied to ground and the collector to the coil (with the diode to protect from emf) and this same 3V is connected to other side of coil.

    Any suggestions you can provide?

    thanks
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The 2N7000 is a MOSFET rather than a BJT transistor. As such, 3 volts is not enough to turn the MOSFET on.

    hgmjr
     
  8. Lilian23

    Thread Starter Member

    Oct 7, 2008
    12
    0
    The output of the PIC suppose to activate an alarm which is turned on by 5V. The alarm used to activate whenever I pressed the button to play it but I removed that being that I don't want it to be manual, but activating it when sending signals to it. I thought that by sending the signal would work but apparently in order for it to play it has to detect the 5V and then 0...like pulses or has to reset.. as opposed to constant voltage (hope that made sense..such a noob it is sad).

    So i thought of using a relay to control this "pulsing" behavior in which when 3V then the switch would turn to the 5V source and have output connected to alarm and then make it work..otherwise if not then have the switch to its original position which is connected to nothing.

    yeah..I'm a beginner if you cannot tell. lol i'm learning lots though from here and everywhere.
     
  9. Lilian23

    Thread Starter Member

    Oct 7, 2008
    12
    0
    Oh thanks Hgmjr..suppose I have to provide 5V through the collector then?
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    If you are indeed using a 2N7000, it is a MOSFET, not a transistor.

    I have a few of these kicking around. Only 23 left, at last count.

    Some folks have incorrectly marketed the 2N7000 MOSFET as a transistor. It is not a transistor, it is a MOSFET.

    It does not have a base, nor collector nor emitter. It has a gate, a source and a drain. A MOSFET is so different from a bjt (transistor) that it's practically impossible to compare them.

    However, if you HAD to compare them - the gate would be the base, the source would be the emitter, and the drain the collector.

    Except with MOSFETs, the gate has no current - besides the gate charge, Miller charge, etc... this is really getting goofy.

    But, a 2N7000 MOSFET can work pretty well when Vgs=5v. No, not all of them will. That's where troubleshooting comes in.
     
  11. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    MOSFET's and BJT's are both transistors! but they work in a different way.
     
  12. karthik_dm

    Member

    Oct 16, 2008
    27
    0
    this is the basic relay driver circuit it can be used with for any switching circuit.the value of base resistor varies according to the voltage given for base drive of the NPN transistor.for 3V 330-680ohms is enough, for 5V(TTL output)1K-2.2Kohms is enogh you can use any NPN transistor for switching.don't forget to use the free-wheel diode, i.e the one across relay coil..
     
  13. Lilian23

    Thread Starter Member

    Oct 7, 2008
    12
    0
    WOw thanks Karthik and everyone who helped me with my problem. You guys are awesome. On another note, it is interesting the whole issue whether Mosfets are transistors or not, because in my class we just started working on transistors on Friday and apparently MOSFETS will be taught under the same category. I mean we don't have a MOSFET chapter..they are included in the transistor one..so that's pretty weird =/
     
Loading...