3
\$\begingroup\$

I am currently trying to design a circuit that makes it possible to either pull up a line to 5V or pull it down to ground depending on the signal of a microcontroller. The resistor needs to be 1K to pull it up and 1k to pull it down. I am currently thinking of using 2 pins on my microcontroller, one for each FET.

Do any of you have any experience with this or know a circuit that makes it possible? I drew something in spice shown below, but I can't seem to get the concept to work.

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ Hi What exactly don't work? You could try and switch position between M2 and R2. \$\endgroup\$ Commented Feb 24 at 13:40
  • 3
    \$\begingroup\$ Why not just a 1k resistor in series with your uC digital line (that appears to already be toggling between 0 and 5V)? 5 mA ought to be fine for many uC's. \$\endgroup\$ Commented Feb 24 at 13:45
  • \$\begingroup\$ @ChrisKnudsen didn't think about that, i'll try it out! \$\endgroup\$ Commented Feb 24 at 14:22
  • 1
    \$\begingroup\$ What is the 1k requirement based on? Do you need a 1k impedance specifically or has some information source said that you need in maximum of 1k to pull it down or up or something else. If you can tell us what it is that you are pulling up or pulling down ie what is the output load it may help us answer the question more easily. Several people have mentioned using 1k resistors but it may be that a more or less direct drive from the microcontroller would be adequate. \$\endgroup\$ Commented Feb 24 at 14:33
  • \$\begingroup\$ Of course it's worth noting that many microcontrollers will have integrated pull-ups/pull-downs, often programmable. \$\endgroup\$ Commented Feb 25 at 9:02

4 Answers 4

3
\$\begingroup\$

Normally you'd be concerned with shoot-through if you want to control the two MOSFETs from the same signal, but the presence of the two 1kΩ resistors means that shoot-through current will be limited, and this is perfectly OK:

schematic

simulate this circuit – Schematic created using CircuitLab

Apart from the common gate control signal at IN, the main difference from your design is that the MOSFETs are connected with sources directly tied to the supply rails. As you drew it, the two MOSFETs are source followers, meaning that they don't switch fully on or off.

This solution can sink or source tens, maybe hundreds, of milliamps of current, but I feel that it's more likely you'll need just a few milliamps, in which case Michal's single-resistor solution is probably fine, and beautifully simple.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ A potential problem with this approach is that there is no "off" state where the signal line is floating - not pulled to either rail. The OP did not say if this is a requirement, but it was possible with his approach. \$\endgroup\$ Commented Feb 24 at 14:42
  • \$\begingroup\$ @AnalogKid Agreed. A possible solution for this would be (if you have an extra available I/O pin) to connect each MOSFET to its own I/O pin and control each independently. This can even avoid the shoot-through if you sequence them properly in the software. \$\endgroup\$ Commented Feb 25 at 23:59
7
\$\begingroup\$

If it is going about 5mA you can pull with Mcu pin directly: enter image description here

If higher current is needed use a two mosfet buffer connected to Mcu pin.

\$\endgroup\$
4
\$\begingroup\$

This is how it ought to be done if you require precision: -

enter image description here

This avoids the MOSFETs not being activated fully and ruining the impedance value that is meant to be 1 kΩ i.e. the MOSFET would introduce significant impedance due to them not being activated correctly when a load connects to the output and causes current to flow.

\$\endgroup\$
3
\$\begingroup\$

Ideally, your FETs should connect to the rails, and the 1k resistor(s) to the data line.

Rather than use two MCU I/Os to drive two FETs, you could use a single MCU I/O to drive a single 1k resistor to the line in question, with the I/O configured as output high, output low, or input if you also want no pullup. Almost all MCUs will source or sink 5 mA from their I/O pins, even newer 'low power' ones.

\$\endgroup\$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.