I use NXP
BC847C,215 NPN BJT transistors and
NX138AKR N-channel MOSFETs for similar purposes in my microcontroller circuits using 2.5V - 5V logic levels. NX138AK is similar to BSS138, but has a bit smaller gate charge, so switches faster.
I chose these basically because they suit my needs, they're cheap, NXP provides SPICE models that work in KiCAD/ngspice, and these are in SOT23-3 which my butterfingers can handle (even dead-bugging) but are not too large to use in prototype PCBs. (At Mouser, a hundred of each costs only 3.9€ and 5.5€, respectively.)
I use NX138AK as a low-side signal switch/inverting buffer, with source to ground, drain being the output with a pull-up resistor to positive rail. Then, the gate can be ±20V with respect to ground without breaking anything. Gate voltage of +2.6V or higher makes the MOSFET basically fully conduct (less than 4Ω on-resistance for currents below 100mA) so the pull-up resistor will be between positive rail and ground, and the output at ground. Gate voltage of 0V or less makes the MOSFET nonconductive, so the pull-up resistor pulls the output to near the positive rail. If I want the output to be low when the microcontroller pin (connected to the gate via a current-limiting resistor, typically 100Ω to 1kΩ to limit the current draw spike when the MOSFET changes state, the gate behaving similar to a capacitor) is floating (say, an input; or during startup), I add a pull-up resistor to the gate; if I want the output to be high, I add a pull-down resistor.
In comparison, the BC847C,215 NPN BJT only needs a current-limiting transistor on the base. When no current flows, the transistor does not conduct, so no pull-up/down resistor is needed on the base for the default case; and when the base is floating, the output is high. Emitter is connected to ground, and collector to positive rail via a pull-up resistor; collector is also the output. Base voltage of about +0.9V (at 5mA) is sufficient to pass 100mA from collector to emitter, but there is always a small voltage drop between collector and emitter, 0.1V-0.4V for this part depending on the base current and collector-emitter current.
The NPN BJT cannot pull the output as close to ground/the negative rail as the N-channel MOSFET can for low currents (< 20mA) at 3V logic. For higher current, the NPN BJT can pull the output closer to ground/the negative rail than the N-channel MOSFET can. At 10mA, the BC847C,215 BJT collector-emitter voltage drop is about 0.05V. For the NX138AK at 3V gate-source voltage, the drain-source resistance is about 3.5Ω, so the drain-source voltage drop is 10mA×3.5Ω = 0.035V. At 20mA, both drop 0.07V. At 50mA, the voltage drops are 0.1V and 0.175V, respectively.
I like using the NX138AK for voltage signal inputs (say, 10mA or less), because I know how it behaves for -20V to +20V input voltages, and for small currents the voltage drop is neglible. BC847C,215 is better for load switching (10mA - 50mA), especially for current-controlled loads like driving LEDs. For signal voltage level translation, I use dedicated ICs like TI TXU0n0m, 74LVC1T45/2T45/8T245, or even digital isolators like TI ISO6721 and so on. I do use
BC857C,215 PNP BJT for lowish currents, say < 50mA, and various higher power P-MOSFETs, for high-side switching, for example controlling positive supply to display modules, LEDs, and so on.