Level converter RX/TX issue

Hi All,

I have been having this issue for the past few days. I talking my first dive in to electronic’s since a few kits as a teenager. Hopefully I am missing some small here.

I have a TP-Link mr3040 (3.3v) with a serial connection to the arduino uno. Common ground, the 3.3v on the LV side RX to TX to the HV on the arduino side.

My problem is I can only recieve data (on pin’s 1 & 2) , I simply can not send any data on the pin’s no matter what baud rate I use! The sketch works 100% :shock: only if I attached the /dev/ttyUSBx device directly as aposed to using the 3.3v serial pins with the level converter.

void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
  Serial.print(1);
  pinMode(ledPin, OUTPUT);

}

void loop()
{
  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    inByte = Serial.read();
    digitalWrite(ledPin, HIGH);
    delay(10);
    Serial.print("Got: ");
    Serial.println(inByte);
    digitalWrite(ledPin, LOW);
  }
}

What could I be missing here?

Are you sure you cannot get anything on the TP-LINK rx end? Like physically. Probe it with an oscilloscope or drive the pin high and then read the output. Make sure you level converter has the correct connections to it. Could you post a schematic? Hand drawn works.

Just put a voltage divider between the HV and LV sides.

Arduino TX to 10Kohm resistor to 10Kohm resistor to ground.

Then…

3.3v RX side to the middle of the two 10Kohm resistors.

(All common ground)

(Yeah yeah yeah, before everyone complains, I know it will be 2.5v on the LV side) It works fine for me…

I did a search for the level converter and all I get is a wireless router…

Wait! Going from low voltage to high voltage doesn’t work like that. All of the current will drain through the 10k to ground. No voltage will be seen on the top side.Instead use a transistor, like the [Logic Level Converter.](http://www.sparkfun.com/products/8745)

pots:
I have a TP-Link mr3040 (3.3v) with a serial connection to the arduino uno. Common ground, the 3.3v on the LV side RX to TX to the HV on the arduino side.

Look again… He’s connecting 5vdc Arduino TX to a 3.3vdc RX. All you need is a voltage divider…

…I’m sorry I cannot read. Long day… I thought you were trying to hook up the TP-LINK RX to the middle of the two 10k’s with the arduino rx on one end and ground on the other. Wow now I feel stupid.

It’s alright,

I just figured he might have the level shifter hooked up wrong or it’s just not working…

Hi All,

I am using one of these Sparkfun logic level converters: http://www.sparkfun.com/products/8745 between the TP-Link and the Arduino, as I said a common ground and RX to TX on both sides. I will put a diagram together this evening.

Are you saying on the TX all I need is a voltage divider?

Here’s a quick diagram.

http://imageshack.us/photo/my-images/40/mr3040ard.jpg/

I have no voltage divider’s in the circut, and unfortunately no oscilloscope atm. I am looking into getting a small hobbyist one in the near future.

Yes that circuit looks indeed correct. All I have to say is make sure your pinouts are correct.

Yes that looks correct.

The level converter has (2x) voltage dividers on it so if you ever need a converter to go from HV to LV that’s all there is to it.

I still don’t really know what a TP-Link is, except that it’s a router. I’m not sure how you are tapping into a 3.3v serial line with that…

Supposedly the voltage divider on the level shifter uses two equal values (I’m not sure SF fixed this in current releases of the board). So if you put in 5vdc you will get 2.5vdc out of the shifter. For some circuits this is not enough to get up passed the logic ‘1’ threshold. (some will work, some won’t) Take a look at the first comment under the level converter page…

I ran the LV side through my multimeter and can confirm that the LV is 2.5v. I guess this explains why the exact same converter works on my Linksys WRT54GL and not on the less tolerant TP-LINK.

As I said I am fairly novice, what would be recommended to bump these voltages up closer to the 3.3v the router expects?

What is the VCC on the TP-LINK? Shouldn’t it be 3v3 so you could tie into that.

HV to R1 (10K) to R2 (20K) to GND

Tap the point between R1 and R2 for 2/3 the HV. Approx 3.3v

LV = HV * (R2 / (R1+ R2))

LV = 5 * (20) / (30)

LV = 5 * (2/3)

LV = 3.333333333

Why should we use more parts if we can get the regulated exact voltage off of the board? For sanitys sake.

Joeisi,

He’s converting a 5v data line to 3.3v. He’s not looking for a supply rail.

The level shifter is dropping his data line to 2.5v which might be where he’s having issues.

Ok now I am following what you are saying… That would mean a 10G ohm (Yes, 10,000,000,000 ohm resistor) in parallel to the current 10K RX-0 to GND resistor. A 5G resistor would also be very very close, but those run for about $5 on Digikey… Where at that point it is more worth it replacing the 10k on board with another 20k resistor.