Infrared with RS232 feasbilty

A while ago I bought a robot and a new Mboard for it, and I want to control it wireless, preferbly with my arduino esplora. I already used bluetooth with succes but I found all the apps to be to primitive, then I tried infrared with the IR library, that worked half. I could read out my remotes but the library disables the PWM on the left engine. ofcourse I could take a look into the library and take another timer but the basic sketch already uses 10kB out of my 24kB flashmemory so this library is not very practical. I am not buying Xbees, that costs money :-*

I devised a way to use infrared on a different way. I have a pic16f690 programmed to output the required 38kHz signal for the IR LED. Now I want to combine this with the Tx pin so I can use all Serial functions. I put the baud rate at 4800 bps, as low as possible. My current setup consists out of 2 BC517 NPN transistors which form an AND gate togather. the PWM signal goes through a 10k resistor to the base of the first transistor. It is the idea that the tx pin opens the 2nd transistor.

I tested the circuit and when I steer both transistors open via 10k resistors the led shines bright in my camera and 60mA flows through the infrared LED like I want.

I was under the assumption that the arduino uses it's internal pull-up 10k resistors by default when using Serial.begin(), as the default state of the Tx/Rx pins is high, and no current is needed for data transfer. So I thought: I directly connect the Tx pin to the base of the 2nd transistor, in the hope it would supply enough power to steer the 2nd transistor open.

the program is simple, the arduino is to send out a byte every second and I can succesfully read out the entire ascii table on my screen...

Ofcourse I post this because it doesn't bloody work :D

A few things I noticed, is the following: 1. When I plug in the cable of the transistor base, the arduino stops transmitting, the Tx LED wont blink, and I get nothing on my screen.

  1. When I disconnect the usb cable and use an other 5V power supply, the Tx LED won't blink and thus Tx is not sending anything, with nothing connected to the Tx pin.

What I would like to know is the following:

1: is it necessary to have an order microcontroller or usb cable attached to the Tx pin in order to transmit data, and why is it needed??

2: can you think of anything why the arduino stops transmitting when I plug the transistorbase in the tx pin. Is it perhaps some kind of security that disables it when you try to get a current out of it??

3: Are my assumptions about the internal pull-up resistors correct and is there more to it?? I coudln't steer open the transistor with a 20k resistor.

I am soon going to replace the 2nd npn transistor with an N-channel mosfet, So I wont draw any power out of the Tx pin.

38000 / 4800 = ? Is that long enough for your receiver?

Can you post a schematic diagram (not Fritzing)?

Why not ditch the 38kHz carrier and just work baseband? It works for IRDA.

I was under the assumption that the arduino uses it's internal pull-up 10k resistors by default when using Serial.begin(),

You assume wrong. First the internal pull up resistor is not 10K but can be anything between 30K and 60K. Second having a pull up on an output makes no sense at all.

I directly connect the Tx pin to the base of the 2nd transistor, in the hope it would supply enough power to steer the 2nd transistor open.

Remember a pull up resistor goes from an input to the 5V supply, it does not limit the current from an output pin. So you have effectively shorted out the TX pin to ground, well 0.7V actually but you are burning the pin.

and no current is needed for data transfer.

That's news to me, what makes you think that?

Draw a schematic then it will be obvious what you have done wrong.

I now see on the page http://arduino.cc/en/Tutorial/DigitalPins that the internal pull-ups are indeed higher then I originally thought. 20K is to high to steer the transistor open.

I have read, that with I2C, arduino uses these pull-ups resistors automatically when using the wire library. Some I2C slaves can be hooked up directly on the arduino without the need of external pull up resistors. So data transfer is more done by voltage than by current

with the oscilloscope I determened that with no data transfer the voltage on both the Tx and Rx pins is 5V, that is why I still think arduino uses the internal pull-ups when you call serial.begin();

I have uploaded my schematic, the 2 transistors form a logic AND gate togather

To answer AWOL:

  1. I have no idea if 6-7 pulses are long enough for the receiver, it is what I am hoping for :wink:
  2. I have little to no experience with infrared datatransfer, with the IR library I could succesfully read out any TV remote I had lying arround but the basic sketch consumed over 10kB of flash memory. plus that it disables a critical PWM pin, so this was not very practical

the only solution I now can see is to replace the 2nd transistor by a mosfet

I have read, that with I2C, arduino uses these pull-ups resistors automatically when using the wire library. Some I2C slaves can be hooked up directly on the arduino without the need of external pull up resistors. So data transfer is more done by voltage than by current

You make several mistakes here. 1) While the internal pullups are activated they are not sufficient for correct operation, see:- http://www.dsscircuits.com/index.php/articles/47-effects-of-varying-i2c-pull-up-resistors 2) Voltage and current are both involved with data transfer.

I am not sure if you understand the nature of electricity and electronics.

with the oscilloscope I determened that with no data transfer the voltage on both the Tx and Rx pins is 5V, that is why I still think arduino uses the internal pull-ups when you call serial.begin();

Again you might come tothat conclusion but you are wrong. What holds the Tx data up is the fact it is an output outputting a mark state which in TTL levels is a logic one. The Rx line is simple input being held high by the USB / serial convertors output.

I have uploaded my schematic, the 2 transistors form a logic AND gate togather

So you have a series LED in the circuit along with two transistors. The bottom one is working as a common emitter amplifier and the top one as an emitter follower. Beside the lack of voltage on the whole thing due to the LED ( what colour is it ) that will not work.

It is an INFRARED led ofourse, this entire topic is about this LED. I calculated the resistor as follows; (5V (VCC) - 1.3V(U,led) - 0.7V (measured Uce) - 0.7V (Uce)) / 0.06A = 38 Ohm.

The calculation is correct, [u]I have measured 60mA, exactly which I want[/u], and If I steer open both transistors with 10k resistors on both the trans. bases, [u]the circuit works just fine[/u]. It is just a normal AND gate made of 2 lose npn transistors. I believe I told this 3 times now?

I was just unsure about the exact operation of the Tx pin and it being perhaps unable to steer a transistor open. tomorrow I will try and see if my IR receiver can receive anything

instead of insulting me with with your "I am not sure if you understand the nature of electricity and electronics." and your arrogant attitude, you could also read like all of the text so I won't have to type everything 3x.

besides the ^, thank you for your explanation about the operation of Tx pin, I will test what power it can supply with a more decent multimeter

Post a schematic please.

MorganS: Post a schematic please.

He has in reply #3

@38 kHz use up to 2400 BAUD when attempting serial over IR.

Short bursts are your your friends.

You might get better speeds at 56kHz, but not much better.

I would use some sort of logic gate (or equivalent using transistors) to merge the carrier with data.

This InfraRed comms Thread may be of interest.

...R