Controlling an analog circuit with digital input from microcontroller

Discussion in 'The Projects Forum' started by electronGun, Nov 9, 2014.

  1. electronGun

    Thread Starter New Member

    Nov 9, 2014
    1
    0
    Hello all,
    I have been working on a project in which I have to allow the potential difference of 5V across the terminals of a 5V relay only when the digital pin of the micro-controller goes to 1. Other wise nothing. I want it to be real-time, so that whenever the digital pin goes from 0 to 1, the current should flow across the relay. I would appreciate if any one could share a suggestion of doing it. Thank You.

    - EG
     
  2. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,804
    832
    Can you provide a schematic? It might be as simple as a transistor buffer switch… but without some clarity as to what you mean by current flowing across the relay, it's hard to definitely answer.
     
  3. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    Is this something like you are looking for? Transistor , just about any NPN like 2N3904. Assume "1" is a voltage of 3 to 5 V.
     
  4. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    Day dreaming and forgot to up load.
     
  5. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,804
    832
    Missing a diode across the relay coil.
    Relay Driver 00001.jpg
     
    Last edited: Nov 10, 2014
    Bernard likes this.
  6. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,539
    2,369
    Another option for driving a load from high impedance source is the 2n7000 mosfet.
    Max.
     
  7. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,129
    266
    Don't forget to put a diode across the relay coil to absorb the inductive kick- install with cathode facing the positive power rail.
     
  8. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,804
    832
    Like I said in post #5.
     
    Sensacell likes this.
Loading...