Teensy 4.1 with Sunfounder LCD

Status
Not open for further replies.
I have a Teensy 4.1 that I wish to use it with a Sunfounder I2C LCD2004 4 x 20 LCD display. It is the one with 4 wire input which requires only
2 I/O lines. I see clearly how to hook it up, have an identical unit working with an Arduino Mega. My only problem is that the LCD requires 5V and the Teensy 4.1 runs on 3.3 and I am told Teensy I/O is not 5 volt tolerant. I have powered the display up separately and found there is 5V on the SDA and SCL pins, which should connect to A4 (18) and A5 (19) on the Teensy 4.1, but I am hesitant to do this because of the warnings about voltage difference. Is it OK to hook the SDA and SCL of the Teensy 4.1 to these inputs? I tried running the display on 3.3V but this does not seem to work. Thanks in advance for any help you can give.

Les Knoll
Steamrocks@yahoo.com
 
Two things.

There are various bi-directional level shifters out there made to convert 3.3v to 5v for I2C. The pololu one is the one I typically have used in the past:

Typically on a Teensy I2C bus, you need what is called pull-up resistors. Many devices provide pull-up resistors, but some don't. You only need one set of pull-up resistors on the bus. I've read that if you do voltage level shifting, you don't need pull-up resistors. The way to find out is to run the example Wire -> Scanner. If it hangs, you need pull-up resistors. To add pull-up resistors, you need 2 resistors, one in parallel between SDA and 3.3v to the device, and the other in parallel between SCL and 3.3v. Typically for 3.3v devices, you would need 2.2K resistors, and for 5v devices, 4.7K. You can use 4.7K resistors as well (using higher pull-up resistors can mean some high speed I2C options might not work).

Another option is to get a 3.3v device that supplies pull-up resistors.
 
Michael,

The pololu seems to be the totally simplest and most cost effective option. Many thanks for the suggestion. Pololu seems to be a good place.
I ordered additional things from as well besides the level shifter. I might STILL experiment with the touch screen that is available for Teensy. Could save a lot on switches and switch wiring as well. Prolly try both. The project is already working fine with Arduino MEGA, so there is no hurry.
 
Michael,

The pololu seems to be the totally simplest and most cost effective option. Many thanks for the suggestion. Pololu seems to be a good place.
I ordered additional things from as well besides the level shifter. I might STILL experiment with the touch screen that is available for Teensy. Could save a lot on switches and switch wiring as well. Prolly try both. The project is already working fine with Arduino MEGA, so there is no hurry.

Yes, pololu is a good place (IMHO). They specialize in robot parts. My usual purchases include:

They usually have a sale around US holidays if you are thinking about stocking up.

In terms of pull-up resistors, the 5 volt AVR processors (Arduino Uno, Mega, etc.) don't need pull-up resistors, as the internal resistors provided by the chip is strong enough. Most of the ARM chips do not have strong enough pull-up resistors and need external pull-ups of some kind. As I said, many devices now provide pull-up resistors, some don't. If memory serves, Adafruit switched to providing pull-up resistors when they switched to providing more M0/M4 ARM devices.
 
Since it is output only, you can use an HCT or AHCT logic chip to convert 3.3 into 5. Super cheap (74HCT125 is $0.37 from Mouser). The T stands for TTL and triggers high at around 2V. Won't run on 3.3V though so power it with 5V.
 
Status
Not open for further replies.
Back
Top