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.

Problem with using PIC18F252 for driving a relay output

Status
Not open for further replies.

ric_vas

Member level 4
Joined
Jun 30, 2005
Messages
71
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,663
Hi,

I'm using a 18F252 PIC to drive a relay output like the picture below:

**broken link removed**

When I first apply power to the board the relay switch for a short time. If I change the base resistor to a bigger one it stops (i assume base current gets lower). What is the explanation for this? How can I avoid this behaviour without compromise the relay current?

Thanks in advance.

Ric

P.S PIC software is not doing any write to outputs at the beggining (not intentionally at least)
 

Re: PIC output - Relay

It may mean that the Power On Reset signal has not yet forced the output drivers to known states and/or disabled internal pullups ..
You can call it a gap in output pin tracking (Vcc ramp), as the pins remain unconfigured until the configuration point ..

Regards,
IanP
 

Re: PIC output - Relay

Hi IanP,

I was thinking about this possibility. I've tried to insert a pull down resistore right before transistor base but it make no difference (maybe it was not the correct value though).

Any idea how to avoid this?

Ric
 

Re: PIC output - Relay

ric_vas said:
Hi IanP,

I was thinking about this possibility. I've tried to insert a pull down resistore right before transistor base but it make no difference (maybe it was not the correct value though).

Any idea how to avoid this?

Ric


You have a low-high-low spike on your IO output at power on, called transitory spike.Without any changing in your schematic you may avoid that using an RC filter between the IO output and transistor input and/or choosing carefully the software delays between defining the IO port as output and pull down moment.

Try IO to 2k2 + 47nF...100nF to ground. The resistor from the transistor's base connected to common point 2k2+47nF. This delay will be added also every time when relay will be connected. However the best relay you may get, it has more than 8mS between the coil supply time and contact make/brake.
 

Re: PIC output - Relay

if i was you i would change the npn transistor for a pnp type and then you would put a pull up resistor from the base of the transistor to vcc, this will hold the relay off until you changed the pic output pin to a low state.
 

Re: PIC output - Relay

I'll try the RC net and let you guys know.

Ric
 

Re: PIC output - Relay

Try this configuration it works well for me.
For more relays you need to look into possibilities of OCTAL High Side Drivers.
 

Re: PIC output - Relay

Hi "ric_vas"

Have you tried the RC filter Combination on the pin.....
let us know....
 

Re: PIC output - Relay

Hi,

I didn't have much time to work on this today. I've tried a 47nF capacitor as suggested. No significant change.

I'll try some more values tomorrow.

Regards,

ric
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top