PDA

View Full Version : PIC stop responding - Strange Problem!



financecatalyst
- 30th August 2009, 21:07
Hi
I am facing a very strange problem with my 12F635. I have made a circuit where PIC is controlling 4 relays. I have used RF modules bought cheaply over the internet.

My transmitter sends a simple signal and based on that the relay is operated at the receiver end.

The problem is that when I only operate one relay the receiver works fine and only one relay goes on/off. Sometimes even two work fine, BUT WHEN I switch on 4 relays all together, the PIC stop responding to any further command from the transmitter, it just goes blank and does nothing - leaves all 4 relays on. Same thing happens sometimes even if I switch on only two relays and I have to reconnect the powersupply to reset it.

Can someone tell me what could be the problem - Is it with the hardware?

I have checked the PICs on the breadboard and connected their Rx/Tx pin together by a wire rather than my RF modules and they work fine.

I wonder what happens to the receiver's PIC during relay operation.

phoenix_1
- 30th August 2009, 21:22
Post your schematic and electric work conditions..
Maybe we can find problem there...
Regards Robert

languer
- 31st August 2009, 01:59
Likely causes:

Voltage spikes/noise from relays and/or overcurrent causes Brownout on PIC
Voltage spikes/noise from relays induces garbage on receiver

As Robert suggested; interconnect diagram / schematic will help.

Things to consider:

How are the relays connected?
How much current do the relays require from the PIC's I/O?
Are the relays isolated from the PIC? How about from the RF Receiver?
How many times do you receive the send/receive the control commands?
Have you verified the TX PIC is still transmitting information and the RX PIC is not responding (this probably is the case, bust just to be safe)?
Just somethings to consider.

Jerson
- 31st August 2009, 06:23
I would hazard a guess here. Your power supply is not capable of maintaining the supply to your PIC when more than 1 relay is turned on. Due to this, your PIC gets either into a brownout condition or reset (if that is enabled)

Languer has made a couple of good points you should consider. Have you connected your relays directly to the PIC or are they driven by transistors external to the PIC?

financecatalyst
- 31st August 2009, 06:39
Likely causes:

Voltage spikes/noise from relays and/or overcurrent causes Brownout on PIC
Voltage spikes/noise from relays induces garbage on receiver

As Robert suggested; interconnect diagram / schematic will help.

Things to consider:

How are the relays connected?
How much current do the relays require from the PIC's I/O? -
Are the relays isolated from the PIC? How about from the RF Receiver?
How many times do you receive the send/receive the control commands?
Have you verified the TX PIC is still transmitting information and the RX PIC is not responding (this probably is the case, bust just to be safe)?
Just somethings to consider.

I am attaching the Schematic. Relays take 30mA. Command is sent as and when switch needs to be turned on/off.
Tx still transmits as when I switch the receiver off and then on again, it operates fine. It only happens sometimes when both relays are on and sometimes it works fine.

Jerson
- 31st August 2009, 08:47
The leds are shown the wrong way. If this is how you have them connected, they will not light up. But, this is a minor issue

Check your power supply. Remove the PIC and force both relays to on via jumpers. In this condition, what is the supply voltage to the input/output of the 78L05? Is the PIC Vdd being satisfied?

You do not have a decoupling cap across the PIC Vdd-Vss.

Acetronics2
- 31st August 2009, 09:01
Hi,

+1 for Jerson ...

AND, once more

Do not forget the .1or .22 µF cer capacitor as close as possible to the power pins ( 1-8 ) s

a 10µF tantalum at the 78L05 output won't be too much nor ...

instead of the Diode across relay coil terminals, a series RC really goes fine ... but some scope necessary to tune the values ... leaves the power lines much cleaner !

Alain

financecatalyst
- 31st August 2009, 13:24
The leds are shown the wrong way. If this is how you have them connected, they will not light up. But, this is a minor issue

Check your power supply. Remove the PIC and force both relays to on via jumpers. In this condition, what is the supply voltage to the input/output of the 78L05? Is the PIC Vdd being satisfied?

You do not have a decoupling cap across the PIC Vdd-Vss.

Thanks for thr reply Jerson. After I switch all 4 relays on, 78L05 input/output is left with 10.9V, still having 5V for PIC.

Should I increase the resistance for the LEDs as well?

aratti
- 31st August 2009, 14:06
Tray adding the two capacitors and one diode as per the attached schematics.

It should cure the problem.

Al.