Silicon ChipProtoboards: More Fun With Comparators - March 2001 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: The electrical wiring debate - reform is needed
  4. Feature: What's On Offer In "Walkie Talkies" by Ross Tester
  5. Feature: Mobile Magic: Driving Your Mobile Phone From A PC by Greg Swain
  6. Feature: Using Infrared Devices With Your PC by Greg Swain
  7. Review: Reiew: Marantz DR 6000 CD Recorder by Leo Simpson
  8. Feature: CB Radio Can Now Transmit Data by Silicon Chip
  9. Project: Big-Digit 12/24-Hour Clock by John Clarke
  10. Product Showcase
  11. Project: A Sun-Seeking Sunflower by Craig Maynard & Ross Tester
  12. Project: Parallel Port PIC Programmer & Checkerboard by David Deer
  13. Feature: Making Photo Resist PC Boards At Home by Ross Tester
  14. Project: Protoboards: More Fun With Comparators by Leo Simpson
  15. Project: More-MIDI: A Simple MIDI Expansion Box by Jim Rowe
  16. Vintage Radio: The 1929 AWA C58 radiogram by Rodney Champness
  17. Back Issues
  18. Notes & Errata
  19. Product Showcase
  20. Market Centre
  21. Advertising Index
  22. Outer Back Cover

This is only a preview of the March 2001 issue of Silicon Chip.

You can view 32 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)
Articles in this series:
  • Amateur Radio (November 1987)
  • Amateur Radio (November 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (December 1987)
  • Amateur Radio (February 1988)
  • Amateur Radio (February 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (March 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (April 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (May 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (June 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (July 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (August 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (September 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (October 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (November 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (December 1988)
  • Amateur Radio (January 1989)
  • Amateur Radio (January 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (April 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (May 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (June 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (July 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (August 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (September 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (October 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (November 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (December 1989)
  • Amateur Radio (February 1990)
  • Amateur Radio (February 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (March 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (April 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (May 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (June 1990)
  • Amateur Radio (July 1990)
  • Amateur Radio (July 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • The "Tube" vs. The Microchip (August 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (September 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (October 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (November 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (December 1990)
  • Amateur Radio (January 1991)
  • Amateur Radio (January 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (February 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (March 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (April 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (May 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (June 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (July 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (August 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (September 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (October 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (November 1991)
  • Amateur Radio (January 1992)
  • Amateur Radio (January 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (February 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (March 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (July 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (August 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (September 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (October 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (November 1992)
  • Amateur Radio (January 1993)
  • Amateur Radio (January 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (March 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (May 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (June 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (July 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (August 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (September 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (October 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (December 1993)
  • Amateur Radio (February 1994)
  • Amateur Radio (February 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (March 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (May 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (June 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (September 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (December 1994)
  • Amateur Radio (January 1995)
  • Amateur Radio (January 1995)
  • CB Radio Can Now Transmit Data (March 2001)
  • CB Radio Can Now Transmit Data (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • What's On Offer In "Walkie Talkies" (March 2001)
  • Stressless Wireless (October 2004)
  • Stressless Wireless (October 2004)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • WiNRADiO: Marrying A Radio Receiver To A PC (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • “Degen” Synthesised HF Communications Receiver (January 2007)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • PICAXE-08M 433MHz Data Transceiver (October 2008)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Half-Duplex With HopeRF’s HM-TR UHF Transceivers (April 2009)
  • Dorji 433MHz Wireless Data Modules (January 2012)
  • Dorji 433MHz Wireless Data Modules (January 2012)
Items relevant to "Big-Digit 12/24-Hour Clock":
  • Big-Digit 12/24-Hour Clock display PCB [04103012/04102011] (AUD $15.00)
  • Big-Digit 12/24-Hour Clock processor PCB [04103011] (AUD $15.00)
  • PIC16F84(A)-04/P programmed for the Big-Digit 12/24-Hour Clock [CLOCK1.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F84 firmware and source code for the Big-Digit 12/24-Hour Clock [CLOCK1.HEX] (Software, Free)
  • Big-Digit 12/24-Hour Clock PCB patterns (PDF download) [04103011/2] (Free)
  • Big-Digit 12/24-Hour Clock panel artwork and mask (PDF download) (Free)
Items relevant to "A Sun-Seeking Sunflower":
  • Sun-seeking Sunflower PCB patterns (PDF download) (Free)
Items relevant to "Parallel Port PIC Programmer & Checkerboard":
  • DOS and Windows software for the Parallel Port PIC Programmer (Free)
  • Parallel Port PIC Programmer PCB pattern (PDF download) (Free)
Items relevant to "More-MIDI: A Simple MIDI Expansion Box":
  • More-MIDI PCB pattern (PDF download) (Free)
  • More-MIDI panel artwork (PDF download) (Free)

Purchase a printed copy of this issue for $10.00.

More fun with comparators This month we try stacking two comparators to make a “window” comparator, a very commonly used circuit in all sorts of control applications. We generate an “input” signal using a potentiometer fed from DC and demonstrate how the window compara­tor responds to a varying DC signal. Pt.5 By LEO SIMPSON OK; what’s a “window” comparator? We’ve had a look at two variations of standard comparator circuits in the December 2000 issue and saw how they switch their outputs when the input goes above or below a reference voltage. Typically, a comparator’s output might be made to switch high when its input goes above +6V and a circuit for this is shown in Fig.1 on p75 of the December 2000 issue. As it happens, there were two comparator-based circuits in last month’s issue. Firstly, the Li’l Pulser train controller is based on two comparators connected to generate a PWM (pulse width modulated) waveform and secondly, the Bass Blazer frequency display has a whole bunch of comparators driving LEDs in four columnar arrays. There is no reason why you could not hook up the key parts on these circuits on your Protoboard and then, if you have an oscilloscope, see if you can duplicate the example wave­forms. Back to “window” comparators: say we wanted to produce a comparator circuit which would indicate when an input was above +6V and below +9V; ie, within a 3V range. We would need two comparators, one inverting and one non-inverting and they could be hooked up as shown in Fig.1. Notice that each comparator drives its own LED and that each comparator has its reference voltage derived from the same string of three resistors; after all, why have two voltage divider strings when we can do it with one? So pin 5 The circuit is fairly simple and should only take you about 10 minutes to wire up. The pot at far right is not used in this circuit. is connected to a (nominal) reference of +6V and pin 2 is connected to +9V. We also derive the input voltage from the same potentiome­ter, VR1, and as we wind the pot up and down, the LEDs will tell the story. The Protoboard layout for Fig.1 is shown in Fig.2. When we wind up VR1 so pin 6 of IC1b is above +6V, LED2 lights. And when pin 3 of IC1a is below +9V, LED1 lights. What we find is that when the input from VR1 is between +6V and +9V, both LEDs will be alight – this is the condition we wanted to detect. Furthermore, when pin 3 of IC1a is above +9V, LED1 will be off but LED2 will be on, because pin 6 of IC1b will be above pin 5. And when pin 6 of IC1b is below pin 5 (ie, below +6V), LED2 will be off and LED1 will be on. So we see that the two comparators together give an indica­ tion when an input voltage is above +6V and below +9V (both LEDs on) but it is a bit “mickey mouse”: both LEDs need to be on to indicate the wanted condition and if just LED1 or LED2 is on, then the wanted condition is not there. What we really need is a combination circuit which will drive just one LED to indicate the wanted condition where the input voltage is within the range of +6V and +9V. MARCH 2001  81 Fig.1: both of these comparators drives its own LED and each comparator has its reference voltage (9V or 6V) derived from the same string of three resistors. The input voltage for both comparators comes from the same potentiometer, VR1. Let’s try the new circuit of Fig.3. It still uses two com­parators, one inverting and one non-inverting, but now they both have their outputs joined directly together and they just drive the one LED. Normally, connecting the outputs of two op amps together would cause serious problems but we are using compara­tors with “open collector” outputs which require a pullup resis­tor. Open collector outputs In reality, an “open collector” output is an NPN transistor with its collector connected to the output pin, as shown in Fig.4 which is the sim- plified schematic for one comparator in an LM393. Because nothing is connected to this collector, we say it is “open collector” (as in open-circuit). For the transistor to work, it must have a “pullup” resistor to the positive supply rail (in this case +12V). When the transistor is “off”, the pullup resistor “pulls” the output high. And naturally, when the transistor is “on”, the output will be pulled low. Now the point about comparators with open collector outputs is that you can connect two or more comparator outputs in paral­lel without any chance of damage and they can all drive a common load. Even more to the point, if one comparator output is on and all the others are off, the common output is still low. Some designers like to think of this as an OR gate function whereby all the comparator outputs are ORed together. Personally, I don’t think this helps in understanding the principle. It is quite simple – they’re all in parallel and if one switches low, the common output is low and that is that; it doesn’t matter what the other comparators do. By the way, in some data books you will see “open collec­tor” outputs referred to as “uncommitted”. It means the same thing. The other point of difference between Fig.3 and the first circuit of Fig.1 is that we have swapped both sets of comparator inputs. If they’re not swapped, you will find that the single LED stays on all the time. If you think about the circuit of Fig.1, where at least one LED is on all the time, then it stands to reason that if we now use a common LED it will be on all the time; hence the need to swap the comparator inputs. Oh and there is one other difference between the circuits of Fig.1 & Fig.3. In the latter diagram we have substituted “real world” values of 4.7kΩ for the 5kΩ resistors and these change the reference voltages slightly. So now what happens as we vary VR1? This will swing the input voltage to the two comparators over almost the full supply range. When the input voltage is at its lowest (ie, with Fig.2: use this diagram to wire up the circuit of Fig.1. Winding VR1 up and down will cause the LEDs to light independently. 82  Silicon Chip Truscott’s •RESELLER FOR MAJOR KIT RETAILERS •PROTOTYPING EQUIPMENT •COMPLETE CB RADIO SUPPLY HOUSE •TV ANTENNA ON SPECIAL (DIGITAL READY) •LARGE RANGE OF ELECTRONIC COMPONENTS Professional Mail Order Service Fig.3: this circuit is similar to Fig.1, using two comparators, one inverting and one non-inverting, but now they both have their outputs joined directly together and they just drive the one LED. This is permissible because they have “open collector” outputs. VR1 set for maximum resistance), pins 2 & 5 will be at around +2V; ie, well below the reference voltages for both comparators. As a result, IC1a’s output will be high (ie, off) and IC1b’s output will be low (on). Therefore LED1 will light. When the input voltage from VR1 is between +6V and +9V (say +7.5V) both outputs (of IC1a and IC1b) will be high and the LED will be off. And when the input from VR1 is above +9V, IC1a will be low (on) and IC1b will be high (off), so LED1 will be on again. Wrong result But this is exactly the reverse result to what we wanted! We wanted LED1 to light only when the input voltage from VR1 was between +6V and +9V. What to do? The easy approach would be to use another comparator to invert the common outputs of IC1a & ICb and that is what you often see when a window comparator is called for – the design uses three comparators. But there is a simpler way. Merely by moving LED1 so that it is now between the commoned pins 1 & 7 and 0V, as shown in red on Fig.3, we get the right result. LED1 now lights for input voltages between +6V and +9V. So that’s the window comparator: two comparators driving a common LED to indicate inputs between two SC separate voltage thresholds. Fig.4: this is the simplified schematic for one comparator in an LM393. It shows the output as an “open collector” NPN transistor (Q8). This requires a pullup resistor for the NPN transistor to work. (National Semicon­ ductor Linear Data Book). Truscott’s Amidon Stockist ELECTRONIC WORLD Pty Ltd ACN 069 935 397 Ph (03) 9723 3860 Fax (03) 9725 9443 27 The Mall, South Croydon, Vic 3136 (Melway Map 50 G7) email: truscott<at>acepia.net.au www.electronicworld.aus.as P.C.B. Makers ! • • • If you need: P.C.B. High Speed Drill 3M Scotchmark Laser Labels P.C.B. Material – Negative or Positive acting • Light Box – Single or Double Sided – Large or Small • • Etch Tank – Bubble • • Prompt and Economical Delivery Electronic Components and Equipment for TAFEs, Colleges and Schools FREE ADVICE ON ANY OF OUR PRODUCTS FROM DEDICATED PEOPLE WITH HANDS-ON EXPERIENCE We now stock Hawera Carbide Tool Bits KALEX 40 Wallis Ave E. Ivanhoe 3079 Ph (03) 9497 3422 FAX (03) 9499 2381 ALL MAJOR CREDIT CARDS ACCEPTED MARCH 2001  83