Whats happening here? - Page 1
Forum section: electronics / beginners

author: Irukanji
author_rank: Contributor
timestamp: November 28, 2013, 12:03:21 am
content: So, I rigged up a SN74HC574N with a 14.7456MHz crystal across the OE and clock terminals with a bit of connection wire, on a breadbord. I have an LED hooked up to 12, 15 and 19. 3.5V input.(just messing around with some parts for an LED cube build, etc).Now, the interesting bit. Whenever I come within 1-1.5 inch of this #19 LED, it drops the output low and subsequently the LED turns off(it still glows, but very faintly, same as the other 2 LEDs which remain in this state until the circuit is touched). It appears it is only from this LED, the range is consistent around it an the circuit is pretty spaced out.(i'm assuming the outputs are high/low, the LED is either bright or very dim, no in between).But yeah I have no flipping idea what is causing it, I've turned the power supply off and on a few times to check (the range changes occasionally). I've disconnected the power supply from the board and put it back, etc etc.However one thought back to reading about FM transmitters/bugs is that some circuits are sensitive enough that moving near them can cause the signal to variate.But yeah maybe somebody knows whats actually going on. Perhaps I just made the shittest motion detector.

author: c4757p
author_rank: Super Contributor
timestamp: November 28, 2013, 12:17:54 am
content: Your OE pin isn't connected to anything. The crystal doesn't count, without an oscillation it might as well be a low-value capacitor. There's no DC path, so it picks up any electric field you throw at it.Why would you connect a crystal like that?

author: wraper
author_rank: Unknown
timestamp: November 28, 2013, 12:33:05 am
content: I thrown random parts on the breadbord but it does something strange. Tell me why? But seriously, as 74HC is CMOS series, inputs are high impedance and pick up whatever if not connected to anything (quartz crystal does not count as connected).

author: Irukanji
author_rank: Contributor
timestamp: November 28, 2013, 12:39:22 am
content: Quote from: c4757p on November 28, 2013, 12:17:54 amOE is output enable, it's connected to all the outputs according to the data sheet.And why? I dunno lol, I had a 555 timer output hooked to the OE and clock inputs and the lights just flash at around 3-4Hz, wanted to see if a crystal would work lol

author: wraper
author_rank: Unknown
timestamp: November 28, 2013, 12:46:49 am
content: Quote from: Irukanji on November 28, 2013, 12:39:22 amWhy it should?

author: c4757p
author_rank: Super Contributor
timestamp: November 28, 2013, 12:47:33 am
content: It's not "connected to" the outputs, it controls them. The bar above "OE" (or a circle on the pin, depending on whose datasheet you are looking at) means it's active low, so if you pull it to ground, the outputs turn on. What exactly that means depends on the chip, in this case the output drivers are disconnected from the outputs when OE is high.To make a crystal oscillate, you have to use some sort of inverter. Google "Pierce oscillator". The point is to pick off the signal on one side of the crystal, invert that and feed it into the other side. Most simple logic chips do not have built-in crystal drivers, though you can use an inverter chip like a 74HC04, or just a transistor. The clock terminal requires an actual digital clock signal, not a crystal or resonator.

author: opablo
author_rank: Regular Contributor
timestamp: November 28, 2013, 08:29:59 am
content: wraper... remember that this is the Beginner's forum section...

author: wraper
author_rank: Unknown
timestamp: November 28, 2013, 12:35:11 pm
content: I remember, otherwise I would be much more harsh.

author: Irukanji
author_rank: Contributor
timestamp: November 28, 2013, 12:43:08 pm
content: Still doesn't explain why the LED is turning itself off within a certain distance from it though. Whether it is "right" or not isn't the question, I'm just a noob who was playing with some electronics, same as everybody else was at one stage.

author: wraper
author_rank: Unknown
timestamp: November 28, 2013, 12:52:12 pm
content: Quote from: Irukanji on November 28, 2013, 12:43:08 pmYou made something like a capacitive sensor. When you come near to IC, you induce noise on it's inputs as they are very high impedance and not connected to anything.

author: owl_uk
author_rank: Contributor
timestamp: November 28, 2013, 01:28:14 pm
content: As wrapper says, this happens when you have a high impedance input which isn't connected to anything. This is very useful thing to know! High impedance inputs are very common on all sorts of chips, including micros. I've seen this kind of thing because of errors in the schematic or data sheet misreading leading to an input being left open circuit which shouldn't. Also I've a dry joint on a reset pin so when you put your hands near a system it stops.I'm sure most engineers have a story about an open input pin like this. So I think your experimenting has shown you a useful effect which you will probably encounter again sometime.

author: owl_uk
author_rank: Contributor
timestamp: November 28, 2013, 01:30:29 pm
content: I've not looked up your chip, but I think OE is the input you've left floating in this case.

author: c4757p
author_rank: Super Contributor
timestamp: November 28, 2013, 01:44:16 pm
content: To expand on this a bit:Quote from: c4757p on November 28, 2013, 12:17:54 amAlways remember to think in terms ofcurrentin your circuits, not just voltage. Any device's input has an impedance (call it R), which requires that to give it a signal of V volts, you must feed it I = V/R amps (Ohm's law). If the current can't flow, the voltage can't exist - Ohm's law is not a suggestion. In order to signal the input of any chip, you need a place for current to flow into and out of it, otherwise the signal will be subject to the prevailing electric fields in your circuit's general area, which may be strong enough to supply that input current, if only briefly.A TTL logic circuit, like you may have in some older chips (74LS, etc) looks kind of like this:If nothing is connected to Vi1 or Vi2, current can still flow to it, at least to charge it up, through R1 and then either of T1's emitters. This is why TTL logic inputs default to 1 if you don't connect anything. You don't actually have to pull the inputs up to 1, you just have to pull them down to 0.(As a quick aside, since this question often comes next - if the whole "two emitters" thing confuses you, think of it as either A. one emitter, then split into dual outputs with two ideal diodes, or B. two transistors, joined at the base and collector but with the emitters left separate. B is more accurate but A might be easier to visualize, and works just fine in a digital circuit. It's not a shorthand, they really can build multiple-emitter transistors in chips. You also see multiple-collector transistors a lot in analog chips.)Now, you have a CMOS chip. CMOS circuits look like this:That's it. (Well, there are usually static discharge protection diodes as well, but unless you exceed the power supply voltages they do nothing.) The gate of a MOS transistor is drawn like a capacitor for a reason - itisa capacitor, and in the case of a logic gate, a small one at that. Any tiny current induced in wires by electric and magnetic fields will charge it up, and then there is nothing to discharge it. CMOS inputs are 100% undefined when not connected, picking up any interference you wave at them.Also, for good circuit design, don't just consider that current must flow in and out of the pin, always consider that current you supply must always come back to you as well, and that this return path isequally importantas the primary path. Not as necessary at low speeds, where just about anything will suffice as a conductor, but at higher speeds (I don't mean "in 30 years when you're working on the next super-smartphone-widget-whatever-we-have-then", even an Arduino or something can suffice) you may find that digital signals are unnecessarily interfering with nearby analog sections of your circuit if you don't give them a proper return path, as the sad excuses for conductors that we often carelessly give them become little radio transmitters.Some of this is a bit much for blinking LEDs, but it's never too early to start developing an eye for current flow.

author: wraper
author_rank: Unknown
timestamp: November 28, 2013, 02:01:36 pm
content: And you should never leave any unconnected inputs on CMOS IC. Even if you are using only half of it. Fot example:http://www.nxp.com/documents/data_sheet/74HC_HCT00.pdfAll inputs must be connected (GND, VDD, another connected input), even if you use only one NAND gate. Otherwise other part of the IC will be bouncing therefore increasing current consumption at least. Unused microcontroller pins must be configured as inputs with enabled pull-ups or either as outputs for the same reason.http://electronicdesign.com/boards/save-power-managing-unused-cmos-io-pins

author: Irukanji
author_rank: Contributor
timestamp: November 29, 2013, 10:03:48 am
content: Thanks guys. I'm still learning, reading "The Art of Electronics" every time I have a chance. Haven't got to the bit on crystals yet :pJust purchased some logic gates to experiment with, see how they work and such. So yeah, maybe in 10 years I'll look back and wonder why I did this with a crystal, but it was an interesting experiment all the same.Doesn't hurt, right? Might make some more experienced experimenters/EEs sad though

author: amyk
author_rank: Super Contributor
timestamp: November 29, 2013, 11:49:05 am
content: And just for completeness here is the standard wording you will find in datasheets and such regarding this behaviour:Quote