Circuit Corner - Issue 8
This issue, I'm going to present a few more random circuits from my black book. These are circuits that I had to design and build for a specific purpose, but may be useful to someone.
Simple PWM Timer
One of my current projects involves designing a temperature controlled crystal oscillator. Part of that goal involves the design of a temperature regulator, which comprises two main parts: a PWM oscillator and a PID controller. While the PID controller is still a work in progress, the PWM oscillator has been built and works rather well.The circuit has one input port and one output port. The input port is the PWM modulation input, which ranges from 1V to 3V. An input below 1V will turn the output off, and an input above 3V will turn it full on. Any level between will cause that level of modulation. It can also be used as a ramp generator by tying the input and output ports together and adding a pull-up resistor (4.7k should work).
The circuit is basically a relaxation oscillator, a design that has not seen much use in the semiconductor era. The two rightmost transistors are arranged in a configuration that bears a resemblance to a schmitt trigger. They exhibit hysteresis, turning on at 3V and then back off at 1V. Rather than the normal function of a schmitt trigger, though, this circuit has no output port; when it triggers, the input impedance drops sharply, acting much as a gas discharge tube, discharging the capacitor rapidly back to 1V from the 3V trigger voltage. When the capacitor reaches the lower threshold, the circuit turns off again, and presents a very high input impedance and allowing the capacitor to recharge.
There is one very important thing to note about the discharge tube simulator circuit: the first transistor needs a very low hFE. If the gain is too high, the capacitor trickle charge current will be sufficient to keep it saturated, and it will fail to oscillate. Transistors with a low enough hFE are hard to find these days, so I simply turned a standard BC547B upside-down. A little known feature (or occasional misfeature) of the transistor is the "reverse-active" mode, in which they amplify even when the pins are reversed, although at a lower gain. There is one subtle gotcha involved though: the lower EBJ reverse breakdown voltage means this circuit cannot be operated at a voltage higher than about 5V.
The string of 3 PNP transistors on the top form a current mirror, feeding a constant current into both the timing capacitor and into the emitters of the comparator pair. The comparator is a simple current-steering arrangement, pushing the bias current into either ground (through the diode) or into the base of the output buffer transistor. The output buffer provides up to about 20mA of current as an open collector. Use a 4.7k resistor to drive a digital circuit.
It should also be possible to replace the output transistor with a darlington and add an extra diode in series with the first one in order to directly drive higher current devices. In the case of my application, I will likely do exactly that (possibly tweaking the 1.5k resistor slightly to make up for the extra floor voltage) and directly drive a 10W power resistor as the heating element.
Microcontroller Soft Power Controller
A common task in small, battery-powered devices is turning the main power on and off, especially under software control. In many interactive devices, power is switched on manually, but switched off from software.This simple circuit is designed for just that task. A single button is used both to turn on main power, and for software-defined uses. A small capacitor, held empty by a resistor, is used to hold a PNP pass transistor in a disabled state. When power is off, there is virtually no leakage current. When the button is pressed, the capacitor is quickly charged and the pass transistor switches on. Software on the microcontroller must then raise the SHDN line to avoid having the power shut off. From then on, the button acts as any software-controlled button. The microcontroller can turn off the main power at any time by releasing the SHDN line.
The 78L05 low-current voltage regulator is an excellent companion to this circuit. The two allow a microcontroller to be powered from many standard batteries, including the ever popular 9V variety.


