So I'm working on a science fair project and I need help with part of it. I'm using a pressure sensor, and I want to use the output of that as a toggle switch to allow power to something else. I'm taking the output of the pressure sensor, and I need help making it so when there is output on the pressure sensor, then the switch is open, and if there is no output, then it's closed.
Your choice of switch really depends on how much power you need to switch, the voltages you are dealing with, and how fast you need to switch it. For low frequency, high voltage switching you'll probably want to use a mechanical relay. Especially if you want to switch power from the mains. Pretty much every other application you'll want to use a solid state device. FETs are easy to use, cheap, and you can easily get ones that handle hundreds of watts. They also switch extremely fast, but I'm guessing this is not too important in your application because pressure does not change too quickly.
You will also need some basic circuitry to tell the FET when to turn on. The signal from your pressure sensor will vary continuously, but you want the switch to turn on all at once which requires the voltage at the base to jump instantly from OFF (OV) to ON (+V). You can use a comparator to do this.
The problem with using a straight up comparator is that when the signal from your pressure sensor crosses the threshold that causes the comparator to turn on your FET, noise in the signal can make the comparator rapidly flip between the ON and OFF state. An easy fix is to use a schmitt trigger to remove the noise from the input. It works just like a comparator, turning on the FET when the signal from the sensor reaches a certain value. The difference is that the threshold to turn ON and turn OFF are different. This prevents rapid switching around the threshold voltage.
There are two other things you have to consider when doing any type of switching. The first is power dissipation. You have to make sure your FET can handle the amount of power it will be dissipating. You might have to use a heatsink if you are switching lots of current. The other thing only applies if you are switching inductive loads like relays or motors. Inductive loads need a flyback diode to suppress voltage spikes that would otherwise destroy FETs or cause relays to flash over.