How do I get my Sensor Switch transistors

Thread Starter

RodneyB

Joined Apr 28, 2012
698
Of what voltage will your fan or humidifiers be?
The humidifier is a 220 Volt one bought at the local Chemist. The fan is as well. Both draw les than 5 Amps. I have made a solid state relay so thought I may use those.

The other outputs are an indicator probably using an LED and a 12 Volt Siren
 

cmartinez

Joined Jan 17, 2007
8,768
The humidifier is a 220 Volt one bought at the local Chemist. The fan is as well. Both draw les than 5 Amps. I have made a solid state relay so thought I may use those.

The other outputs are an indicator probably using an LED and a 12 Volt Siren
Then I strongly suggest you do not use mosfets for this application, but triacs instead. They're far cheaper and easier to drive, and are excellent for rugged hv applications with inductive loads. Let me check which triacs and drivers are good candidates and then I'll get back to you.
And btw, you won't need an ssr for this either.
 

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

Hi

I am not looking a gift horse in the mouth and greatly appreciate exactly what you have done for me. So this is just a question not trying to be funny or anything untoward.

The incoming supply is fed from the 7805

Pin1 Input
Pin2 Gnd
Pin3 Output

I am not sure if I am miss reading the drawing but I am used to doing it like the attached
 

Attachments

cmartinez

Joined Jan 17, 2007
8,768
Hi

I am not looking a gift horse in the mouth and greatly appreciate exactly what you have done for me. So this is just a question not trying to be funny or anything untoward.

The incoming supply is fed from the 7805

Pin1 Input
Pin2 Gnd
Pin3 Output

I am not sure if I am miss reading the drawing but I am used to doing it like the attached
:eek::confused:... boy am I glad you were paying attention... yes, you're absolutely right. Pin numbers is something that completely escaped me when I drew the thing... from now on, no more pin numbers in my diagrams... :p
On the other hand, your sensor's datasheet says nothing about pin assignments.

Anyway, here's the corrected one, including resistor values and LED polarity. Give me a couple of hours and I'll post the triac circuit that I suggest you use to switch whatever you want at 220VAC, instead of the more bulky and expensive SSR.

Capture.JPG
 
Last edited:

bertus

Joined Apr 5, 2008
22,928
Hello,

When you have a led (inside the MOC) with a resistor to the + of the powersupply, the resistors 12 to 16 are not needed anymore.

Bertus
 

cmartinez

Joined Jan 17, 2007
8,768
Hello,

When you have a led (inside the MOC) with a resistor to the + of the powersupply, the resistors 12 to 16 are not needed anymore.

Bertus
You're right... it's just that I don't like to leave the comparator's outputs floating just like that... but yes, the LED's in the MOC's need current to be driven... I guess we could do away with those resistors.
 

Thread Starter

RodneyB

Joined Apr 28, 2012
698
You're right... it's just that I don't like to leave the comparator's outputs floating just like that... but yes, the LED's in the MOC's need current to be driven... I guess we could do away with those resistors.
Thank you. I need to import the components then I will build it
 

cmartinez

Joined Jan 17, 2007
8,768
Rod... there's one thing I hadn't considered in my previous circuit... that is hysteresis!
without it, the things you connected to the triacs would start quickly switching on and off when the input signal reaches the trigger point of the comparator... unless your sensor has hysteresis included in it (which I doubt) we're going to have to add our own.
let me check what's needed and I'll get back to you
 

Thread Starter

RodneyB

Joined Apr 28, 2012
698
Rod... there's one thing I hadn't considered in my previous circuit... that is hysteresis!
without it, the things you connected to the triacs would start quickly switching on and off when the input signal reaches the trigger point of the comparator... unless your sensor has hysteresis included in it (which I doubt) we're going to have to add our own.
let me check what's needed and I'll get back to you
Thanks Very much. With the comparator, doe only one out put switch at a time?
 

cmartinez

Joined Jan 17, 2007
8,768
Thanks Very much. With the comparator, doe only one out put switch at a time?
No, that's not it. My circuit will work fine with all the comparators independently.
What I meant to say is that some form of hysteresis needs to be added to each comparator or the switching of your devices would become erratical.
Think of it this way: imagine having a circuit with a photosensor that switches on a light bulb, depending on how dark it is. Now imagine that dusk arrives and the circuit turns the light bulb on. But what happens next is that the circuit will turn the light bulb off again, since at that time of the day it is just barely dark enough for the photosensor to reach the triggering point and the circuit becomes unstable. The bulb will then blink on and off in rapid succession until it becomes dark enough for it to stay on... the same thing would happen at dawn when the day starts.
Now, other than the annoying instabilities, this is not a problem with something like a light bulb, or a fan... but it might become an issue with the humidifier... if it is of the ultrasonic type, for instance, the rapid connect-disconnect sequence might cause damage to its electronics.
Let me check the circuit again and I'll see what I can do about it.
 

Thread Starter

RodneyB

Joined Apr 28, 2012
698
No, that's not it. My circuit will work fine with all the comparators independently.
What I meant to say is that some form of hysteresis needs to be added to each comparator or the switching of your devices would become erratical.
Think of it this way: imagine having a circuit with a photosensor that switches on a light bulb, depending on how dark it is. Now imagine that dusk arrives and the circuit turns the light bulb on. But what happens next is that the circuit will turn the light bulb off again, since at that time of the day it is just barely dark enough for the photosensor to reach the triggering point and the circuit becomes unstable. The bulb will then blink on and off in rapid succession until it becomes dark enough for it to stay on... the same thing would happen at dawn when the day starts.
Now, other than the annoying instabilities, this is not a problem with something like a light bulb, or a fan... but it might become an issue with the humidifier... if it is of the ultrasonic type, for instance, the rapid connect-disconnect sequence might cause damage to its electronics.
Let me check the circuit again and I'll see what I can do about it.
Fantastic Thank you. I placed the order today so should receive the components by Friday.
 

Thread Starter

RodneyB

Joined Apr 28, 2012
698
My fear is that you might need additional components... either way it's only going to be a few extra bucks...
do you have any op-amps with you?
I ordered everything from your drawing. I have some components and I can get some locally if need be.

I am just so grateful for your help
 

cmartinez

Joined Jan 17, 2007
8,768
I ordered everything from your drawing. I have some components and I can get some locally if need be.

I am just so grateful for your help
Well, start looking for Op-Amps locally. They're very common components and cheap too. Just go to your local store or grab the phone and ask them what models they have in stock.
 

cmartinez

Joined Jan 17, 2007
8,768
@OBW0549, could you give me a hand here? In your opinion, what's the simplest way of adding hysteresis to the comparators shown in the circuit I attached in post #45?

A short explanation of the circuit: The TS wants to use the output of a humidity sensor (which varies between 0 and 3.3V) to switch on several AC devices, depending on the sensor's signal level. That's why there are several comparators whose outputs turn on Triacs through their drivers.

I was thinking about using an OpAmp as a differential amplifier to subtract about 0.05V from the negative reference of each comparator once it was triggered. This by using the comparator's output as feedback to the OpAmp... but maybe I'm complicating things too much?
 
Top