2019_cargo_present_sensor
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 2019_cargo_present_sensor [2019/02/21 23:32] – [Inverting the sensor output] tell | 2019_cargo_present_sensor [2019/02/24 22:51] (current) – [combining open-drain outputs to make a logic gate] tell | ||
|---|---|---|---|
| Line 64: | Line 64: | ||
| ===== An inverter with one transistor ===== | ===== An inverter with one transistor ===== | ||
| + | Here's the basic idea: | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | The 2n7000 is a " | ||
| + | * Source, (pin 1 above) which we connect to ground, or the most negative voltage. | ||
| + | * Gate (pin 2), an input. | ||
| + | * Drain (3), into which current can flow | ||
| + | |||
| + | When the gate is connected to a positive voltage (with respect to the source) the source and drain are connected, and current flows from drain to source. | ||
| + | |||
| + | When the gate is low (near ground potential or zero volts) the transistor is off, and the pullup resistor | ||
| + | provides a tiny bit of current to pull the output up to a 5 volts, representing a logic 1. | ||
| + | |||
| + | For a few more details on discrete mosfets for logic, see [[mosfet hints]]. | ||
| + | |||
| + | |||
| + | ===== combining open-drain outputs to make a logic gate ===== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Finishing up: | ||
| + | |||
| + | Instead of pullup resistors, we can use a resistor in series with an LED. In fact, we can connect the output of this gate to one of our [[DIO tester and breakout]] boards. | ||
| + | |||
| + | If we build anything with mosfets as a standalone board, we never want to connect a mosfet gate only to an input connector (as drawn above for clarity). | ||
2019_cargo_present_sensor.1550809956.txt.gz · Last modified: 2019/02/21 23:32 by tell
