Infrared breadboard and battery
Many sources of infrared radiation light up and bounce around the environment. The sun, standard light bulbs, computer monitors, and even visible-light LEDs produce different levels of infrared light. If a device simply relied on the presence or lack of presence of infrared light, the communication or object detection algorithm would receive false and noisy readings.
What’s a common way of making a normal LED more noticeable? Blinking!
By blinking an infrared LED, the signal becomes more unique and therefore more discernible from other light sources. Even as intensity varies based on lighting, angle and distance, the constant rate of blinking can be relied upon for recognition.
The rate of blinking should be sufficiently fast so that the signal can be quickly recognized as being “on”. Since it takes a few blinks to detect the signal, delivering a message with a slow blink would be very time consuming. But, the rate of blinking shouldn’t be so fast that expensive high-speed electronics are necessary.
If the device relies on a signal rates already in use, inexpensive and reliable mass-produced parts will be available. It turns out that a popular consumer device, the remote control, provides the robot hobbyist just that opportunity. A common rate for remote control infrared transmissions is between 35 and 40 kHz (35,000 and 40,000 blinks per second), and that’s exactly what this project is designed to generate.
Infrared breadboard labeled
My friend, Tom, thinks this picture is too wide (to fit a standard screen) and too big in file size (for the time it takes to download with standard modems [in the year 2000]). I think it’s appropriate for the details that are necessary to display and for the intended audience. So, who cares what Tom thinks!
This looks more difficult than it really is.
NAND oscillator schematic
This schematic has been undergoing revisions. The changes have been to correct typos and drafting mistakes (an earlier version stated that the output of OSC_1 was 38Mhz, not 38 kHz). Recently, I learned that the proper capitalization of the unit name for kilohertz is kHz (small k, capital H, small z), not KHz (capital K). As a software engineer, I’ve been hanging around kilobytes and kilobits (KB and Kb) for too long. Perhaps the 'K' is capitalized in those units because it represents 1024, not 1000.
There should also be a space between a number and its units. For instance, “1 nF” rather than “1nF”. A quick examination of reputable datasheets (such as from Texas Instruments) confirmed my grammatical ignorance. I suspect I’ve still got a lot of things to learn about electrical engineering standards.
The higher potential voltage line should be labeled VCC. But, +5 V seems more instantly understood by most hobbyists.
IC1: Quad 2-Input NAND Gate IC. 74C00 (buffered CMOS), 74HC00 (high-speed CMOS), or 74AHC00 (advanced high-speed CMOS).
Three out of four gates have inputs tied together to form three inverters. The AND portion of the NAND is used only on the first gate.
R3 and R4: Approximately 150 kilohms combined, 1/8 watt.
This resistor (or multiple resistors in series) provides feedback as to the capacitor’s (C2) voltage level. This resistor forms a voltage divider with IC1 pin 1 (the first NAND gate) to ensure the high and low voltage levels are within CMOS input ranges.
R5: 10 kilohm variable resistor or potentiometer (with pin 1 or pin 3 not connected). Usually set about half-way (5 kilohms). Armature noise isn’t an issue because it’s not going to be adjusted often.
R6: 4.7 kilohm resistor. Tolerance and actual value not particularly important as long as R5 and R6 cover the range of approximately 7 to 15 kilohms combined. 1/8 watt.
This resistor (combined) forms an RC circuit with C2. The current limiting ability of the resistor and the storage capacity of the capacitor determines how long it takes to charge and discharge. By adjusting R5, more or less current is allowed to flow into the capacitor, thus speeding up or slowing down the switching of the output, thus adjusting the frequency.
C2: 1 nanofarad non-polarized capacitor. Tolerance isn’t an issue, as R5 can be adjusted to tune the frequency.
The time this capacitor takes to charge and discharge defines one cycle of the output wave. The low value of the capacitor combined with the high value of the resistors (R5, R6) reduce the power consumed.
C1: 1.5 microfarad capacitor. Tolerance isn’t an issue.
This decoupling capacitor provides juice to IC1 as needed. It really cleans up ringing on the OSC1 output.
R1 and R2: 10 kilohms resistors, 1/8 watt.
These dampening resistors slightly decrease power usage and improve rise time.
R7: 10 kilohm resistor, 1/10 watt.
(In hindsight, a 100 kilohm resistor would be a better choice.) This is a pull-up resistor which causes the NAND gate to receive a high-logic voltage unless the SW1 button is pressed.
SW1: Pushbutton make, 1/10 watt.
When the pushbutton is pressed, the NAND gate receives a low-logic voltage because it is now connected to ground. Since this logic value remains constant, the oscillations immediately cease. Following the logic values from gate to gate: high, low, high, low to emitter driver; thus the LED is not turned on.
While pressed, current flows through R7 directly to ground. This is wasted power, which is why increasing R7 to 100 kilohms decreases power usage without sacrificing performance.
When the pushbutton is released, R7’s current can no longer flow to ground. So, R7 is then providing a high-logic voltage to the NAND and oscillations start back up.
Power system schematic
Parts List (partially completed)
B11: 7805 BT positive fixed 5-volt voltage regulator
An LM2940T-5.0 could be substituted to allow a lower input voltage while still providing 5 volt output. However, on this board, the 2940 used several milliamps more current than did the venerable 7805.
B11: +9 volt battery
If U10 is a 7805, then this power source must be at least 8 volts to insure a 5 volt output. If U10 is an LM2940T-5.0, then a 6 volt battery could be substituted for B11.
C11: 47 microfarad capacitor.
This decoupling capacitor is required if you substitute an LM2940T-5.0 voltage regulator for U10. The 2940 doesn’t regulate at all without it. Watch that chip fry!
A driver is necessary because a standard (high-speed CMOS) HC* chip is only capable of sourcing a few milliamps of current. That would make the infrared LED (LED20) very dimly lit, thus limiting the effective distance of communication or object detection.
*(The circuit is designed so that various families of CMOS chips can substituted for IC1. The emitter driver allows a lower current-drive capable chip to be installed. The emitter driver also works just fine with a higher current-drive capable chip.)
Infrared emitter driver schematic
R21: 10 kilohm resistor, 1/8 watt.
This resistor limits the amount of current being drawn from the NAND chip (U1).
R20: 470 ohms resistor, 1/4 watt or higher (so up to 50 milliamps can be driven). Or, 1/2 watt and drive 5 LEDs!
This resistor limits the amount of current flowing through the infrared LED (LED20). Ohm’s law describes the amount of current = ( 5 V - 1.7 V ) / 470 ohms = 7 milliamps.
Q20: MPS2222 or 2N2222A NPN bipolar, small signal transistor.
This transistor acts as an on/off switch for the infrared LED.
LED20: Infrared LED. This LED emits the pattern of light-wave radiation that contains the 40 kHz carrier wave and your data. Choose an infrared LED with an emission cone (angle), physical shape, peak wavelength, and current capability of your choice.
Digital still cameras or video cameras can be very helpful in testing and debugging an infrared circuit. Although the naked eye can’t see that an infrared LED is turned on, CCD cameras can!
Left: Infrared LED turned off. Right: Infrared LED turned on
In the above images, a lit infrared LED is shown as it appears to the naked eye and the same lit infrared LED as it appears to the Sony Mavica MVC-FD90 digital still camera. Notice that the infrared LED appears as faint pink or purple to a CCD camera.
A simple (and inexpensive) trick during circuit building is to replace the infrared LED with a normal visible LED (like plain red). This allows quick verification of operation as well as provides for cheap replacement if the LED becomes damaged.
Using an HC NAND gate as an oscillator is apparently a popular trick. There once was a site by Walter Krawec that described the same technique. But now it appears to be gone.