relay switching problem

Discussion in 'Power Electronics' started by ecworks, Jul 25, 2016.

  1. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
    hello Friends,
    I am doing an automation project.In it i use a PIR sensor for human detection with an input shift resister and atmega 32 controller...data communication is through Ethernet module...The output of the PIR sensor is 230v so i cant give it directly to the input shift resister so i used a AC relay(coil voltage is 230v). My problem is that when AC relay switch some time my controller going to stuck and stop communication, when i reset controller its start to work fine...so how can i solve this problem,when relay switch some time my controller going to stuck.here i attached the circuit of connection.I hope my friend can help me in this issue.. Thank you very much
    [​IMG]
     
  2. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    What is the purpose of the shift register?

    The first possible problem I see is that the relay contacts will bounce and generate multiple pulses to the shift register for each relay operation. To fix this you need a circuit like the one below. I don't know whether this will cause the uC lockup.


    [​IMG]
     
  3. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
     
  4. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
    Its a building automation project we used a number of sensors like PIR(230v),smoke sensor, door sensor etc.. all are controlled by atmega 32 controller...because of using so much sensors we use a input shift register ics and connect the sensors to the input shift register and read it by using controller...
    i already used a simple RC filter on the output of the relay,but it doesn't solved the problem...
    whats your opinion about a 275VAC MOV across the relay coil...
     
  5. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,951
    387
    If this problem only occurs when the relay is switched then the MOV is worth a try.
    Alternatively, ditch the relay and use an opto-isolator.
    You might also try more decoupling on the 5V supply and the 5V regulator input.
     
  6. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    Which Atmega 32 controller?
    How do you know the controller is stuck?
    Can you share the code? It may be a software problem.
     
  7. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
    yes... the circuit work fine with 5v PIR sensor... problem started after connect the 230v PIR sensor and 230v relay
    opto coupler idea sound good.. thank you very much for your valuable replies
     
  8. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
    controller is ATMEGA32A PU
    he circuit work fine with 5v PIR sensor... problem started after connect the 230v PIR sensor and 230v relay. I am using an Ethernet module for communication...after some relay switch the communication will lost and in command prompt i get "request timed out" or "destination unreachable" messages ..and the output light do not respond to the input PIR..After reset the controller it start work properly ,i get the ping in command prompt .... i dont think its software issue... i will share the code but its long one include other functions too.. thanks for your valuable replay sir
     
  9. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    I just noted that the other position of the relay is floating. It should be connected to the 5V supply ground. Otherwise, you cannot determine the relay position. Run it through a 4k7 resistor or greater to minimize current draw. Or even better, also connect the relay common terminal to ground via the resistor.
     
  10. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
    i pull down the input shift register,sorry it is not in the circuit..sorry for the mistake...and also i am using an RC filter 4.7k and 22nf capacitor.. but it cant solve the issue sir...
     
  11. eetech00

    Active Member

    Jun 8, 2013
    650
    112
    What is the part number of the AC relay you are using?
     
  12. ecworks

    Thread Starter New Member

    May 3, 2016
    11
    0
    hello sir, thanks for your reply...I attached below the picture of the relay i am using
    [​IMG]
    [​IMG]
     
Loading...