windoze killa
- Joined Feb 23, 2006
- 605
Well........ I hope the moderators do something about this.Originally posted by wigginzhang@Mar 16 2006, 03:07 PM
EDITED
[post=15043]Quoted post[/post]
Well........ I hope the moderators do something about this.Originally posted by wigginzhang@Mar 16 2006, 03:07 PM
EDITED
[post=15043]Quoted post[/post]
It seems to me that you maybe drawing a wee bit too much current through the relay. Try putting a resistor in the emmitter of the transistor. Something around 100ohms. You could use a pot and adjust it until you find a point the the relay reliably switches but the circuit doesn't lock up.Originally posted by Hurdy@Mar 17 2006, 01:49 PM
Papa I have built the circuit you provided me and I have a new problem.
When the output pin of my PIC goes HIGH and it triggers my relay, my clock resets itself. Is this because my output pin has been pulled to ground?
I have attached a copy of the datasheets for the components I am using along with a modified circuit diagram. I assumed they should all work fine for my requirements, though I have been told they are a bit overkill for what I need.
Do you think I have got a wrong component or is it a fault of the PIC?
The datasheet for the PIC says it can do Port B 100ma.
Also you should note that I put a continuity test across my two switching pins of my relay to make sure it is swithes. It switches, but sometimes it will quickly switch on and off, and every once in a while it will switch and stay switched and not switch off until I take power away from the circuit. When it stays switched it causes my 7 segments to all go off except for 1 where it goes quite silly and dim ish.
[post=15073]Quoted post[/post]
No this is because the relay coil does not have enough DC resistance and you are effectively dragging your Vcc down. The PIC can sense this condition of the supply dropping and it puts the processor into RESET. Some relay coils are designed to work without additional DC resistance because of the way they are wound and some are not. What you need to do is figure out how much DC current is required to hold the relay on, measure the DC resistance of your coil and pick a resistor with an appropriate power rating so you get the desired current in the coil.Originally posted by Hurdy@Mar 16 2006, 10:49 PM
Papa I have built the circuit you provided me and I have a new problem.
When the output pin of my PIC goes HIGH and it triggers my relay, my clock resets itself. Is this because my output pin has been pulled to ground?
I have attached a copy of the datasheets for the components I am using along with a modified circuit diagram. I assumed they should all work fine for my requirements, though I have been told they are a bit overkill for what I need.
Do you think I have got a wrong component or is it a fault of the PIC?
The datasheet for the PIC says it can do Port B 100ma.
Also you should note that I put a continuity test across my two switching pins of my relay to make sure it is swithes. It switches, but sometimes it will quickly switch on and off, and every once in a while it will switch and stay switched and not switch off until I take power away from the circuit. When it stays switched it causes my 7 segments to all go off except for 1 where it goes quite silly and dim ish.
[post=15073]Quoted post[/post]
You need to look at the DC resitance of the coil. Add a resistor in series to get the current you want. Leave the diode across the coil or the inductive kick will damage things.Originally posted by Hurdy@Mar 16 2006, 11:26 PM
Ok back again. I have done some testing and playing around with the circuit. I threw out the transistor, resistor and diode circuit you gave me. Connected the circuit so that the + input of the relay is connected to the output of my PIC and the other side of the relay to ground.
When the output of my PIC is LOW, there is no continuity between the relay switching pins. When my PIC goes HIGH, the relay switches and I get continuity between my switching pins as I should and then when my PIC output pin falls LOW again the relay switches off as it should.
So from my testing it is something to do with the relay driver that is causing the problem. Any ideas? I would like to implement a feature that will prevent any back flow damaging the PIC.
[post=15078]Quoted post[/post]
I'm surprised the coil resitance is that high, and still collapsed your power supplyOriginally posted by Hurdy@Mar 16 2006, 11:45 PM
I calculate this.
V = 5.5
I = 40ma
5.5 / (40x10^-3) = 137.5 ohms
I take it I have to take away my coil resistance from this?
137.5 - 125.7 = 11.8 ohms
Is this how you do it?
[post=15082]Quoted post[/post]
Sorry about that. The 100ohms was a starting point to work down from. If you try something around 18 to 33 ohms between the relay and supply it should work fine. Obviously if 150 is the smallest you have you will have to buy something.Originally posted by Hurdy@Mar 17 2006, 03:28 PM
I also tried what windoze killa said but I only have a resistor as low as 150 ohms. The relay didn't switch at all though .
[post=15086]Quoted post[/post]
Yes, I think that should work. You also might want to double check the diode polarity. The cathode should be connected to the supply, and the anode to the collector of the transistor. When the transistor turns off, the diode should absorb the energy from the coil and prevent it from going more than 0.7V above the supply. If your supply is 5.5V then this inductive kick should be limited to 6.2VOriginally posted by Hurdy@Mar 16 2006, 11:45 PM
I calculate this.
V = 5.5
I = 40ma
5.5 / (40x10^-3) = 137.5 ohms
I take it I have to take away my coil resistance from this?
137.5 - 125.7 = 11.8 ohms
Is this how you do it?
[post=15082]Quoted post[/post]
I was trying to tell you that the 12 ohm resistor in series with the relay coil will dissipate 19.2 milliwatts when 40 mA flows through it.Originally posted by Hurdy@Mar 17 2006, 12:11 AM
The nominal power for the relay is 200mW.
Sorry Papa, what are you telling me to try?
Papa I have discarded the transistor, and resistor and all works fine.
Do you think maybe the transistor is pulling too much?
Is the transistor needed to protect the PIC, or is just the diode fine?
[post=15085]Quoted post[/post]
by Aaron Carman
by Duane Benson
by Aaron Carman
by Jeff Child