# Logic Gates

Discussion in 'General Electronics Discussion' started by vick5821, May 5, 2012.

1. ### vick5821

700
0
Jan 22, 2012
Dear all,

How can I combine logic gates and what logic gates should be combined to give this type of input and output ?

Thank you.

Is this logic combination true and can be constructed in hardware ?

Thank you.

Last edited: May 5, 2012
2. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,419
2,790
Jan 21, 2010
I would have modelled the B output as B AND (NOT A)

Note that there could be many different answers (even more than usual) because there is one input state where the output is not defined.

Your result seems correct for the three values shown.

3. ### vick5821

700
0
Jan 22, 2012
What does the bolded part means ?

4. ### vick5821

700
0
Jan 22, 2012

This is the circuit where I want to implement my logic gates. Is the connection correct ? It seems cant work when constructed in hardware. ....

This circuit basically is like this :
We make a heat detector circuit which can sense two different temperature. Lets say 40 degree and 80 degree celcius. I am using one LM 35 temperature sensor. And I set the threshold of the comparator. Using two comparator and both of them having different thresold so as to triggereed the output. So, when relay on the left is ON, it will drive the DC fan with 12V to GND. When the relay on the right is on, and the relay on the left is off, it will drive the DC fan with 9V only which gives a slower speed(for lower temperature/heat). We use logic gates to ensure that when I reach around 90 degree, only the left relay in ON and the right relay is OFF. So, is the implementation of the logic correct ? Or do you have any suggestion on implement this application so can sense two different temperaturee ?

Thank you for the help

5. ### duke37

5,364
769
Jan 9, 2011
That seems very complicated. You could get rid of the 9V supply and the relay by putting the motor in series with a resistance and switching this with a fet fed from one of the comparators. The other comparator would switch another fet to bypass the resistance.

No other logic would be needed.

Does the motor need a stabilised supply? If you use the same supply to power the motor and the other circuitry, you may get interference from the motor.

6. ### vick5821

700
0
Jan 22, 2012
I do not get what you try to say. I need to follow according to this logic now
when start the circuit, the DC fan wont move.
When reach 40 degree, the DC fan will on with slighly lower speed.
when 80 degree, the DC fan will on with higher speed.

The 80 degree with override the 40 degree,
80 degree, the fan is power by 12V
40 degree the fan is power by 9V.
And I do not want when it reaches 80 degree, the DC fan is power by 12 + 9V = 21V

Thats why I need some logic gates to do this right ?

7. ### vick5821

700
0
Jan 22, 2012
It's weird. When I on the relay to drive the fan by 9V, the voltage at the fan is around 9. and when I on for the 12V to drive the fan and 9V is off, the fsn voltage is around 12.But when I both on the 12V and 9V to drive the fan, the voltage is around 10? Why like this ?

8. ### duke37

5,364
769
Jan 9, 2011
If you put 9V and 12V on one output, the supplies will fight to gain superiority. With luck, you have not damaged anything.

I attach a diagram of my idea.
One fet feeds the fan with a resistor in series and the other feeds it direct.

File size:
5 KB
Views:
543
9. ### vick5821

700
0
Jan 22, 2012
How does this works ? working principle ?

10. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,419
2,790
Jan 21, 2010
A simpler approach may be to place a diode in series with the two power supplies just before (or after) the relay contacts.

That will prevent either supply from loading the other one down.

You could just get away with a single diode in series with the lower voltage supply.

But yeah, using regulated voltages for this... Not typically required.

Duke37's solution is to essentially connect a resistor in series with the fan at low temperature.

Another approach is to drive the fan using PWM from a 555 at low temperature.

At high temperature, force the 555 to have a high output by either shorting the timing capacitor (pulling trigger low) or a low output by asserting reset. (Pick the correct one to turn the motor on)

11. ### vick5821

700
0
Jan 22, 2012
Can I have the sample circuit ? Have no much time already.Pls help.

Thank you

12. ### vick5821

700
0
Jan 22, 2012

How do I make this circuit special with PIR motion sensor ? What type of special component too that I can use ? And what kind of prototype I can build ? What decoration can be included ? But most important is that my circuit is unique and functional

Thank you

13. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,419
2,790
Jan 21, 2010
Do you have a PIR sensor?

Do you have the datasheet?

Without both, you're not going to get far.

14. ### vick5821

700
0
Jan 22, 2012
I have PIR sensor and the datasheet

15. ### vick5821

700
0
Jan 22, 2012
How do I amplify the voltage output from the comparator so as to be input to the logic gates ? I measured that the output voltage from comparator is less than 1V, so I plan to amplify it so as the comparator output is 1(HIGH), then then logic input is 1..Any ideas ?

Thank you

16. ### duke37

5,364
769
Jan 9, 2011
You do not need to amplify the output of a comparator. If you only get 1V out, I assume that you have not fitted a pull-up resistor. See the circuit I posted earlier.

17. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,419
2,790
Jan 21, 2010
Can you provide us with a link?

And to assist by putting everything in one place, briefly restate what it is that you want the PIR to detect, and how you want your circuit to react.

700
0
Jan 22, 2012
19. ### vick5821

700
0
Jan 22, 2012
where should I add my logic gates to my maain circuit as posted above ?

20. ### (*steve*)¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥdModerator

25,419
2,790
Jan 21, 2010
No way. You've got to come up with that. I thought you wanted to interface it to the circuit you've shown above in order to provide some feature.