How do I get my Sensor Switch transistors

Thread Starter

RodneyB

Joined Apr 28, 2012
698
It's far better if you use a power adapter, since I'm under the impression that you intend to use your device continuously. Also, efficiency would cease to be a concern and the design would be far simpler.
Question #2, how do you intend to mount the components? Can you make your own PCB's?
I can make my own PCB's. I would prefer through hole mount as easy for learning
 

cmartinez

Joined Jan 17, 2007
8,765
Ok then. What you're asking for is so easy that I'll be more than glad to help you design it. Give me a few hours and I'll post the basic diagram here.
 

cmartinez

Joined Jan 17, 2007
8,765
Ok Rod, here's a preliminary diagram.

Your sensor's output is connected to a series of comparators connected in parallel. The comparators will pull their outputs down when their positive inputs are greater than their negative inputs. Te resistors and trimpots have been configured as voltage dividers to give a maximum adjustable input voltage of 3.3V to the negative inputs of the comparators. This is because that's the maximum output voltage of your sensor. By adjusting each trimpot, you can set the comparator's trigger point to any value that you want.

Remember that the comparators have inverted outputs, that is, their outputs will go low (0V) when they're activated, and will stay high (+5V) when they're disactivated.

For instance, if you want the comparator to pull their outputs down when your sensor's voltage is 1.65V, then you adjust the trimpot to 25K.

Capture.JPG
 

ScottWang

Joined Aug 23, 2012
7,501
Ok Rod, here's a preliminary diagram.

Your sensor's output is connected to a series of comparators connected in parallel. The comparators will pull their outputs down when their positive inputs are greater than their negative inputs. Te resistors and trimpots have been configured as voltage dividers to give a maximum adjustable input voltage of 3.3V to the negative inputs of the comparators. This is because that's the maximum output voltage of your sensor. By adjusting each trimpot, you can set the comparator's trigger point to any value that you want.

Remember that the comparators have inverted outputs, that is, their outputs will go low (0V) when they're activated, and will stay high (+5V) when they're disactivated.

For instance, if you want the comparator to pull their outputs down when your sensor's voltage is 1.65V, then you adjust the trimpot to 25K.

View attachment 89174
Why you not choose LM2901 or LM339?
 

ScottWang

Joined Aug 23, 2012
7,501
Good point Scott. Yes, those comparators are compatible with Rod's application too. Both chips that you mention are quad comparators, so maybe less components will be needed for the TS's project.
My previous previous boss given me over 50 pcs LM324 4 op amps, so I like to use it to replace the comparator ... :D
 

Brownout

Joined Jan 10, 2012
2,390
I have no idea where to begin
If you connect 5 resistors in series, say 10k ohm each, and connect the string between VCC and ground, you will create a voltage divider to use as references to each of your comparators. Take the voltage from the junctions of each resistor and connect to your conparators. The voltages will be .66V at the top of the resistor connected to ground, and +.66V for each up the ladder. The total current will be 3.3V/50kohms = 66uA. You'll need comparators with input bias currents in the order of a 1-2 uA max.
 

Brownout

Joined Jan 10, 2012
2,390
Oops, I made too many references. Use 4 resistors, and you'll get .82V + .82V at each jucntion. You can use a smaller value 5th resistor connected at the ground to adjust these voltages up a little.
 
Last edited:

cmartinez

Joined Jan 17, 2007
8,765
If you connect 5 resistors in series, say 10k ohm each, and connect the string between VCC and ground, you will create a voltage divider to use as references to each of your comparators. Take the voltage from the junctions of each resistor and connect to your conparators. The voltages will be .66V at the top of the resistor connected to ground, and +.66V for each up the ladder. The total current will be 3.3V/50kohms = 66uA. You'll need comparators with input bias currents in the order of a 1-2 uA max.
Yeah, that would be the simplest and easiest of arrangements. But the circuit would lose its capability of being adjusted on the spot... I don't know how important that would be for the user, though.
 
Last edited:

Brownout

Joined Jan 10, 2012
2,390
Since the TS doesn't mention adjustability, I try to suggest the most simple solution. BTW, for the values in your circuit, the maximum reference voltage is 1.98V.
 

cmartinez

Joined Jan 17, 2007
8,765
You're absolutely right... my bad, I didn't calculate correctly.

For a maximum reference of 3.3V, we have the following calculations under no load:

resistor voltage divider equation:
Vo = Vi*R2/(R1 + R2)

If Vi=5V, Vo=3.3V, R2=50,000 Ω then
R1 = R2*(Vi/Vo - 1)
R1 = 25,757 Ω

So a value of around 27K (the closest commercial value) would be more adequate for that, instead of the 33K .
With 27K instead of the 33K we'd get a 3.27 V maximum reference output in my circuit, which I think should be pretty acceptable.
 

Thread Starter

RodneyB

Joined Apr 28, 2012
698
Ok Rod, here's a preliminary diagram.

Your sensor's output is connected to a series of comparators connected in parallel. The comparators will pull their outputs down when their positive inputs are greater than their negative inputs. Te resistors and trimpots have been configured as voltage dividers to give a maximum adjustable input voltage of 3.3V to the negative inputs of the comparators. This is because that's the maximum output voltage of your sensor. By adjusting each trimpot, you can set the comparator's trigger point to any value that you want.

Remember that the comparators have inverted outputs, that is, their outputs will go low (0V) when they're activated, and will stay high (+5V) when they're disactivated.

For instance, if you want the comparator to pull their outputs down when your sensor's voltage is 1.65V, then you adjust the trimpot to 25K.

View attachment 89174
Thank you for this. I will try and by the various components today. Being able to adjust the settings, makes so much sense. This will allow me to monitor and switch under different conditions.
 

cmartinez

Joined Jan 17, 2007
8,765
Thank you for this. I will try and by the various components today. Being able to adjust the settings, makes so much sense. This will allow me to monitor and switch under different conditions.
And btw, you can add more stages if you like, you don't have to settle for just 5. If you get quad comparator chips, with just a couple of chips you'd be able to set 8 divisions.
Another question, what do you intend to switch with the outputs? Relays, electrovalves? of what voltage and capacities?
 

Thread Starter

RodneyB

Joined Apr 28, 2012
698
And btw, you can add more stages if you like, you don't have to settle for just 5. If you get quad comparator chips, with just a couple of chips you'd be able to set 8 divisions.
Another question, what do you intend to switch with the outputs? Relays, electrovalves? of what voltage and capacities?
I am wanting to switch mosfets. Which in turn will switch in a fan or a humidifier. I will also have a 5 input gsm module that will notify me when a condition is active.
 
Top