unidentified problem !!!!!

Discussion in 'Embedded Systems and Microcontrollers' started by lesin akbar, Jan 9, 2008.

  1. lesin akbar

    Thread Starter Active Member

    Dec 16, 2007
    I've built a circuit containing AT89c51 along with 7 relays( for AC switching), relay is driven by ULN2003(12v). and the microcontroller is serially interfaced with the system. Now evrything works smoothly for "sometime". After that what happens no idea. If the ckt is restarted it works again. What could be the problem ? Ive noticed this thing in two other circuit also , that is when AC controlling comes, microcontroller goes MAD. Could it be solved by some sought of sheilding and all. In the earlier projects when this thing happend we completly isolated (perfect isolation) the motors and the ckt, all went in vain. Any one can please guide me ???????????
  2. SgtWookie


    Jul 17, 2007
    Do you have bypass capacitors on the microcontroller? Is your power to the relays isolated from the ULN2003?

    Energizing solenoids can draw heavy peak loads. Put a large cap across your relay supply bus. Watch out for reverse EMF spikes caused by de-energizing the relays.

    Your power supply might be marginal. If your supply voltage to the uC drops too low, it will malfunction.
  3. scubasteve_911

    AAC Fanatic!

    Dec 27, 2007
    Perhaps poor routing? A lot of people don't respect high di/dt traces and are surprised when it triggers their sensitive digital inputs

  4. lesin akbar

    Thread Starter Active Member

    Dec 16, 2007
    The routing intensity graph shows just fine. Ive given two capacitors after 7805 viz (100micro 25v) and (.01pf disc) which is the controller supply. And the supply to the relay and ULN is taken from just before 7805 viz 12v, and already there is a 1000microf 25 v capacitor present. And the voltage at my MC shows 4.99v i think thats good. So this is how my circuit looks, now where to make the difference. Will i have to draw another supply for the relay circuit alone.???

    No my power to relays is not isolated from ULN2003.
  5. eeboy

    Active Member

    Sep 27, 2007
    Just a thought...

    Maybe your problem is not at all related to EMI issues. Have you debugged the micro to verify your program counter is not off in never never land indicating an issue with the code? Perhaps the bit of code associated with the AC control causes some sort of stack overflow? Might be worth a look...
  6. jvjtech


    Jan 26, 2008
    Where Sgt. Wookie recommends caps on the relays I would add reverse biased diodes, 1N4002 or 1N4118 or similar, across the relays to suppress back emf spikes as the relays release. I would also try removing the relays and add leds with the appropriate dropping resistor in their place. The modified circuit can then be alowed to run, with appropriately simulated inputs to see if it locks up the same way as the unmodified circuit. This might give you an indication of whether the relays, pcb layout, decoupling caps (the lack of), etc. are the source of your problem or whether you have a more serious design error in the hardware or software. Regards.
  7. hgmjr

    Retired Moderator

    Jan 28, 2005
    The recommendations thus far have been provided without a schematic in hand. Is it possible to provide a schematic to assist us in guiding you through the troubleshooting effort?