RX pin Voltage

Hi, this is my first post, I used to find all my answers through google, but now I am not sure about how to look for this one:

I'm trying to send data over laser channel (IR-resistor plus laser diode) and the TX RX pins.

Does the RX pin outputs 5V every time? Wasn't just the TX pin the only one supposed to do that in the TTL protocol?

Should I configure the RX pin in INPUT mode?

I really don't know what's wrong... with the IR-reciever it just recieved garbage, now with the IR-resistor it just don't work...

Any extra ideas? thanks in advance!

If we are talking about a standard Arduino board with a FTDI serial USB convertor, then yes pin 0 will appear to have a +5vdc on it, but it's coming from the FTDI receiver driver because that is the idle (mark state, stop condition) state for TTL serial data.

However your external circuit should have little problem driving that pin to a low state as there is a 1k ohm resistor between the FTDI and pin 0. Think of it as an input pin with a 1k pull-up resistor installed.

Lefty

You can get away from all the issues of "sharing" pins 0 and 1 with the Arduino's connection to its programming host by doing YOUR serial work on a different pair of pins. You just use the NewSoftSerial library. Details at...

http://sheepdogguides.com/arduino/art4SeIntro.htm

Yes, I know... it is "hard" to "waste" two pins... but it is harder to "fight with" (and maybe damage!) the channel that the Arduino platform is using for other things. At least get the basics working on, say, pins 2 and 3... and then you can "move" what you've done to 0 & 1 if you really can't spare the pins. Maybe leave the serial comms on 2 & 3, and use 0 & 1 for a status LED and a less-than-vital input.

@Richard_Crowley:

Do you know that the transmit part is working properly? You can substitute a regular LED for the IR laser LED so you can see the flashes. You can also use many electronic cameras (still and video) to "see" the infra-red beam for you.

I know it is working because the 0.2mw Laser is blinking bery fast, stops due to a delay(500) and blinks again. It does the same for a green 2.3V LED.

I think it is doing something because the second arduino gets characters in Serial.available() but they are garbage. like "ÿÿÿÿýýÿÿÜÿ" (when I am transmitting "ARDUINO\n"

btw there is not any capacitor between the TX pin and the laser. And I tried it with Serial and NewSoftSerial.

How did you come up with this idea? How did you select the components? Is this something you have seen someone else do successfully? Or are you striking out into new territory? Did you get information about doing this from some other source? Can you tell us what it is?

It's a 50-50! I saw this video on youtube and grabbed the same components:

http://www.youtube.com/watch?v=5oeVNewQtkY&feature=player_embedded

Are you talking about pin 0 on a Duemilanove? Please tell us which board you are using and give more detail about how you have things connected. A pin named "RX" (receive) would NOT be expected to output anything at all since it is an input.

Yes, I have an old Duemilanove w/ ATMEGA168. I'm referring to the pin labeled as "RX", not anyone I chose on my own.

As retrolefty said, it outputs 5V signaling the device is IDLE. I don't know why. When I studied serial protocol there wasn't neither a way nor a reason to output an IDLE status to the oposite TX/RX, so that, there was an implementation for internal errors like "FRAMMING ERR" or "PARITY ERROR".

I don't know what an "IR-resistor" is? Again, you will need to provide all the things in the list above if you want more than our sympathy.

I think you misunderstood me. I don't want you to do my research job, that's something I do on my own and I enjoy the most.

This is the url to the 5000bps demodulator that got me garbage: http://www.pololu.com/file/0J19/TSOP34156.pdf

This is the datasheet for the phototransistor, or "IR-resistor" as I called it. http://home.comet.bg/datasheets/Infrared%20LED/L-53P3C(V4).pdf

And yes! I really appreciate your sympathy!

@retrolefty:

Ok, I get it. But... How the hell does the arduino recieves data from another device through the RX pin if it is already set to 5V? I there any chronogram or sketch to understand how the arduino uses the TTL logic to communicate? I have my old sketches from the university but they seem to differ...

I've never worked with pull-up resistors... I don't know how to deal with them... Which values does the arduino uses for the TTL logic? +5V,-5V? +5V, 0V? I may adapt the transistor to operate at another level...

Thanks in advance!

@tkbyd:

Ok, I'll try it... It can solve most of my problems if I deal with it in the early development.

Thanks!

I think it is doing something because the second arduino gets characters in Serial.available() but they are garbage. like “ÿÿÿÿýýÿÿÜÿ” (when I am transmitting “ARDUINO\n”

This looks like a mismatch in baud rates. We haven’t seen any code, yet.

This looks like a mismatch in baud rates. We haven’t seen any code, yet.

Sorry, I thought it was not relevant. I programmed the both arduinos with the same baudrate. I was thinking more low-leveled. About those 5V making misunderstanding between the TSOP demodulator and the RX pin.

Ok Here they are:

Arduino reciever:

#include <NewSoftSerial.h>


/* Serial Test
    =============

    This little sketch is gonna spit everything comming from the
    software serial pins (2,3) to the legacy Serial pins (0,1)
    in order to be read from the USB    
    
    Tested, no luck by now.

  */


int ledStatus = LOW;

NewSoftSerial mySerial(2, 3);

void setup() {
   Serial.begin(9600);
   mySerial.begin(2400);
   pinMode(13, OUTPUT);
   pinMode(2, INPUT);
}

void loop() {
    if (mySerial.available()){
      Serial.print(mySerial.read(), BYTE);
      ledStatus=!ledStatus;
      digitalWrite(13,ledStatus);
    }
}

Arduino Sender:

#include <NewSoftSerial.h>

NewSoftSerial inv_serialEmitter(2,3,true);

void setup(){
  
  inv_serialEmitter.begin(2400);
  
}

void loop(){
  
  inv_serialEmitter.println("ARDUINO");
  delay(500);
  
}

OTOH, we don’t know if the problem with garbage characters are a mismatch in baud rate, either. Still not clear what is sending the IR beam. How do you know IT is working properly? Like how do you know it isn’t inverting all the bits or something?

Yes, I indeed inverted all the bits because (as far as I know, I really feel a little lost in this) the TSOP demodulator holds 5V between the output and the GND while it is no active or gathering zeroes (no beam). Then it drops the Vout to GND when beamed (gathering ones).

As that seemed inverted TTL logic to me, I used the invert function from NewSoftwareSerial

I provided a cuple of datasheets in my previous post.

Thanks!

Where is the output (Serial.print()) of the receiver going? Is the baud rate on that set to 9600?

Why are you using the BYTE optional argument when printing on the receiver when you are sending ASCII characters?

The Serial (legacy) output of the reciever is going throug the FTDI to my USB console. It is set to 9600baud because I like the number, no special reason. Of course I have the same baudrate on my Arduino's IDE Terminal.

I use the BYTE argument just to ensure that I get the RAW data, without castings or manipulations. (I don't know how does the wiring env deal with them by default).

Thanks.

I use the BYTE argument just to ensure that I get the RAW data, without castings or manipulations.

Personally, I think it's much better to understand how the data is being sent and how it is being received. In all cases, the data is the data.

By using the BYTE argument, you are telling the serial class to send the data in a specific, potentially incorrect, way.

I'd run a test removing the BYTE argument, and post the output that you receive.

Personally, I think it’s much better to understand how the data is being sent and how it is being received. In all cases, the data is the data.

By using the byte argument I am just not casting the info I am sending. That’s what appears in the reference guide. If I remove it, it turns everything into integer mode, so my beloved character ‘ÿ’ turns into a 255, which is a 2, and a couple of 5, which was not what I wanted.

I repeated the experiment with Serial.write() which just writes raw data, and got the same result: my precious garbage…

The character I always recieve is ÿ which comes to mean 11111111 in TTL or 255 in DEC.
I still don’t know if this is a framming error, or a Logic-voltage-level error.

OK this is MY fault... I was so excited I misswatch the basics...

1st: My LASER diode is not enough powerfull to excite the demodulator, nor the phototransistor... (by adding 5K resitor I only got 2,3V at the output... ) Dunno what else to do. Thanks anyway!

1st: My LASER diode is not enough powerfull to excite the demodulator, nor the phototransistor... (by adding 5K resitor I only got 2,3V at the output... ) Dunno what else to do. Thanks anyway!

Well, a red visible laser probably will not be detected by an IR device. Two different wave lengths involved. You might carefully file off the visible light filter on the IR demodulator and then get some sensitivity to the laser frequency. To use the laser beam you will probably need a photo transistor that is sensitive to the visible light spectrum. I need one myself for a visible laser experiment.

@zoomkat I was hoping my laser would had a deviation to the infra-red wavelength, my red laser pointer indeed has it. So does my GREEN laser... But it seems I would need more than 0.8W to get better results.

The main point of this would be getting a more sensitive phototransistor, it is no use on getting more powered lasers, they are expensive and harmfull...

I was hoping my laser would had a deviation to the infra-red wavelength, my red laser pointer indeed has it. So does my GREEN laser... But it seems I would need more than 0.8W to get better results.

Well, its been a long time, but as well as I remember one of the laser's claim to fame is that produced a coherent beam at a single wavelength. If you are getting deviation into the IR range, it is probably not by design. You can buy some inexpensive kits that might do what you want to do with the laser beam.

I'm sorry. I'm a little lost in electronics... and the thread subject was turned into my personal project, sorry.

Anyway. How can I pull the "5V" to "0V" that the INPUT/HIGH-IMPEDANCE pins seems to have?

Should I drain current from then, connected to the GND through a resistor, maybe?

(...yes... the pull-up resistors were mentioned before, but I am no sure in how to deal with them...)

Thanks in advance...

Okey, I think I understand the logic in the pull-up resistors and so why I am doing this right...

Well, now you're gonna think I am an absolute dumbass when I'll tell you that I was connecting the phototransistor wrong-sided... WOAH!

Now I really got a 5V->0V fall just with my 0.8mw red laser pointer!

(I was so deeply focused in the voltages that I didn''t realised in which direction was the current flowing... I'm glad I didn't burn the transistor, YAY!)

Thanks a lot, I'm gonna test this and will report how much baudrate does it support.