Infrared Transmitter Project
In robotics, infrared is commonly used both in communication and in object detection. (Used for opponent detection in my Bugdozer and Number Two sumo combat robots.)
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!
Unique Signal
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 Transmitter Project Implemented on a Solderless Breadboard
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.
- For completeness, a simple power supply circuit is included to run the 5 volt board from a common 9 volt battery. If you already have a power supply capable of delivering 5 volts, then the “Power Supply” section of the breadboard can be completely eliminated.
- For testing purposes, the pushbutton (SW1) can be pressed to turn off the infrared LED (LED20). Eventually the ENABLE_OSC1 wire will be connected to a microcontroller or PC port to modulate the data to be transmitted, in which case SW1 and R7 will be eliminated.
- The transistor (Q20) and limiting resistor (R20) provide more current to the infrared LED (LED20) than the HC (high-speed CMOS) NAND chip (IC1) could supply by itself. If you use a 74AC00 (advanced CMOS) NAND chip, and 24 milliamps is enough current for your needs, then Q20 and R20 can be eliminated. In that case, R21 becomes the current limiting resistor, and the value should be reduced to 470 ohms or less.
NAND oscillator schematic
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.
Parts List
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.
- Unlike a standard inverter oscillator, this can be enabled and disabled instantly with a logic low (ground IC1 pin 2).
- The NAND chip is cheaper and more likely to be readily available in a hobbyist’s junk box than is the 555 multivibrator.
- The “NAND Oscillator” portion of this project uses about 3 milliamps when enabled and around 50 microamps or less when disabled (because it stops oscillating).
- NAND gates 3 and 4 buffer the signal so that the load on OSC1 doesn’t affect charge and discharge times (as the load would if it were hooked directly to the output of NAND gate 2 (IC1 pin 6).
- NAND gates 3 and 4 also insure OSC1 goes low when the circuit is disabled, thus turning off the infrared LED.
- Although untested, other CMOS variations should be acceptable substitutes. TTL (including LS, ALS, and F) are not acceptable substitutes, because TTL gate inputs require much greater current than R3 and R4 allow.
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.
- Two resistors were chosen in series because I didn’t have a single 150 kilohm resistor. Use other resistors in series if you don’t have the values I had.
- Higher values further reduce the voltage supplied to IC1 pin 1. At a certain point, the high voltage levels would not meet the required CMOS input minimum. This would cause the input to be noisy and erratic, thus using more power and providing an uneven oscillation output.
- Lower values would not reduce the voltage enough. It would exceed the maximum and could damage the chip.
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.
- R5 could be a 25 kilohm potentiometer, but will be more difficult to fine tune because more ohms are adjusted per degree of turning.
- R6 isn’t absolutely necessary, but it provides a nice minimum value so that if R5 is adjusted to zero, the amount of current that can flow through the NAND chip (IC1) is well below the maximum it can safely supply.
- Higher values cause the charge/discharge time to increase, thus lowering frequency.
- Lower values cause the charge/discharge time to decrease, thus raising frequency.
- At a certain point, a significant alteration of these resistor values would require R3, R4, and C1 to be adjusted to match. These components work together.
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.
- Higher values may not be able to react quickly enough to the needs of the chip. There’s a relationship between the storage capacity of a capacitor and frequency, with higher frequencies being affected by lower value capacitors.
- Lower values may not have enough current stored to support the needs of the chip when called upon.
- This is an optional component that could be removed from the circuit. It simply squares-up the output wave. Since the wave is about to be transmitted via LED into a very noisy environment, the ringing probably won’t make any difference. Still, why not reasonably reduce as much noise as we have control over?
These dampening resistors slightly decrease power usage and improve rise time.
- Optional components that could be replaced with plain wire (direct connections).
(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 Supply
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!
Infrared Emitter Driver
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).
- Higher values begin to prevent enough voltage and current from reaching the base of the transistor (Q20). This would prevent the transistor from fully saturating to an “on” state. We want the transistor to act like an on/off switch, not a variable resistor. A nice square wave is desired.
- 1, 2.2, or 4.7 kilohms are acceptable substitutions.
- Lower values cause the NAND chip’s current to begin driving the infrared LED, not just control it. Since we know that the HC NAND gate isn’t capable of driving the LED by itself, let’s keep the power flowing from a component that’s designed to handle it.
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.
- Higher values cause the infrared LED to not be as brightly lit, because less current would flow through it.
- Lower values cause the infrared LED to shine more brightly. The 7 milliamp limit currently chosen for this circuit is too conservative for actual use. Many infrared LEDs are capable of 40 milliamps continuous, perhaps more peak. Check out the datasheet on the LED you choose to use.
- Removing this resistor would be a disaster. Nothing would intentionally limit the current through the LED and it would melt or pop or otherwise die a rapid and horrible death.
This transistor acts as an on/off switch for the infrared LED.
- Substitute a 2N3904 if you don’t have a 2N2222 lying around. The 2222 is a nearly identical replacement for the 3904, but the 2222 has improved efficiency at higher amperage. So, why not get used to designing with 2222s instead of 3904s?
- Substitute a standard visible red LED while building and testing the circuit, so that you can see that it’s working.
Debugging Infrared LEDs
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.
Postscript
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.My circuit has been considerably improved since the original design. See 555 Infrared Emitter and chapters 11-12 of Intermediate Robot Building.
BY... SUYOG K.GAYDHANE
MOBILE NO..9422610107
Comments
Post a Comment