A very easy logic level converter to translate I2C signals from, say, a 5 V Arduino to a 3.3 V slave device.
I2C logic level converter
The Arduino and Basic Stamp are 5 V devices, but many modern devices — sensors, displays, flash cards and the like — are 3.3 V only and require level conversion to protect them from higher voltage signals.
Level shifting for the I2C communication protocol uses a FET design following the NXP application note. This board should work with high voltages up to 10 V and low voltages down to 1.8 V.
For ease of prototyping I used 2N7000 N-channel MOSFETs on strip board, and tried 2.2 K pull up resistors in the hope that they would allow slightly transfer rates than 10 K resistors used in the equivalent Adafruit PCB.
An online stripboard editor was used to create the schematic and layout, which are documented in a github repository.
The design fits on 6 strips x 8 holes. I used a slightly wider board to make room for colour coded loops of wire next to the right angle pin headers. The SDA and SCL lines are marked brown and grey. The low voltage can be supplied on either side of the board (blue line).
The grounds on the two devices also need to be joined. This can be accomplished on the board with a simple change to the design.
Here, the 5 V SCL and SDA pins on an Arduino Uno are connected to the 3.3 V I2C lines from a hacked voltmeter LED display. The converter works. :)
- 2x 2N7000
- 4x 2.2 KΩ resistor
- 0.1" pitch right angle header
- small piece of stripboard
- hook up wire
- soldering iron
- NXP application note
- Datasheet for 2N7000 N-channel MOSFET
- Online stripboard editor
- Github repository