KhaledOsmani
Full Member level 6
- Joined
- May 4, 2014
- Messages
- 384
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 18
- Activity points
- 3,933
first never connect pic directly to a relay use at least 74hc244nHi,
There are many possible causes and many possible cures.
However you need to post a detailed schematic, your program code and preferably a picture of your actual pic and relay wiring layout for anyone to make an informed suggestion as to the actual cause/s .
Assuming you have them fitted, the most likely cause of the problem you see is noise on the supply line or the reset line. Take care with the wiring so none of the relay current can flow back to the PIC VSS pins and be sure to add capacitors across VSS and VDD (both pairs) as close to the PIC as you can. I suggest a 100nF ceramic capacitor and an electrolytic capacitor of 1uF - 10uF in parallel is used.
Unless the load wiring is located very close to the PIC, I don't think it has any relevance to the problem. All the issues are on the coil side of the relay, not it's contacts.
Brian.
Hello,
My advice would be to add a couple capacitors to the circuit. (2x10uF and 5x0.1uF should give a noticeable improvement.) Whenever you switch something on you create a power draw, but for a short amount of time there is not enough power on the line so the voltage suffers to compensate. Capacitors are like batteries, they store a small amount of energy at a certain voltage. If the line drops below that voltage it discharges to try and bring the voltage back up. Then the power supply catches up and recharges the capacitor.
I hope this helped.
, as close as possible to it, wire a 100nF ceramic capacitor AND at least a 1uF capacitor in parallel. The capacitors at each of the VSS/VDD pins work as local voltage reservoirs, they even out the changes in voltage and make the PIC less susceptable to the variations along the supply lines.
Brian.
The capacitors go between VDD and VSS. I would use ceramic capacitors for the 0.1uF capacitors these are not polarized so either lead can be connected to ground. For the 10uF capacitors, I would use electrolytic capacitors. These are polarized. So one pin must be connected to ground (VSS) and the other lead to the positive side (VDD). The lead that connects to ground is usually marked with a bar or a strip. I always recommend using capacitors that are rated at two or three times the voltage of VDD.
The capacitors can go anywhere really but they are more effective the closer they near the device that is doing the switching. So I may put 3 0.1uF capacitors near the microcontroller the rest near the relays or the power supply. Then put 1 more near the LCD and each of the sensors.
The distance of the wires may cause interference and speed issues, but for power its not really an issue at all.
You can use the same supply, just make sure that it can supply enough current for everything. If you pull too much some supplies try to cut off to prevent damage to the supply. Just a friendly reminder, if you use private supplies you need to connect the grounds together so that everyone can talk to each other.
Isn't adding capacitor, one pin connected to Vss the other to Vdd, is an act of short-circuit?
What do you mean put capacitor for power supply/lcd/ etcc.....
The capacitors can go anywhere really but they are more effective the closer they near the device that is doing the switching. So I may put 3 0.1uF capacitors near the microcontroller the rest near the relays or the power supply. Then put 1 more near the LCD and each of the sensors.
For the relays you place 2 10uF capacitors and 2 0.1uF capacitors as close as possible to it, between its VDD and VSS connections. This is to suppress the massive load swings caused by activating the relays.
What is the point of connecting 100nf ceramic parallel with bunch of 1uf electrolyc between vss and vdd why not getting enough from 100nf. Or else why not to put only one capacitor equivalent of these many paralleled capacitors?
why to have ceramic and electrolytic?
same output concerning sensors after addition of 0.1uf between each sensor VSS and VDD (note I still not connected capacitors with the regulator circuit)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?