Maharashtra HSC Electronics (Bifocal) study materials
Maharashtra HSC Electronics (Bifocal) study resources

Counter That Jumps Counts When a Hand Approaches

Maharashtra HSC Electronics (Bifocal) · Put your knowledge to work in context.

All case studies

Counter That Jumps Counts When a Hand Approaches

A breadboard counter takes pulses from a slotted opto-sensor whose output is an open-collector phototransistor with a 10 kohm pull-up, carried over 5 m of unshielded cable to a 74HC14 Schmitt inverter. The counter and 7-segment driver are 74LS devices, and a 5 V bench supply feeds the board through 20 cm leads. Symptoms: (a) the count sometimes jumps by 3-6 with nobody touching the board, especially when a hand comes near the cable; (b) after the student replaced the first 74LS gate in the chain with a 74HC gate 'to get cleaner edges', the counter became less reliable than before; (c) an indicator LED is wired from a 74HC output straight to ground and that output measures only 2.1 V when the LED is on; (d) two of the six 74HC14 inputs are unused and left open. Available parts: 1 kohm and 330 ohm resistors, 100 nF capacitors, and 74HCT00 ICs.

1. Rank the causes of the random counting and give a concrete fix for each, with any relevant numbers.

Read the worked answer

1. Floating CMOS inputs (largest and cheapest fault). An unconnected 74HC input is not 'low'; its impedance is around 10^12 ohm, so the pin sits at an undefined level and rectifies nearby 50 Hz fields. A hand near the board changes the coupling and the gate toggles. Fix: tie each unused input to 0 V or 5 V, directly or through 10 kohm. Never leave CMOS inputs open, and never tie an output to a rail.

2. High-impedance, slow sensor line. 5 m of unshielded cable is roughly 100 pF per metre, so about 500 pF. With the 10 kohm pull-up the rise time is 10 k x 500 p = 5 us and the line behaves as an antenna; the phototransistor can only pull low, it cannot pull high. Fix: reduce the pull-up to 1 kohm (time constant 0.5 us; check the phototransistor can sink 5 mA when on), run the signal with its own return wire twisted with it, and add a 100 ohm series resistor plus 100 pF at the receiver if ringing persists. The Schmitt inverter helps with slow edges but not with an undefined DC level.

3. Decoupling. 20 cm supply leads are about 0.2 uH, so switching transients appear on the rail. Fix: 100 nF ceramic directly across V_CC-GND of every IC, plus one 10 uF electrolytic at the board entry.

Ranking: floating inputs first (the symptom follows the hand), then the sensor line, then decoupling.

2. Explain symptom (b) with the actual logic levels, and recommend a remedy using the parts listed.

Read the worked answer

The two families do not share thresholds at a 5 V supply:

  • 74LS output high: V_OH(min) = 2.7 V at 0.4 mA (typically 3.2-3.4 V). Output low: V_OL(max) = 0.5 V.
  • 74HC input: V_IH(min) = 3.5 V (70% of V_CC), V_IL(max) = 1.0 V (20% of V_CC).

An LS high of 2.7-3.4 V is not guaranteed to reach the HC 3.5 V threshold, so the HC input may sit in the forbidden band, drawing crowbar current and behaving unpredictably. That is exactly why adding the HC gate made things worse.

Check the other direction before blaming the family: LS low (0.5 V max) is safely below HC V_IL (1.0 V), and HC driving LS is fine because HC V_OH is about 4.9 V against LS V_IH of 2.0 V, and an HC output can sink the 0.4 mA that an LS input injects.

Remedies:

  • Use a 74HCT device in that position: HCT inputs are TTL-compatible (V_IH = 2.0 V), so the LS high is recognised.
  • Or add a 4.7 kohm pull-up from the LS output to 5 V. This adds about 1 mA of sink current when the LS output is low, well inside its 8 mA capability, and lifts the high level to nearly 5 V.
  • Mixing families is acceptable only when the level budgets are checked; the safe general rule is LS into HCT, not LS into HC.

3. For symptom (c), calculate a correct series resistor for 8 mA and explain what the 2.1 V reading really means.

Read the worked answer

With the LED anode on the output and the cathode to ground, and no resistor, the output is driving a forward-biased diode directly. The current is limited only by the output stage's internal resistance, so the pin delivers whatever it can, up to or beyond the absolute maximum of about 25 mA per pin (and around 50 mA for the whole package). When an output is overloaded its voltage collapses, so 2.1 V is not a valid logic high, it is the output struggling: the LED may look bright, but the driver is being degraded and the logic level presented to any following gate is illegal.

Correct design:

  • R = (V_OH - V_F) / I = (5.0 - 2.0) / 0.008 = 375 ohm, so use 390 ohm
  • Actual current: (5.0 - 2.0) / 390 = 7.7 mA
  • Resistor dissipation: I^2 R = 0.0077^2 x 390 = 23 mW, so a 1/4 W part is ample

Also budget the package: at 7.7 mA each, more than about 6 such LEDs exceeds the 50 mA total. If many indicators are needed, drive them from a transistor or a ULN2803 rather than from logic outputs.