Tuesday, 17 May 2016

A Latch - Set & Reset


Background

I have experimented with various logic circuits within the 74xx and 4000 integrated circuit series, the Raspberry Pi and an Arduino clone using directly connected switches to simulate logic level changes. In some cases this is to 'preset' a logic level on a particular input, to simulate a logic level change on another input, or to act as a 'gate' function to control a particular logic function. Due to the phenomenon of something known as switch 'bounce', unwanted or unexpected results can occur. In some cases when using microprocessors or micro-controllers, code can be written to mitigate the effects of switch bounce. However, this isn't alway practical or possible if switch connections need to be made directly to logic circuits.

Research

Using various information sources in reference books and on-line, I put together this circuit below, based around the 555 'timer' device. I claim no originality for how the 555 is being used, but through experimentation I used some additional discrete components to provide two 'logic' outputs to allow interfacing to both 3.3v and 5v logic circuitry.

Operation

When power is first applied, output 1 (o/p1) is 'low' at 0v. This 0v level is also applied via R6 to the Base of Q1 turning  the transistor 'off'. The voltage present at the Emitter/R5 junction and therefore output 2 (o/p2) is 0v.

When Switch 1 (SW1) is pressed and released, pin 2 of TLC555 is taken low momentarily, the result of which sets pin 3 high at 5v. This logic 'high' level can be directly connected to TTL, CMOS or other +5v digital circuitry - ensuring that the current draw from the 555 doesn't exceed the specification, typically 100mA maximum.

The Led (D1) illuminates to confirm the transition on pin 3 from 'low' to 'high', with R3 preventing unnecessary current draw. R6 provides transistor base current limitation as Q1 is forward biased and switches on. Output 2 becomes 3.3v due to the voltage divider effect of R4 and R5. This o/p is suitable for direct connection to digital devices operating at 3.3v such as the Raspberry Pi and Arduino, current draw is limited by R4. The addition of Q1 and associated resistors provides separation between o/p1 and o/p2.

The Led remains illuminated and both outputs remain 'high' until Switch 2 (SW2) is pressed. Pin 6 is taken low resetting the latch, after which pin 3 goes low, the Led goes off and both outputs return to 0v.

Voltage measurements - no load attached
Output 1 is either 0v or 5v
Output 2 is either 0v or 3.3v

Current measurements - no load attached
Total measured supply current:
Latch 'set' : 1.4mA
Latch 'reset' : 0.11mA
Led current 0.94mA with Latch 'set'
Q1 Collector-Emitter 0.25mA

Components
R1, R2 1MΩ 1/4w
R3 3.3kΩ 1/4w
R4 6.8kΩ 1/4w
R5, R6 10kΩ 1/4w
C1 100nF
D1 Red Led
Q1 BC337 (or similar general purpose NPN transistor)
IC1 TLC555 (or similar low power NE555 type timer)

References:
7400 TTL series

4000 CMOS series

Switch bounce

555 Tutorial

Touch On-Off circuit [50 - 555 Circuits - Talking Electronics] http://www.talkingelectronics.com/te_interactive_index.html

TLC555 Datasheet

No comments:

Post a Comment