EEVblog® Electronics Community Forum
Electronics => Microcontrollers => Topic started by: AndyFroncioni on February 05, 2012, 02:04:01 pm
-
I have this device that uses a momentary pushbutton. I want to replace the manual activation of this button with an automated closing of the switch, using an AtMega328p.
Will I need a solid-state relay? The switch needs to be shorted, but I think I should isolate its voltage levels from the main board, right?
-
In general a relay is a good idea.
What voltage and current are you talking about?
The voltage and current a microcontroller can supply is very limited.
If you don't need isolation, a transistor can be sufficient too.
Watch out with how much current you need to operate the relay, especially if you add multiple relays to the microcontroller.
-
Use a normal relay - then you are not sure about the rest off the circuit.
-
You can use an optoisolator if you like. Will not be as power hungry as a relay if you just want to switch a signal.
-
Options are: normal relay, opto-isolator, and transistor. The choice depends on the current that will likely be flowing through the switch. Got it.
Thank you very much for your answers, folks!
-
Just to close the loop on this question... Now that I had your help for determining the search-space, I looked up the details on the innerweb:
Transistor and relay as a switch:
http://www.kpsec.freeuk.com/trancirc.htm (http://www.kpsec.freeuk.com/trancirc.htm)
Optoisolator as a switch:
http://www.arunet.co.uk/tkboyd/ec/ec1optoiso.htm (http://www.arunet.co.uk/tkboyd/ec/ec1optoiso.htm)
-
What you should depends very much on what the button actually does. If it just connects to ground or the positive rail and doesn't carry a large current, and the Atmega328 is running on the same voltage as the rest of the circuit, you might be able to drive it directly with an IO pin. If it does source/sink a relatively large current, an external transistor might be preferable. If you need isolation or the switch is connected through a more complex arrangement (such as matrix arrangement to use more buttons than there are IO pins on the controlled system's microcontroller) you'll typically need an optocoupler or transistor. If you need isolation, an optocoupler or relay is needed.
In short, it all depends. Maybe you could tell us a little bit about your actual application?