Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

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 !!!
 

when your external devices requires a high current and voltage which the pic does not supply
 

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."
 

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
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.
 

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.
 

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:
https://www.futurlec.com/LED/PC847.shtml

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

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 !!!
 

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:
https://digital.ni.com/public.nsf/allkb/a10122c63a7f5cfe86256b4c007491dd
 

Thanks !!!
As you said, current from PIC cannot drive relay coil, here is my circuit, do you think is that good ?
 

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.
 

Oh wait, my circuit get error, I must have a resistor between emitter of Q1 and ground to have enough voltage for activating Q2 :(
 

Thanks ! Your links are really helpful !
...
Should we use FETs to control relay ?
 

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.
 

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
**broken link removed**
 

Make it simple. A darlington setup is likely not necessary. Try a single NPN in a configuration like this:

**broken link removed**
 

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)
 

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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top