Electronic – Switching between two devices

circuit analysisinvertermosfet

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:

Proposed circuit

I would like to figure out practical aspects about this circuit:

  1. Is this correct solution for this simple problem? What can be improved?

  2. 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)?

  3. 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

  1. Is this correct solution for this simple problem? What can be improved?

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.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Simplest switching circuit.

2a. Do I need resistors between GPIO and transistor gates? Or maybe pull down resistors for every gate?

Not relevant in this configuration.

2b. How will circuit behave when GPIO signal is floating (e.g. microcontroller boot time)?

Both LEDs will glow dimly. There may be 2 or 3 mA flowing through the combination.

3a. What is the switching time between devices?

As quick as the micro GPIO.

3b. Can I safely assume that only one device is always ON?

See 2b.

3c. Or maybe I should expect current spikes when devices are switching?

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:

Is this correct solution for this simple problem? What can be improved? [And from comment:] What if there is something with higher currents than 10mA?

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.