Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

output and relay need

Status
Not open for further replies.

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
We have signals from microcontroller outputs, when do we need to use relays as intermediate devices apply for these signal to control external devices ?
Thanks !!!
 

pouchito

Full Member level 2
Joined
May 29, 2006
Messages
126
Helped
22
Reputation
44
Reaction score
9
Trophy points
1,298
Activity points
1,835
when your external devices requires a high current and voltage which the pic does not supply
 

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
Thanks !
And could you help me with these questions: when PIC is normal operation, has supply, what is the state of output pins if we not affect on them(e.g send a "1" or "0" signal to that output) ?
and help me understand this statement in PIC datasheet
"The Output Low Voltage (VOL) of an I/O pin depends on the external connections to that I/O. If an I/O pin is shorted to VDD, no matter the drive capability of the I/O pin, a low level would not be reached (and the device would consume excessive drive current). The VOL is the output voltage that the I/O pin will drive, given the I/O does not need to sink more then the IOL current (at the specified device voltage) as specified in the conditions portion of the specification."
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169
A PIC is usually connected to +5V and GND (Vdd and Vss, respectively). PIC outputs can safely source and sink up to 25ma per pin up to a maximum total package current, which can be 100 to 200ma depending on the PIC.

The reference you are quoting is referring to the effect of an output that is Low, or 0V (GND), and is shorted directly to Vdd, or 5V. They are saying to avoid that possibility in your design. Since a PIC output at Low Logic, 0V, can actually sink up to 80ma, and this is considered excessive and over the recommended 25ma, you want to know that your sourcing device is current limited or you would want to add current limiting.
 

    smiles

    points: 2
    Helpful Answer Positive Rating

elec4fun

Full Member level 3
Joined
Jan 24, 2005
Messages
159
Helped
38
Reputation
76
Reaction score
31
Trophy points
1,308
Location
Nice, France
Activity points
897
And could you help me with these questions: when PIC is normal operation, has supply, what is the state of output pins if we not affect on them(e.g send a "1" or "0" signal to that output) ?
Usually, in the datasheet you can find the status after reset of each register.

Regards,
Franck.
 

plusminus

Full Member level 1
Joined
Jul 27, 2007
Messages
96
Helped
15
Reputation
30
Reaction score
3
Trophy points
1,288
Location
the Netherlands
Activity points
1,804
Another reason for using a relay is isolation between the µC and a high voltage source. When you want to switch on / of a light connected to mains.
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169
A PIC does not have enough drive current for most relays. Also, the coil of the relay has a nasty reverse voltage kickback. Depending on your voltage and current requirements consider an optocoupler between the PIC and relay. You can also use a simple optocoupled FET, aka SSR. In both cases you get very high isolation to protect the electronics from the real world.

Simple optocoupler:
http://www.futurlec.com/LED/PC847.shtml

Solid State Relay (SSR):
http://www.fairchildsemi.com/ds/HS/HSR312.pdf
 

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
Thanks for your replies !!!
Ah ... You had referred about sink and source, I read about these two term a lot but hard to remember what they are about, could you help me a short way to remember it ?
Thanks !!!
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169
Simply stated, the microcontroller SOURCES current when it's output is the supply of current to the load. This is usually when the PIC's pin is HIGH, or 5V, and is connected to a load that is connected to Ground.

A PIC pin SINKS current when it's output pin is LOW and appears as GROUND, or 0V, and the load is connected to +V. The current from the source device is dumped through the PIC's output pin to Ground.

Try this link for a simple explanation and illustrations:
http://digital.ni.com/public.nsf/allkb/a10122c63a7f5cfe86256b4c007491dd
 

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
Thanks !!!
As you said, current from PIC cannot drive relay coil, here is my circuit, do you think is that good ?
 

narccizzo

Full Member level 3
Joined
Jan 20, 2006
Messages
174
Helped
16
Reputation
32
Reaction score
11
Trophy points
1,298
Location
PATZCUARO,MICHOACAN,MEXICO
Activity points
2,819
Usually with just one transistor is enough, removing q1, r13 and r14 and put the pic signal where the collector of q1, and don't forget to invert the status of the pic output by software.
 

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
Oh wait, my circuit get error, I must have a resistor between emitter of Q1 and ground to have enough voltage for activating Q2 :(
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169

    smiles

    points: 2
    Helpful Answer Positive Rating

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
Thanks ! Your links are really helpful !
...
Should we use FETs to control relay ?
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169
Transistors will be easier to implement and very easy to find. FET's are fine except you need high gate voltage to turn them on. There are some new low voltage 5V FET's, but transistors should do the job easily and you can drive them directly from the PIC.
 

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
Thanks ! Now I have a problem with my whole circuit, that is when you turn on power, current flow to relay coil instantly and will affect the contacts (Q2 conducts)
Although I have PIC signal ("0") will make Q1 conducts (then Q2 off) but I think this event will happen after the first event above, means relay will operate (although just in a little time).
How can I disable the operation of relay at the time I turn on power supply ?
Thanks !!!
Here is the circuit
http://img69.imageshack.us/img69/9494/17951565ty8.jpg
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169
Make it simple. A darlington setup is likely not necessary. Try a single NPN in a configuration like this:

 

plusminus

Full Member level 1
Joined
Jul 27, 2007
Messages
96
Helped
15
Reputation
30
Reaction score
3
Trophy points
1,288
Location
the Netherlands
Activity points
1,804
Other thing in your schematic: C1 is a little small. Have you calculate it?
Your input ripple to the 7805 is very high now. If you make the capacitor bigger your circuit will be more stable.
If your circuit draws 100mA the capacitor should be about 100 µF to get a ripple of ~1.5V.

For a bridge rectifier:
(Uripple = ~1.5*(Io/C) (Io in mA, C in µF)
 

smiles

Advanced Member level 4
Joined
Jul 27, 2007
Messages
110
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,096
connect a diode or RC snubber across it so avoid damage....
uhm ... across which device :|
Make it simple. A darlington setup is likely not necessary. Try a single NPN in a configuration like this
:?: so I don't need NOT gate (means output signal be "1" for control external device ?)
Other thing in your schematic: C1 is a little small. Have you calculate it?
Your input ripple to the 7805 is very high now. If you make the capacitor bigger your circuit will be more stable.
If your circuit draws 100mA the capacitor should be about 100 µF to get a ripple of ~1.5V.

For a bridge rectifier:
(Uripple = ~1.5*(Io/C) (Io in mA, C in µF)
Let me check again, thank you :)
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top