Pullup voltages with Teensy and Arduino on I2C circuit

Status
Not open for further replies.

tenorjazz

Active member
I have been developing some I2C proof of concept code, using the wire library, for a new project using two Arduino UNO clones (I don't worry about burning them up if I wire something wrong). Now that have the logic worked out, I want move everything to a TeensyLC for the MASTER and an Arduino MEGA for the SLAVE.

Here are a couple of questions:

1. When attaching the Arduino Mega to the TeensyLC I assume that you use 3.3v from the TeensyLC to pullup the Data and Clock pin for the I2C and all will be well, is that correct?
2. I will be attaching another I2C module to this circuit. This one is already built and tested and already has pullup resistors for the Data and Clock. If I add the pullup resistors for the Arduino/Teensy connection, should I remove the resistors from this second module?

I didn't think I needed to add code or schematics for this question, but let me know and I will put something together (I only have proof of concept code and hand drawn schematics at this time).
 
Note, you will likely need voltage level shifters assuming the Mega is running at 5v. The LC and 3.6 can be damaged if 5v is sent to any of its pins. While the 3.2 and 3.5 are tolerant of 5v digital inputs, I believe you would still need a voltage level shifter to go between 3.3 and 5 volts.

Back when I was still doing 5v i2c, I would tend to use this level shifter:

According to the link, the shifter has 10K pull-up resistors, so in theory you don't need additional pull-up resistors.

If you attach a device that already has pull-up resistors to its i2c bus, you don't need to add additional pull-up resistors.
 
Teensy LC can be damaged if you drive more than 3.3V onto any of its signal pins.

The level shifter is the safest approach.

You can also just use pullup resistors to 3.3V. Use 1K to 2.2K resistors if you try this, since the mega has very weak pullups to 5V. If you use 1K, the combination should give you only slightly over 3.3V. If you're feeling cautious, check the voltage on each signal with a multimeter before you connect to Teensy LC. But do understand if those 1K resistors become disconnected by accident, the weak pullups inside Mega will pull the SDA and SCL signals up to 5V, possibly damaging Teensy LC. Using the level shifter is safer...
 
Hi,

Does the slave send any data back to master? I have a project in which I have a 3.3V ESP8266 as master sending time and date info to a homebrew 5V Uno that then controls a display. It has worked reliably for many days of continuous operation without level shifting or pullups. The wires have to be short--3.3V is just within the level the Arduino needs to register a high signal.

Caveat: this is a cheapo AliExpr*ss ESP module, so I haven't felt I was risking much. YMMV.

Best,
Michael
 
So what I am hearing is that the Mega or any I2C compatible Aruduino has built in pull up resistors that are always attached, is that correct?

Sounds like a logic level shifter will do the trick, don't want to harm my Teensy. Just for grins I thought I would check out how hard it was to make a logic level shifter figuring that if I had the parts I could keep on working on my project without having to wait to get a pre-made one shipped to me.

This is what I found:

It looks pretty straight forward, just a couple of transistors and resistors, so thought I would give it a try.

3.3 to 5 Volt Shifter
logiclevel3to5.jpg

5 to 3.3 Volt Shifter
logiclevel5to3.jpg
 
By the way, it is a two-way conversation between the Slave and Master. When I get a little further along I will post the circuits and code.
 
Status
Not open for further replies.
Back
Top