Author Topic: Using a microcontroller as a Pushbutton  (Read 5153 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyFroncioniTopic starter

  • Contributor
  • Posts: 10
Using a microcontroller as a Pushbutton
« 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?
 

Offline tbscope

  • Contributor
  • Posts: 26
Re: Using a microcontroller as a Pushbutton
« Reply #1 on: February 05, 2012, 02:25:07 pm »
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.
« Last Edit: February 05, 2012, 02:30:58 pm by tbscope »
 

Offline Bloch

  • Supporter
  • ****
  • Posts: 456
  • Country: dk
Re: Using a microcontroller as a Pushbutton
« Reply #2 on: February 05, 2012, 02:25:36 pm »
Use a normal relay - then you are not sure about the rest off the circuit.
 

Offline vtl

  • Regular Contributor
  • *
  • Posts: 136
  • Country: au
Re: Using a microcontroller as a Pushbutton
« Reply #3 on: February 05, 2012, 02:34:27 pm »
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.
 

Offline AndyFroncioniTopic starter

  • Contributor
  • Posts: 10
Re: Using a microcontroller as a Pushbutton
« Reply #4 on: February 05, 2012, 02:41:33 pm »
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!
 

Offline AndyFroncioniTopic starter

  • Contributor
  • Posts: 10
Re: Using a microcontroller as a Pushbutton
« Reply #5 on: February 05, 2012, 08:35:08 pm »
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

Optoisolator as a switch:
http://www.arunet.co.uk/tkboyd/ec/ec1optoiso.htm
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 845
  • Country: se
Re: Using a microcontroller as a Pushbutton
« Reply #6 on: February 06, 2012, 02:22:56 am »
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?
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf