Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
breyno2 said:Here's one way if you have a PIC with built-in hardware PWM. http://www.rentron.com/Micro-Bot/IR_Serial.htm
If you're using a MAX232, the IR detector output pin can connect directly the the MAX IC, and you can eliminate the 2N3906. If not, the receiver circuit shows how a direct connection works.
You can also program a small PIC, like say a 12F or 10F part to sample an input pin, and generate the IR carrier. I have .asm code on this page http://www.rentron.com/IR_TO_RF.htm using a 10F200.
Using the dedicated PIC to generate the carrier is the easiest way. You just fire serial data at it, and it outputs the data modulated at the carrier frequency. It's easy enough to modify the code to generate a different frequency depending on the IR module you have on hand.
If you need a higher data rate, the Vishay TSOP7000 would work. These allow data rates up to 20K bps, but the IR carrier needs to be 455kHz, and the cost goes up a bit. I've done this with a 12F675 @20MHz generating the 455kHz carrier similar to the 10F version above.
With most 38 to 40kHz IR modules, you can get around 1200 or 2400 bps (check data sheet for max), and the cost is lower.
You can use these to build IR wireless serial data links for sending data to a PC, wireless control of serial LCDs, and tons of other things normally done with a hard-wired serial connection. It's pretty easy, and a lot of fun.
I think you can get just as much range with the PWM if you use "a mosfet, transistor, etc, " on its output to drive the IR LED.breyno2 said:If you need more range, then program a small 10F or 12F part to use as the dedicated carrier generator. If prefer this route since it can be used with any I/O-pin on the main controller, and you can drive the IRLED with a mosfet, transistor, etc, for much better range.
breyno2 said:Here's one way if you have a PIC with built-in hardware PWM. http://www.rentron.com/Micro-Bot/IR_Serial.htm
If you're using a MAX232, the IR detector output pin can connect directly the the MAX IC, and you can eliminate the 2N3906. If not, the receiver circuit shows how a direct connection works.
You can also program a small PIC, like say a 12F or 10F part to sample an input pin, and generate the IR carrier. I have .asm code on this page http://www.rentron.com/IR_TO_RF.htm using a 10F200.
Using the dedicated PIC to generate the carrier is the easiest way. You just fire serial data at it, and it outputs the data modulated at the carrier frequency. It's easy enough to modify the code to generate a different frequency depending on the IR module you have on hand.
If you need a higher data rate, the Vishay TSOP7000 would work. These allow data rates up to 20K bps, but the IR carrier needs to be 455kHz, and the cost goes up a bit. I've done this with a 12F675 @20MHz generating the 455kHz carrier similar to the 10F version above.
With most 38 to 40kHz IR modules, you can get around 1200 or 2400 bps (check data sheet for max), and the cost is lower.
You can use these to build IR wireless serial data links for sending data to a PC, wireless control of serial LCDs, and tons of other things normally done with a hard-wired serial connection. It's pretty easy, and a lot of fun.
breyno2 said:Here's one way if you have a PIC with built-in hardware PWM. http://www.rentron.com/Micro-Bot/IR_Serial.htm
If you're using a MAX232, the IR detector output pin can connect directly the the MAX IC, and you can eliminate the 2N3906. If not, the receiver circuit shows how a direct connection works.
You can also program a small PIC, like say a 12F or 10F part to sample an input pin, and generate the IR carrier. I have .asm code on this page http://www.rentron.com/IR_TO_RF.htm using a 10F200.
Using the dedicated PIC to generate the carrier is the easiest way. You just fire serial data at it, and it outputs the data modulated at the carrier frequency. It's easy enough to modify the code to generate a different frequency depending on the IR module you have on hand.
If you need a higher data rate, the Vishay TSOP7000 would work. These allow data rates up to 20K bps, but the IR carrier needs to be 455kHz, and the cost goes up a bit. I've done this with a 12F675 @20MHz generating the 455kHz carrier similar to the 10F version above.
With most 38 to 40kHz IR modules, you can get around 1200 or 2400 bps (check data sheet for max), and the cost is lower.
You can use these to build IR wireless serial data links for sending data to a PC, wireless control of serial LCDs, and tons of other things normally done with a hard-wired serial connection. It's pretty easy, and a lot of fun.
simrantogether said:somebody talked about infrared..?
i have the answer...
buy the infrared LED.. and interface with the circuit that uses " 555 timer to generate the frequency of 38 KHz"..
the serial output of microcontroller should be at pin 4 of 555 timer...
the serial output should be preferably at 9600 baud...
Nigel Goodwin said:You appear to be missing the point of micro-controllers, you don't use the micro-controller to trigger a 555 - you simply generate the 38KHz dorectly in the micro-controller. It's easier, cheaper, simpler, more accurate and more reliable..
It's also a bad idea to try and send simple RS232 over an IR (or radio) link, you need to use some kind of coding if you want it to be at all reliable. Particularly important for IR, where the width of the pulses from the receiver isn't the same as those supplied to the transmitter.
simrantogether said:is it possible.. ?
is it possible to generate data at 9600 baud and modulating with 38khz on the same pin?
The microcontroller can only generate data at specific baud rate.. it has to be modulated so that it can be read by tsop1738...
it may be bad.. but effective .. all you have to do is to be in range of 10-20 feet.. the width of receiver will surely match of out transmitter...
also we need to add an amplifier at transmitter side.. for high power..
Nigel Goodwin said:Serial data is just a string of 1's and 0's, assuming you want the 1's to be bursts of 38KHz you simply toggle the pin at 38KHz the required number of times (again, check my IR tutorial).
You've obvoiously NEVER tried it, because it doesn't!
Why do you think IR remote controls don't use RS232?, it's because it doesn't work, or doesn't work reliably enough.
Again, check my tutorials! - it's dead simple.
simrantogether said:then how can we generate specific baud rate..?
Sir Nigel.. you are Right i never tried it.. but i am confident about this.. i feel.. tell mistake..
oh..! i got my mistake.. i never mentioned about max 232 that has to be interfaced between tsop and rs232...
most of remote controls can be used for tv only .. for very small applications...
but what when you have an infrared keyboard and you want to interface it with desktop only through rs232..?
Nigel Goodwin said:You simply time your 1's and 0's accordingly - off hand I seen to remeber 9600 baud is 105uS per bit? (check my RS232 tutorial which does mention it).
Confident and WRONG!
As you've never tired it you're assuming it works, but with no basis for that assumption.
Makes no difference to the point under discussion.
It's no different to any other application, in fact HDD's use the same Manchester coding as many remote controls do - and for the same reasons!.
You put a PIC each end, it encodes the transmission, and decodes the reception and converts it to RS232.
flemmard said:Sir,
Is it necessary to use MAX3222 to boost up? For my another school project, we have been asked to just connect two rs232 between computers for handshaking.
simrantogether said:somebody talked about infrared..?
i have the answer...
buy the infrared LED.. and interface with the circuit that uses " 555 timer to generate the frequency of 38 KHz"..
the serial output of microcontroller should be at pin 4 of 555 timer...
the serial output should be preferably at 9600 baud...
on the receiver side..
in windows operating system --- > go to start menu --- > go t programs ---> accessories ---> communications ---> hyperterminal --- > rs232 ( if the option is there..) ----> then name the file --- > then select the com port available ---> then select baud rate as 9600 & flow control as 'hardware' or 'none' ( this you have to check..) --->
the data sent by your microcontroller automatically appears at this window...
for this you should add this hardware..
TSOP 1738 on reveiver pin of serial port..
Regards..
Simran..
#include <pic1687x.h>
// Transmitter test program
void main() {
TRISC = 0x00 ; //portC as output
SPBRG = 129; // Set the baud rate to 2.4k
BRGH = 1; // Set high baud rate
SYNC = 0; // Set asynchronous
SPEN = 1; // Enable serial port pins
TX9 = 0; // Disable 9 bit transmission
TXIE = 0; // Disable tx interrupts
RCIE = 0; // Disable rx interrupts
TXEN = 1; // Enable the transmitter
while(1) {
while(!TXIF) { // Checks if the transmit flag is down
continue;
}
TXREG = 0b01010101;
}
}