Hi Peter
Looking at a bog standard BC107 for example
http://www.farnell.com/datasheets/16619 ... 1485678472
Working on worst case scenarios
The information shows that this has a minimum current gain of 40 (hfe)
Using your 10K collector resistor
I= V/R
I= 5/10000
I= 0.5 mA
You can calculate Ib now
Ib=Ic/hfe
Ib=0.0005/40
Ib= 0.0000125
Ib= 0.0000125= 0.0125 mA
R= V/I
R= 24/0.0000125
R= 2.4 MΩ
this is how i do it there are other ways to do base biasing using a potential divider this helps the issues with the differences with the transistors hfe range.
Because the input is 24 volts i would use an opto because of the large size of base resistor and also the voltage level.
there is this too may help
http://www.nutsvolts.com/magazine/artic ... ook_part_1
to handle the reverse polarity is this the transistor base ?
i would use a small diode 1N4148 or similar dont forget the diode forward volt drop when calculating resistors
one of our suppliers of ups's / static switches uses an opto isolator for the emergency shut down input that is energised healthy so if any problem ie wire comes off then the unit shuts down.
Using an AC input opto isolator this would do your reverse polarity also
http://www.vishay.com/optocouplers/opto-ac-in/
hope this helps
Steve
Success always occurs in private and failure in full view.