In the followig circuit I am trying to replace a push button with a transistor:
In the schematic SW1 is the push button that opens and closes the tray of a CDROM drive, V1 is the 5V power supply of the CDROM is the control board for the drive.
I want to control the tray operation with an arduino connected to the base of an NPN transistor with collector connected to V1 and emitter to P1. The transistor I'm going to use is a TIP120 (I know it's overkill for this operation but it's what I have lying around).
The problem I'm having is that I don't know how to calculate the value of the current limiting resistor that is needed between the arduino pin and the transistor base to prevent the transistor drawing too much current from the pin, damaging the pin.
According to all the documentation I read (one example http://www.zen22142.zen.co.uk/Design/bjtsw.htm) one needs to know the current that will flow across the transistor when it is on.
But in my case, I only know the voltage across the two terminals of the switch. I have no idea what's between P1 and P2 (i.e. inside the CDROM control board), and no idea of how much current is drawn when the switch is closed.
How do I calculate a safe resistor value for the base resistor in cases like this ?