I am trying to make a remote button presser, i would like to control the device to press a button remotely, so that i can restart a computer physically from far away (I know we have stuffs like IPMI to do the same thing properly, but i would like to make a microtroller project just for fun)
I understand that i can program a microtroller to send out signals, but what components I should attach to the output of the microtroller to make it achieve the functionality of pressy a button? a motor or something? Can someone please give me some advice? Thank you very much in advance.
There are many ways to do this, I would say the easiest and most reliable is wiring a relay in parallel with the button and using the microcontroller (uC) to activate the relay.
Most buttons just connect two wires together, so if you use a SPST relay, you can wire the output to each side of the button, turn the relay on and bam you just touched the button.
For starting off you can buy premade relay modules 1-RELAY DIGITAL MODULE 5V Arduino - Relay | Arduino Tutorial
If you want to go fancier the current running through the button is pretty small, so you can use a small signal or a reed relay, which means you wont need a transistor to drive it. Look for something with a coil current of under 15ma and it will work straight off an uC pin in most cases. Be sure to put a flyback diode reverse biased to dump the energy from the coil safely so it doesn’t blow up the uC pin later.
Option B if you want a more mechanical way to do it is to use a hobby servo, MICRO SERVO MOTOR SG90 / 9G 180 DEGREE
you connect it to a 5v supply (needs to be an amp or two capable, so you usually cant drive it off the uC’s 5v supply, but you should connect the grounds together) and connect the signal wire to a PWM capable pin on your uC, adjusting the pwm frequency will move the servo position, you’ll have to make a finger pusher dohickey but hey we have 3d printers and laser cutters. https://docs.arduino.cc/learn/electronics/servo-motors
Servos can be useful for all kinds of things: https://www.youtube.com/watch?v=pQ2dI_B_Ycg
There are a variety of Arduinos that are able to emulate keyboards. It might be simpler to remotely trigger a few keystrokes using that method than to use physical motors.
thank you for this idea. it will be useful when i run into a situation which i need to control a keyboard. however, in my case, i will need to do a hard reset by pressing the power button, the computer freezes in a way that any key board input is not responsive.
The computer probably does not respond to the keyboard input when the computer is hung because the interrupt from the keyboard is not processed when the computer is hung, which can also happen when the computer is not hung but temporarily has interrupts cleared/disabled, such as with the 0xFA x86 opcode (operation code) for the CLI = CLear Interrupts instruction, then STI = SeT Interrupts to set/enable interrupts again. Unfortunately I do not remember the opcode for STI, would have to look it up. Anyway, I do not know the specifics of your specific application but it sounds like you are trying to remove the symptom of the problem by rebooting/resetting a computer that hangs when it should not hang when the better solution seems like removing the cause of the problem by either making the computer not hang in the first place inclusive-or using a watchdog timer so that the computer will automatically reboot/reset if the software does not tickle the watchdog timer for too long to prevent the watchdog timer from rebooting/resetting the computer. I do not know the specifics about the computer you have that is hanging but I think some industrial/embedded x86 computers have an integrated watchdog timer feature if I recall correctly from some projects using industrial/embedded x86 computers, do not know if a consumer-oriented model of computer/motherboard will have this feature, though. The Windows NT series can also automatically reboot upon a bugcheck, which is the equivalent of a kernel panic on *nix, but that will not help if the computer hangs because of a fault that does not cause a bugcheck but I do not know which, if any, operating system you are using. The computer could also have at least one bad bit of memory, especially if using non-ECC RAM. If you are using an x86 computer and can still remotely access another computer that is able to access the x86 computer that has hung over a network then you may also be able to still remotely control the Intel Management Engine or the AMD Platform Security Processor that are basically a separate computer for out-of-band management on the same motherboard as the main x86 computer if the computer/motherboard you are using has these features. As far as I can tell, the Via Technologies x86 platform still does not have an equivalent of these features that Intel and, later, AMD added, if you consider them features as opposed to risks.
What may work for your application, and be simpler overall, you could use a microcontroller and wire it in directly to the Power/Reset pins on the motherboard in place of, or split off of, the front panel headers. Doesn’t require any soldering, but changes the problem from “press a physical button” to “complete the circuit” which is electronically WAY easier.