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.

Pic controlled Inductive Load

Status
Not open for further replies.

ibwev

Newbie level 5
Newbie level 5
Joined
May 12, 2013
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Shreveport, LA
Activity points
1,361
ContactorVaristor.png


I am having problems with RB4 remaining high after SW 1 is cycled and SW 2 is closed. RB4 will not go low again until SW 2 is opened. Would using a varistor (see schematic) help solve this problem?

The one in the diagram is MOV-07D820K. Varistor voltage is 82 V and Maximum AC volts is 50, Max DC is 65 and energy is 5.5J.

I am sure there is an easier way to switch an AC circuit using a pic. However, I am trying to control an AC relay from an existing circuit.
 
Last edited:

I'd hate to think what voltage you are putting on RB4 but I'm sure it's out of specification if you have 50V coming out of the transformer. Quite possibly you are creating a latch-up condition and that's why the pin sticks high.

Please explain how you think it should work and give some idea of how much current the relay coil needs. Also explain what the diode, 20K and 200K resistors are supposed to do. I assume you are using RB4 as an input so I can't understand why you connect it directly yet use an opto-isolator on RB5.

Brian.
 

It seems that you are trying to detect the AC or perhaps the zero crossing at RB4. May be to control the firing angle of the triac. But I dont understand why you want to do this for a relay.
Are you using a relay with an AC coil ? If not, the triac is not necessary and you can use a much simpler circuit.
The the voltage divider at rb4 should be recalculated or at least the 20K and 200k resistors should be reversed to get the voltage at rb4 within limits. A better solution would be a resistor and a zenner.
 
Last edited:

if you have 50V coming out of the transformer.
24 volt transformer

Please explain how you think it should work
I am trying to detect when SW 1 is closed at input RB4. Once SW 1 is closed, the pic will do a series of test. The led on RA5 will blink while the pic is testing. If the system passes the test, it will make RB5 high in which the relay should then close. Once SW1 opens, RB5 will go low and the AC relay should open. The led will then stop blinking.

give some idea of how much current the relay coil needs.
IMG_20130513_175958.jpg

Also explain what the diode, 20K and 200K resistors are supposed to do.
The diode and 20K resistor are suppose to reduce the AC voltage to a safe DC level into the RB4 CMOS pin of the PIC16F690. The negative part of the AC wave has been factored in the programming of the pic. The 200K resistor should serve as a pull down resistor.

I assume you are using RB4 as an input
Yes and RB5 is an output

I can't understand why you connect it directly yet use an opto-isolator on RB5.
SW1 will supply the voltage to the AC relay; however, the relay will not close unless RB5 goes high.

- - - Updated - - -

But I dont understand why you want to do this for a relay.
The relay is part of an existing circuit that I am trying to control. I can not alter the AC relay. It is pictured in post #4.

Are you using a relay with an AC coil ?
Yes

A better solution would be a resistor and a zenner.
Please suggest what size resistor and zenner.
 

So the sequence of events is:

1. SW1 is closed
2. PIC does some tests and flashes a LED on RA5
3. If the test passes, the relay is turned on.

Please confirm.

Questions:
1. Why do you need zero crossing to control the relay power?
2. The diode and two resistors are clearly not suitable and the PIC will almost certainly be damaged, if they are there just to sense voltage after SW1 is closed, why not use a conventional VDD/VSS connection as the PIC is controlling the relay anyway?
3. When you say you have "factored in" part of the AC waveform, are you saying you are trying to find the zero crossing point or trying to achieve some kind of phase control?
4. SW1 and SW2 seem to do almost the same thing, what specifically is SW2 for?

The comment about the Zener diode is to clip the voltage on RB4 to a safe level by adding it in parallel with the 200K resistor.

Brian.
 

The comment about the Zener diode is to clip the voltage on RB4 to a safe level by adding it in parallel with the 200K resistor.
Assuming that your VDD is +5v
A voltage divider for the 24Vac transformer can be 120K in series and 20K in parallel with Rb4. Which gives a little less of 5v. You can add a zener a little less than 5v (5.1v should work too) from rb4 to gnd.
 

PIC processors are usually specified to sustain +/- 20 mA clamp current at GPIO pins. In so fat the 20K series resistor shouldn't cause latch-up, but possibly unexpected lfunction of analog circuits inside the processor, e.g. ADC or RC oscillator. I would considerably reduce the current into the pin, just in case. Adding schottky clamps would be good design practice, but shouldn't be strictly required.
 

Sorry for delay in responding. Thanks for the help.

So the sequence of events is:

1. SW1 is closed
2. PIC does some tests and flashes a LED on RA5
3. If the test passes, the relay is turned on.

Please confirm.
That is correct

Questions:
1. Why do you need zero crossing to control the relay power?
It is not necessary
2. ... why not use a conventional VDD/VSS connection?
What is a conventional VDD/VSS connection? I am a newbie and don't know a lot about electronics.
3. When you say you have "factored in" part of the AC waveform, are you saying you are trying to find the zero crossing point or trying to achieve some kind of phase control?
The program does a series of test when RB4 is high. It will continue to test and/or make RB5 high until RB4 is low for 3 sinewave cycles. In other words, the program keeps testing and/or making RB5 high during the negative cycle of ac wave.
4. SW1 and SW2 seem to do almost the same thing, what specifically is SW2 for?
I put in SW2 to troubleshoot the problem I was having. It will not be there in final design.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top