Introduction: LED Transceiver
LED Transceiver is a combination of a transmitting circuit and a receiving circuit. It uses an LED to transmit the bit stream over a channel. In our case we are using clear LEDs to pass a bit stream from one computer to another through air.
Let's get to the project and discuss relevant stuff then and there. To build the circuit, we need several parts;
- LM339 OpAmp (Comparator)
- LM386 OpAmp (20 Gain Amplifier)
- Photo Transistor (ST1KLA)
- Clear LED (Blue or Red preferable)
- 3.9k Resistor
- 3.3k Resistor
- 330 Resistor
- Set of wires
- A proto board
- 10k square trimming potentiometer
- RS232 module
- 4 x male to female jumper wires
Apart from these, you'll need a multi-meter to debug your circuit and for a few adjustments and a wire cutter (or a scissor)
The first thing you need to do is identifying the pin structure of the OpAmp ICs...
Step 1: Identifying the OpAmps
This is "Low-Power Low-Offset Voltage Quad Comparators" according to the datasheet from Texas Instruments. You can find the LM339N Datasheet here. This is a single supply OpAmp which is the best choice for a USB powered circuits. There are 4 comparators but we need only one. You can choose one out of these four and carry on building the circuit.
This is another product from Texas Instruments which is a "Low Voltage Audio Power Amplifier". It usually has a gain of 20 which can be increased up to 200. We can manage our task with just the 20 gain. The LM386 Datasheet can be found here. This is also a single supply OpAmp IC. The reason why we are stick to single supply ICs is that the USB cannot be configured properly to work with dual supply ICs since they require a negative voltage as well.
Step 2: Selecting the Correct LED
There are two types of LEDs available in the market.
- Diffused LED
- Clear LED
These LEDs have an opaque lens on the top of it which enables disperse of light emitted from the pn junction.
These LEDs have clear lenses and the light beam has a directivity to it. Which makes it ideal to our project.
Clear LED is the suitable LED type for the project, since we need the light beam to travel as far as it can without dispersing much.
Step 3: Building Up the Circuit
When all the components are ready, we can start building the circuit.
Plug the OpAmp ICs onto the proto board and connect the power pins to their respective +5V and GND rails. Connect the resistors and other wires according to the schematic given.
We are getting +5V and ground voltages from the RS232 module. It got 5 pins and we are using only 4 except to the 3.3V pin. If we look at the pins of an RS232;
- 5V - +5V supply
- GND - Ground
- Tx - Transmitting pin
- Rx - Receiving pin
You need to install drivers to use this RS232 module. The necessary setup files are attached here with. Even after installing, you have to go to device manager of your computer while the RS232 being plugged into the USB. Then select the COM port and update drivers using available drivers in your computer option. Once it is installed you can use a serial monitor to check if it's working by connecting the Tx pin to the Rx pin and sending a sample data over it. A proper serial monitor can be downloaded from the internet. I used mikroC PRO for PIC - C compiler as the serial monitor.
Using the multi-meter, try to set the middle pin voltage of the 10k potentiometer to a value approximately equal to 3.85V which will be the reference voltage to the comparator. So if any voltage comes above this value, it will be a '1' to the computer while anything below this value will be a '0' to it.
Once the circuit is complete, connect a photo transistor and a clear LED to the respective pins and enjoy bit transmission!!!
We have a be nice policy.
Please be positive and constructive.