Electronic – PIC16F690 not working properly

inductivemotornoisepic

I am performing some experiments to drive n different inductive loads using the following circuit based on the PIC16F690.

The Power Supply part:

enter image description here

  • 12VAC and 24VAC come from the same power transformer. Regulator is 7805.
  • VSS and GND are common Grounds.

The control part:

enter image description here

  • A PIC16F690 with a Darlington array and a Schmitt trigger inverter are used to drive n inductive loads (Contactors CTC 1 … CTC n).

  • The 24VDC relay is used with an external AC Contactor to switch a 400VAC 3Ph Motor

  • **The PIC and Schmitt trigger Vdd and Vss pins are not shown here due to Proteus limitation, same for the ULN2804 GND PIN ** however i included additional 100nf ceramic capacitors between Vdd and Vss for both of them with the minimum leads possible.

The inductive load part:

enter image description here

  • The above circuit apply for each Out1 … Out n output in the ULN2804 to drive multiple inductive loads.

Notice that all the circuit shown to you here are in the same single face PCB.

Problem encountered:

After burning the circuit in a single face PCB i faced no problems and everything was working as expected until i realize that if i switch the Power supply OFF then ON the PIC won't starts and looks like blocked until i perform a hard reset using the MCLR button (sometimes i need to push the button multiple times !) after that the PIC get back to life, and everything return to normal.

I use the following FUSES XT,PUT,WDT,NOPROTECT,BROWNOUT,MCLR

What i did try so far:

  • Trying different type and values of capacitors near the PIC VDD/VSS and 7805 power regulator as i suspected a bad decoupling but without success.

  • I found out that when i switch the power OFF then ON before the Capacitors in the circuit discharge (last about 1 second), the PIC work without problem at the first shoot.

  • I found out too that when using the PIC in the same PCB to flash only some LEDs using some sensors or Potentiometers, everything is fine, however, if i switch one inductive load or a relay, the problem shows again.

As I'm only a hobbyist and printing PCBs is expensive in my region, i really need your help to find out what is wrong to avoid such problems in future. I'm curious to know what is the cause of the problem. Can anyone tell me what could be wrong here, please?

Thanks in advance.

Best Answer

There is so much messed up in the schematics, that it's pointless to read the words and delve into this more deeply. Fix the obvious things first, then come back.

  1. What voltage is Vdd supposed to be in the top left schematic?
  2. What regulator is being used in the top left schematic?
  3. Is that regulator really OK with just a electrolytic cap on the input? It probably wants something with low ESR. The electrolytic may be fine for bulk storage between power line cycles, but there should probably be a 10 µF ceramic right in front of the regulator in addition.
  4. The full wave bridge in the top right schematic is hooked up wrong. It will short the AC every other half-cycle. The transformer will get quite warm or the diodes will blow out.
  5. I can't even begin to guess what you think D19 is supposed to accomplish.
  6. 24 VAC (assuming sine) full wave rectified is going to be more than 24 V DC, even accounting for two diode drops in a correctly connected full wave bridge.
  7. You forgot to connect power to the PIC. It's not going to run without power. This really should be obvious.
  8. A 1N4001 is not a good choice for the flyback catch diode for the relay coil, although it will probably work OK in this case if you don't try to turn the relay on again shortly after having turned it off.