I want to switch (toggle) two devices using one GPIO pin and basic components. To achieve that I designed circuit containing one FET driving first device and two FET transistors for driving second device using inverter circuit. Design presented in attached picture:
I would like to figure out practical aspects about this circuit:
-
Is this correct solution for this simple problem? What can be improved?
-
Do I need resistors between GPIO and transistor gates? Or maybe pull down resistors for every gate? How will circuit behave when GPIO signal is floating (e.g. microcontroller boot time)?
-
What is the switching time between devices? Can I safely assume that only one device is always ON? Or maybe I should expect current spikes when devices are switching?
Best Answer
Given that you have 300 \$\Omega\$ resistors and what appear to be LEDs the current will be about 10 mA. This is within the capability of most micros' GPIO pins in sink or source.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Simplest switching circuit.
Not relevant in this configuration.
Both LEDs will glow dimly. There may be 2 or 3 mA flowing through the combination.
As quick as the micro GPIO.
See 2b.
There will be a current dip when switching as the two R-LED combinations are in series.
Back to the original question regarding the OP's circuit:
I don't play with FETs much but it looks OK except that your bottom FET isn't doing anything except posing a shoot-through risk during switching. Leave it out.