Electronic – ESP8266 3.3V and ADAFRUIT TRINKET 5V I2C communication

esp8266i2c

I try to learn I2C with this diagram as an exercise.
I want to read my ESP8266 IO events from my 5V adafruit trinket.

I2C MASTER ESP8266ex

Operating Voltage 2.5 V ~ 3.6 V
Operating Current Average value: 80 mA

I2C SLAVE TRINKET 5V

On-board 3.3V or 5.0V power regulator with 150mA output capability and ultra-low dropout. 
Up to 16V input, reverse-polarity protection, thermal and current-limit protection.

I read on i2c-bus.org voltage-level

Since I2C is an open drain concept the VCC level as such is not
critical for the operation as long as all components on the bus can
accept the voltage on the IO pins and are able to detect the logic
levels.

It's seems to be not the case here, the ESP8266 only accept 3.6V max and trinket use 5V, then I search a solution :
bi-directional-logic-level-converter-hookup-guide
With my Raspberry as 3.3V power source for LV and the Trinket 5V OUT pin as 5V powersource for HV.

This tutorial use the N-channel BSS138 but i have not this MOSTFET only the N-channel 5ln01sp

This my schematic for the moment :
enter image description here

Can I use the 5ln01sp MOSFET instance of the BSS138 ? (I suppose that yes after having consulted the data sheet of each one but I am not sure because of my low level of knowledge.)

As a beginner, could my scheme work without drawbacks, did I forget something ?

Thank you for your help and your time.

Best Answer

Short Answer:
Looks definitely Okay


Long answer:

Here is the reference design or solution for the similar case from NXP:
https://www.nxp.com/docs/en/application-note/AN10441.pdf

enter image description here


One option was to look for the high voltage tolerant I2C Pins. Normally, in most of the MCUs you can find that information. The I2C pins will be tolerant to higher voltage than the VDD of the system. Example: STM32F405 MCU:

enter image description here In your case, I could not find the related information in the datasheet.


Looking into the datasheet of the part 5LN01SP:

enter image description here

  • The maximum gate threshold voltage is 1.3 V (we have a good buffer of 3.3 V - 1.3 V = 2V)

  • Forward voltage drop of the body diode is 0.85 V typical (1.2 V maximum), still we have guaranteed buffer 2.1 V (3.3 V - 1.2 V).

  • The series resistance hardly matters if this is the only device on the I2C bus.

  • at 100 Hz or even a few 10s of KHz of clock frequency, I do not expect any problems as such.