Controlling an analog circuit with digital input from microcontroller

Thread Starter

electronGun

Joined Nov 9, 2014
1
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
 

djsfantasi

Joined Apr 11, 2010
9,163
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.
 

Bernard

Joined Aug 7, 2008
5,784
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.
 

Sensacell

Joined Jun 19, 2012
3,448
Don't forget to put a diode across the relay coil to absorb the inductive kick- install with cathode facing the positive power rail.
 
Top