You are on page 1of 6

designideas readerS SOLVE DESIGN PROBLEMS

Pocket white-LED torch is DIs Inside


power efficient 48 Gnat-power sawtooth
oscillator works on low supply
Raju Baddi, Tata Institute of Fundamental Research, Pune, India voltages

This Design Idea describes a single commonly available parts. This torch has 52 Connect a 43 matrix
white-LED torch, which can be proven to be highly durable; the proto- keyboard to a microcontroller
housed in an empty glue-stick tube and type model constructed by the author using two I/O pins
has a long rechargeable-battery life. The has been in service for nearly five years
circuit is constructed with just a few and is still in good working condition. 55 Bender senses shocks

To see and comment on


1.2V all of EDNs Design Ideas, visit
(NiCd, www.edn.com/designideas.
2500 mAhr) L1-3
+ (41.3 mH)
1 3
2L Q5 A single 1.2V/2500-mAhr nickel-
L1-2 2-3
(1.3 mH) (1.3 mH) cadmium cell powers the torch (Figure
100k BC559
1k 10k 10k 510 1). A simple transistorized boost
BC549 switcher based on a tapped inductor
1nF 1nF
Q3 3.3k + WLED is used to increase the voltage effi-
10 F 3V
1.5 to 3.3k ciently (up to approximately 80%) to
Q1 Q2 the voltage needed for a typical white
BC549
BC547 BC547 82k
LED1in this case, about 3V. Q1 and
Q4 Q2 form an astable multivibrator pro-
ducing rectangular waveforms at their
collectors that are 180 out of phase.
Assume that at power-up, Q2 is off
and Q1 is on. Under these conditions
Figure 1 An inductive voltage booster powers the white LED. and with Q2s collector high, Q3 is turned
on via Q2s collector resistor. With Q3
on, current flows through the first half
of the inductor (from terminals 1 to 2).
At the end of this first half-cycle of
operation, the multivibrator flips to the
other state: Q2 turns on and Q1 turns
off, and its collector goes high. Q3 is
switched off; Q4 and Q5 are switched on
via Q1s collector resistor. The decaying
inductor current now flows through ter-
minals 1 and 3. Since L1-2 is equal to L2-3,
and since they are on a common core,
(a) (b) the inductance of L1-3 is four times that
of L1-2 and L2-3. This increased induc-
Figure 2 The circuits components can be assembled onto the two sides of a circular
tance (and the corresponding addition-
general-purpose board: Connections on the lower surface have been mirrored (a);
al turns on the core) leads to a reduc-
EDNDI5267 Fig 1.eps DIANE
from the top, component placement is shown in white, and connections are shown
tion in the magnitude of the current
in green (b).
but an increase in voltage across the
LED. During this phase, current flows

[ www.edn.com ] May 2013 | EDN 47


designideas
ON/OFF SWITCH
POCKET CLIP AT 90 WITH RESPECT TO SWITCH
APPLY ADHESIVE

1N4007
WLED

INDUCTOR + 1.2V, 2500-mAhr CHARGING 2.4


NiCd SOCKET CM

2.2
4.3 CM

9 CM 20G GLUE-STICK TUBE

Figure 3 The white-LED torch can be assembled inside an empty glue-stick tube.

through the LED and, simultaneously, Figure 2 shows how the circuits dictated by how quickly and deeply Q3
the 10-F capacitor is charged. This components can be assembled onto the goes into saturation.
phase lasts for a time period determined two sides of a circular general-purpose Photographs of the working circuit
by the RC values in the astable circuit. board. Figure 3 shows how the torch can be seen in the online version of this
Once the RC time constant passes, the could be assembled inside the glue-stick Design Idea at www.edn.com/4412618.
process repeats: Q1 turns on, Q2 turns off, tube. Once the torch is assembled and An online appendix contains the quan-
and the other transistors switch as previ- powered up, adjust the 100-k poten- titative aspects of the circuit.EDN
ously described. The current through ter- tiometer in the astable circuit for maxi-
minals 1 and 2 of the coil again increases, mum brightness. Note that, if needed, Reference
storing energy from the battery in the an additional transistor can be used in 1 LT1932 constant-current DC/DC

inductor. During this phase, the 10-F parallel with Q3 to boost the energy LED driver in ThinSOT, Linear Tech-
capacitor powers the LED. stored in the L1-2 inductor. The need is nology, http://bit.ly/17YVEdw.

Referring to Figure 1, there are only


Gnat-power sawtooth oscillator eight components in this circuit: two
ICs, four resistors, a capacitor, and a
works on low supply voltages power-supply-bypass capacitor. The key
bits are two Touchstone Semiconductor
Bruce D Moore, Consulting Analog Engineer


analog building-block ICs in 4-mm 2
This sawtooth-oscillator circuit, nal components, a low supply current, TDFN packages (the TS12011 and the
drawing less than 3.2 A and and the ability to maintain a constant
working at under 1V, is a useful building amplitude and frequency despite the
block that fits the bill for extremely variable battery voltage. Unlike the The appeal of this
low-power consumption and operation classic op-amp astable multivibrator, circuit includes
to low supply voltages. It could be used this design features comparator thresh-
as the basis for a PWM control loop, a olds that are set by precision reference its small size and
timer, or a VCO, or as a capacitance- voltages rather than the output swing of low external-
to-frequency converter. Its a nifty cir- the op amp in combination with resis-
cuit for two reasons: It uses an open- tor feedback.
component count.
drain comparator output to make an A ratiometric fixed-frequency
accurate switched current source, and design of this type usually results in a TS12012), each containing an op amp,
it uses a latch function to make a simple variable-amplitude sawtooth waveform, a comparator, and a reference. By lean-
comparator into a window comparator, which is undesirable in PWM control ing on their characteristics, the design
while needing no extra components. loops because it can affect the loop can be kept terrifically tiny and simple.
The appeal of this circuit is found gain. As a side benefit, the up/down Heres how the circuit works: A
in the combination of the tiny size, ramps can be independently controlled summing integrator feeding a window
the ridiculously low number of exter- by scaling R1 and R2. comparator generates the sawtooth

48 EDN | MAY 2013 [ www.edn.com ]


designideas
state, until the inputs
SUMMING
cross. The comparator
INTEGRATOR in IC2 gets set when the
ramp crosses the lower
R2 threshold at 0.58VREF,
470 pF
1M and reset when the ramp
1-kHz SAWTOOTH crosses 0.87VREF. The
VDD 0.87V 8 OUTPUT
0.9 TO reset pulse is momen-
REF
2.5V 9 tary, but puts the latch
TS12011
R1 0.1 F in a state where the
6 +
2M
2 comparator inputs cross-
10
IC1 ing cause it to set and
1
TS12011 latch again (which hap-
3 + LHDET pens due to the switched
4
(LATCH 1-kHz PULSE reference current caus-
8 5 OUTPUT
+ INPUT) ing the integrator to
0.87V TS12012
9 ramp negative). The net
REF VDD 6 result: No glue logic is

1 needed.
10 4 WINDOW The battery volt-
R3 COMPARATOR
1M IC2 7
VREF
age ranges down to
TS12012 0.9V with a miserly
+
2 3 VDD current of 3.2 A.
Maximum operating
frequency is limited by
R4
2M 0.58V the op-amp slew rate
REF and prop delays to about
1.5 REF 3 kHz. Disconnecting
GENERATOR
R1 and driving it with
a voltage source greater
Figure 1 This low-voltage sawtooth generator uses only eight components and draws extremely low than 0.58V REF gives
power. you a VCO function.
Editors note: This
wave. The integrator-summing node tion has a sly feature: When LHDET Design Idea is courtesy of EDN.coms
is held at VREF by the feedback action is pulled low, the comparator inputs sister site, Planet Analog: http://bit.
of the amplifier. Thus, a fixed posi- are still active and sensing the input ly/11IkNeK. EDN
tive reference current set by R1 is bal-
anced by a larger-amplitude switched
negative current set by R2. The lower
comparator block has an open-drain
output; when its output is low, current
is pulled from the summing node via R2:
IR1=(0.87VREF0.58VREF)/REDNDI_PLANETANALOG
1
and IR2 Fig 1.eps DIANE
(switched)=0.58VREF/R2. If IR2 is set
to 2IR1, a symmetrical triangle wave
results.
The frequency is set as follows:
1
f= ,
[1/IR1+1/IR2]CV
where V is the difference between 0.87
VREF and 0.58VREF. Here, f=850 Hz.
Figure 2 shows the waveforms at the
sawtooth and pulse outputs.
The window comparator employs a Figure 2 The waveforms at the sawtooth and pulse outputs are shown. The pulse
built-in latch function of the TS12012 train is used to reset the latching comparator.
to provide hysteresis. The latch func-

50 EDN | MAY 2013 [ www.edn.com ]


designideas
available: Use readily available I/O
Connect a 43 matrix keyboard expanders, or assign a unique voltage
to each key using a resistor network
to a microcontroller using two I/O pins and then use an analog pin to read
the voltage and determine which key
Aruna Prabath Rubasinghe, University of Moratuwa, Moratuwa, Sri Lanka is pressed. Each solution has its own


disadvantages.
Matrix keyboards are common number of the MCUs I/O pins to con- Since most of the time I/O expand-
as an input device in microcon- nect the keyboard. For example, to ers require a special communication
troller-based projects. A conventional connect a 43 keyboard requires seven protocol (I2C or SPI, for example) to
way of connecting a matrix keyboard digital I/O pins. This becomes a prob- read and write data, the MCU should
to a microcontroller is to use multiple lem when the project is based on a have built-in communication mod-
I/O pins of the MCU. The MCU then low-pin-count MCU or when the ules, or the user has to implement the
uses a scanning algorithm to identify MCU being used does not have enough relevant communication-protocol soft-
which keys are pressed. A drawback of free I/O pins. ware wisely, which adds significantly
this method is that it requires a large Two solutions for this issue are to the overhead of the MCU. On the

D2
1N4148

D1 D3 D5
1N4148 1N4148 1N4148

D4
1N4148

R1 D6 INTERRUPT
D7 1 2 3
1k 1N4148
14 3 A 1 2 3
CLOCK CLK Q0 R4
13 2 D8
E Q1 1k
4 B 4 5 6
Q2 R5 R7
7 D9 47k
Q3 1k
10 C 7 8 9
Q4
1 R6
Q5 D10
IC1 5 1k
R3 0 #
4017 Q6 6
D
10k Q7
9
Q8
11
Q9

15 MR 12
CO

14 CLK 3
Q0
13 2
E Q1
4
Q2
7
Q3
10
Q4
1
IC2 Q5 5
4017 Q6 6 NOTE: DIODES D7, D8, D9, AND D10 ARE EACH A 1N4148.
Q7
9
Q8
11
Q9

15 MR 12
CO

Figure 1 This circuit for a 43 keyboard shows a more efficient architecture using two CD4017 Johnson counters with only two
I/O pins.

52 EDN | MAY 2013 [ www.edn.com ]


designideas
START

COUNT=1;
TIMER(0);

EXTERNAL TMER
DISABLE TIMER INTERRUPT INTERRUPT USER FUNCTIONS INTERRUPT DISABLE TIMER INTERRUPT
DISABLE EXTERNAL INTERRUPT INFINITE_LOOP() DISABLE EXTERNAL INTERRUPT

YES
COUNT=12 COUNT=0;
BUTTON_FUNCTION(COUNT);

NO

COUNT++
ENABLE TIMER INTERRUPT CLOCK();
ENABLE EXTERNAL INTERRUPT ENABLE TIMER INTERRUPT
ENABLE EXTERNAL INTERRUPT

Figure 2 The clock count kept in the MCU increments as it generates clock pulses in intervals; this count is equal to the switch number
focused at the moment.

other hand, assigning a unique voltage The example described here shows column of the respective button are
to each key using a resistor network how to implement this method to read at the logic-high level. If either row or
becomes troublesome as the number of a 43 matrix keyboard. One CD4017 column of the button is logic zero, an
keys becomes high, which will lead to is used to control the keyboard rows, interrupt will not occur.
tight voltage margins. Then, as resistor while the other is used to control the When an interrupt occurs, the
values tend to change with tempera- columns. MCU reads the count value at the
ture, the use of tight voltage margins The MCU generates a clock signal moment; that value is equal to the
can cause incorrect readings. Even and feeds it to the counter IC con- button just pressed.
switch bouncing can play a major role trolling the columns. Initially, the The clock count kept in the MCU
in producing incorrect voltages with 0th output of the column counter increments as it generates clock pulses
this method. Another major drawback and row counter is at logic high, and in intervals; this count is equal to the
of this method is that it requires the the columnEDNDI5310
counter Fig 2.eps DIANE
increments as it switch number on the keypad that
presence in the MCU of an analog receives clock pulses. At the fourth could generate an interrupt if pressed.
input pin. clock pulse, the column counter resets The flow chart in Figure 2 illustrates
The Design Idea described here and simultaneously increments by one this scenario.
addresses all of the above problems the counter controlling the rows. As Note that even though this
in an efficient manner and has sev- the column controller resets, the row example shows a 43 keyboard, you
eral advantages: It requires only two controller increments and the row can also read a 1010 keyboard
I/O pins regardless of the number of controller resets with the fifth clock by using the remaining outputs of
switches connected; it does not require pulse from the column controller. As both 4017 counters. Furthermore,
a special communication protocol; and clock pulses generate, a count variable you can cascade additional 4017
it does not require an analog pin. The on the MCU should be incremented ICs to expand the keyboard size as
idea is based on two CD4017 Johnson and should reset to one upon the fifth necessary. EDN
counters, which are both common and clock pulse to the row controller. The
inexpensive. output of the keyboard is ORed and Reference
Figure 1 shows the circuit for a 43 connected to an external interrupt pin 1 Rubasinghe, Aruna, Read 10 or
keyboard. R1, R4, R5, and R6 are used of the MCU. more switches using only two I/O pins
for current limiting; R7, D4, D5, and D6 An interrupt occurs only if a button of a microcontroller, EDN, Feb 28,
form an OR gate. pressed when both the row and the 2013, www.edn.com/4408027.

54 EDN | MAY 2013 [ www.edn.com ]


designideas
CLASSICS
Originally published in the April 26, 1990, issue of EDN

of inertia. The jam nuts position deter-


mines the benders sensitivity.
Bender senses shocks In both cases, apply your soldering
iron as briefly as possible to the bender
Don Sherman, Maxim Integrated Products, Sunnyvale, CA


to avoid damaging the piezoelectric
With the aid of a simple mount- der one edge of the bender to a mount- elements bond to the brass disc.
ing system and some soldered-on ing bolt. Opposite the mounting bolt, Figure 2 shows a simple alarm cir-
weights, a piezoelectric bender can solder a weight to increase the benders cuit. Giving the bender a good smack
detect mechanical shocks. The bender sensitivity. A small hook affixed to the will develop several volts across R 1,
comprises a piezoelectric-ceramic ele- mounting substrate limits motion so the 10-M resistor. The dual-timer
ment bonded to a thin brass disc. Such that the brittle piezoelectric element IC, IC 1, will then pulse the output
assemblies form the heart of many tele- will not crack. alarm for one minute at a 1-Hz rate.
phone annunciators and wrist-watch For three-axis sensitivity, solder one The alarm has its own driver circuit
or panel-mounted alarms. edge to a mounting bolt as before. At and sounds a piercing 90-dB tone when
Depending on the mounting the other edge, solder a flat-head bolt energized.
scheme, the bender can sense shocks that points away from the mounting The bender and alarm are both
in one axis (Figure 1a) or three axes substrate. Use a pair of jam nuts to available from Projects Unlimited,
(Figure 1b). For one-axis sensing, sol- increase the assemblys polar moment Dayton, OH.EDN

Figure 1 Solidly mounting one end of a piezoelectric bender and affixing a weight to the opposite edge transforms the bender
into a shock sensor. Here, a is sensitive to vertical-axis shocks only; b senses shocks in all three axes.

Figure 2 The circuit sounds a 1-sec alarm whenever you give the bender a good smack.

[ www.edn.com ] May 2013 | EDN 55

You might also like