HELP WITH UNDERSTAND OF NAND GATE CIRCUIT?

Discussion in 'General Electronics Discussion' started by nathaneddy123, May 18, 2016.

1. nathaneddy123

1
0
May 18, 2016
Sorry for maybe a simple seeming question, as part of my college work I am trying to understand the reasoning behind linking the NAND gates on the diagram attached and why some have capacitors and resistors on the links?

Thanks Nathan.

File size:
81.7 KB
Views:
105
2. duke37

5,364
772
Jan 9, 2011
It would be handy to know what the circuit is supposed to do.
I have not worked out what the first two gates do, probably produces a timed pulse defined with the capacitor.
Gate 3 is an inverter to get the polarity right.
Gate 4 is an oscillator with a frequency of 2.7/(R*C) to make the led flash. This looks to be 2700Hz, far too fast to see the flashing, it will look continuous.

3. dorke

2,342
665
Jun 20, 2015
Welcome to EP Nathan.

The IC is a quad schmit-trigger NAND gate.

IC1A and IC1B form a square wave oscillator,the purpose of the Rs and C is to set the Frequancy about 0.45 Hz with these R,C values.

IC1C is an inverter.

IC1D forms another oscillator with frequency of about 77Hz .

For more details google the above terms.

4. hevans1944Hop - AC8NS

4,647
2,169
Jun 21, 2012
You can also find this circuit. and an explanation of how it works here. It is touted as an electronic "door open" indicator, with LED1 flashing continuously at a high frequency as @duke37 explained, when the door is closed and the Hall sensor output is low, disabling oscillator 1 in @dorke's annotated drawing. Therefore, with the S pole of magnet mounted on the door actuating the Hall sensor, LED1 appears to be continuously lit when the door is closed. Opening the door allows low-frequency oscillator 1 to operate because its pin 1 is pulled high through R2. Oscillator 2 is then modulated off and on by oscillator 1, flashing LED1 at a visible rate to indicate the door is open. Clever.

This is also Old School technology. Use a PIC today but keep the Hall sensor and the LED. SC everything else except maybe C3 and C4 (power supply by-pass capacitors) and R1 (reverse voltage current-limiting resistor for the Hall sensor).

Jeez! They are still teaching this stuff in college in the 21st Century? Shame on them. OTOH, nobody taught me this stuff in college in the 20th Century... had to learn about CMOS from manufacturer's literature and application notes.

Last edited: May 19, 2016
5. dorke

2,342
665
Jun 20, 2015
Hop,
The circuit has one redundant oscillator.
We can get the "same functionality" with just a single osc.

e.g. here I eliminated osc#1,
changed the LED location ,and the frequency to be about the samer as osc#1)

6. hevans1944Hop - AC8NS

4,647
2,169
Jun 21, 2012
@dorke You have changed the original functionality! Originally, the LED flashes at a high enough rate that the eye perceives it as being continuously "ON" when the door is closed, because the magnet in the door is using the Hall Effect device to disable the slow first oscillator. This action provides positive visual confirmation that the door is closed. Opening the door enables the first oscillator which turns the second oscillator on and off at a slow rate.

Your new circuit doesn't do that. In your new circuit the LED flashes at a slow rate while the door is closed (Hall output low). When the door opens, the Hall output goes high, which inverted, disables the oscillator by forcing IC1D output high and leaving the LED continuously ON. Not the same functionality.

Last edited: May 19, 2016
dorke likes this.
7. dorke

2,342
665
Jun 20, 2015
Yes,
Must be the late hour...it also needs removing the inverter.

8. Colin Mitchell

1,416
314
Aug 31, 2014
The only problem is the 10u around the wrong way.

9. hevans1944Hop - AC8NS

4,647
2,169
Jun 21, 2012
Well, doh! I like your new circuit. But what about the wasted power from leaving the LED on when the door is closed instead of pulsing the LED at faster than the decay rate of human persistence of vision? Hah! Bet you never considered that! Hmmm. Your circuit does have the advantage over a PIC of not requiring any programming... not a problem if building and selling a million or so, but certainly attractive for hobby and novelty purposes. Good job, @dorke.

10. dorke

2,342
665
Jun 20, 2015
Hop actually I did.
For an alarm system which would be run from mains supply with battery-back up.
the added power consumption is neglectable .

A constantly on led will draw about 1.5mA in this circuit.
Assuming the osc. in the original has a duty cycle of about 50% it will draw on average 0.75mA.

Anyways,the hall effect device itself draws up to 5mA.

Here is a challenge:
Design this circuit without any IC
,low component count ,and very low price.

11. Colin Mitchell

1,416
314
Aug 31, 2014
Design this circuit without any IC
,low component count ,and very low price.

The IC is 10 cents. This is less than a few components.

12. Colin Mitchell

1,416
314
Aug 31, 2014
DOOR ALARM
This circuit produces two different effects on the LED. It is best to put a piezo diaphragm on pin 11 to hear the tone (frequency) produced by the circuit.
The circuit is a good example to test your ability to work out what is happening.
When the magnet is near the Hall effect device, the output is LOW and pin 3 must be HIGH (refer to the truth table). This puts a high on pin 2 and the gate remains in this state.
Pin 4 is LOW and pin 10 is HIGH.
Pin 11 can be high or low and if we assume the 100n is not charged, pin 13 will be low and the output will be HIGH. This will charge the 100n and change pin 13 to HIGH to make the output LOW and thus we have an oscillator. The piezo diaphragm will produce a tone but the LED will simply be illuminated.
When the magnet is removed, pin 1 goes HIGH and the output can be high or low. We will assume pin 3 goes LOW as it was previously HIGH and the 10u was fully charged.
Pin 4 goes HIGH and the 10u is "jacked up" by 9v due to pin 4 rising and the about 8v contained in (or on) the 10u puts 17v on the join of the 1M and 100k resistors.
The other end of the 100k is at 0v and this resistor discharges the 10u fully and then starts to charge it in the opposite direction as the negative of the electro will be at 9v and the positive lead has to drop to less than 3v. Pin 2 monitors the voltage via the 1M resistor.
When pin 2 sees less than 3v, the gate changes state with pin 2 going HIGH and the second gate changes state with pin 4 going LOW.
The electro has MINUS 6v across it but the way to see it is this: The electro is "moved down" by 9v and now the join of the 1M and 100k resistors sees a voltage of minus 15v.
The other end of the 100k resistor has 9v on it and this removes the charge from the electro so that it has 0v across it and then it charges in the correct direction until the voltage reaches about 6v.
At this point the gate changes state with pin 3 going LOW and pin 4 going HIGH to create a low frequency oscillator.
Previously pins 4, 8 and 9 were LOW.
When these pins are HIGH, pin 10 is LOW. When this pin is LOW it permanently puts a HIGH on the output of the gate and the LED is turned OFF.
This makes the LED blink when the magnet is removed.