home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   sci.electronics.basics      Elementary questions about electronics      72,318 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 71,887 of 72,318   
   Jeroen Belleman to Niresh   
   Re: MCU reset during relay switches ON   
   03 Sep 20 20:34:58   
   
   From: jeroen@nospam.please   
      
   On 2020-09-03 08:34, Niresh wrote:   
   > Hi, Could any please suggest how to avoid MCU reset with voltage   
   > glitches/noise during relay switches ON. I have protected the relay   
   > coil with free wheeling diode and MCU with 2x10uF parallel with 100nF   
   > near VDD of MCU and 1uF across RESET pin.   
   >   
   >   
   > Regards, NiK   
   >   
      
   I'm hesitating to get involved, because I have no idea of your   
   level of knowledge and this is probably a can of worms.   
      
   It isn't hard to drive relays from an MCU, but you have to know   
   what you are doing. A schematic diagram, or even a picture of   
   your setup would have helped.   
      
   First of all, I suppose you are aware that the MCU cannot drive   
   the relay directly. You must use some sort of driver or buffer   
   stage. This can be as simple as an NPN transistor with a series   
   resistor in the base lead, but it could be more involved, depending.   
   I also assume that you know why and when a freewheeling diode is   
   needed.   
      
   Then there are grounding rules. Choose *one* convenient grounding   
   point. This may be the ground plane of the MCU board, if it has   
   one, or the negative terminal of the power supply, or some other   
   point. Every device should have its own connection to that point,   
   so that currents flowing back do not share the same conductor.   
   If your common ground point is some heavy large piece of metal,   
   you can relax that rule. The only real exception to this would   
   be the negative lead to the power supply.   
      
   Next are crosstalk issues. Bear in mind that current flows in   
   closed loops. Keep those loops tight, so that current flowing   
   towards a device follows as closely as possible the same path   
   as current flowing back. This is most easily assured by twisting   
   wires together. Do /not/ twist together wire pairs feeding /different/   
   devices.   
      
   Finally, sudden step changes in current may cause short drops   
   or surges in the power supply voltage. MCUs are often not very   
   forgiving on that point. Make sure that doesn't happen. Give   
   the MCU its own voltage regulator and provide enough capacitance   
   to keep the voltage within whatever it needs, even if the voltage   
   on the input side of the regulator jumps about a bit for a while.   
   About 10ms of hold-up time is usually enough.   
      
   Let us know how you fare.   
      
   Jeroen Belleman   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca