BMS Readout Redesign 3
I thought that the Texas Instruments logic-level shifter integrated circuit was going to solve the problem with the different voltage logic levels in the BMS Reader Redesign 2 (see blog below). Initially it did work, the RTC and SD card worked without any issue. Those two components are mounted on the PCA, so they are connected to the logic-level shifter via traces on the PCA. When I first did the bench test to test the Arduino Nano 33 IOT and the logic-level shifter on the new PCA, I used only one Rotary Encoder with the LCD and the PCA was on the bench. That all worked without issue and I able to run the loop test program, simulating nine BMS units, which it passed. Once I put everything in the enclosure that is when I started having problems with I2C communication. When I connected the LCD and the two Rotary Encoders, using the screw terminals I found the Encoders would not initialize. If I disconnected the LCD the Encoders would connect. The Encoders and LCD are on the I2C bus. After doing some more research on the Texas Instruments device I found that it is very sensitive to the capacitance loading of the data lines. The RTC is a I2C device, but as I said it is connected to the logic-level shifter via traces. PCA traces have much smaller capacitance compared to free hanging wires. The 7-Segment display data lines also go through the logic-level shifter and are connected to the screw terminal via wires, but Serial is a much slower communication standard and hence it is less sensitive to the connection capacitance. The problem is with I2C communication - it is high speed so it is sensitive to the capacitance of the connection. So the multiple wire connections (two Encoders and a LCD) caused the issue. The real problem stems from the logic-level shifter. It was not designed to connect to many I2C slave devices, unless they are all PCA mounted and are connected via traces that have low capacitance. The capacitance issue has long ago been identified as a problem with I2C communication. Because it was initially developed for communication between devices mounted on a PCA and connected via traces (i.e. low capacitance). But now it used to connect many external devices, via wires. Devices have been developed to solve this problem. They are called I2C line drivers and can be connected in a pattern like the schematic below, to connect many external I2C devices to one master source. This particular line driver, the PCA9617A is made by NPX Semiconductors. The data sheet can be found here, which is the source of the figure below. In the figure, all the lines on the Bus Master side would be PCA traces and on the Slave side will be the screw terminals with the wire connections. The output of the line driver can drive much higher capacitance. Each wired connection will have its own I2C line driver. These devices can also function as a logic-level shifter so it solves two problems. As shown in the figure, the driver IC also has an enable connection. This can be used to control communication by enabling only the driver for one component communication. But in my Reader design all the I2C components are queried sequentially in the code. So there is no issue with communication collisions, which can happen if multiple devices try to communicate at the same time. The issue now is that a new PCA has to be designed and built and tested.
Update: After some design considerations that I realized from working on the new schematic and PCA layout, I decided to eliminate the logic-level shifter IC. Both the RTC and the SD card will work at 3.3V so I am going to change the schematic to use those components at 3.3V and communicate with them directly from the Nano 33 IOT. The I2C line drivers will be used for the other components that are connected by wires through the screw terminals. For the Serial communication to the 7-segment display I will use the MOSFET method for logic-level shifting, like this product from Sparkfun. I can incorporate one of those MOSFET circuits in my design: a single N-MOSFET transistor with two resistors is all the is needed for one channel.
Update2: The I2C line drivers were tested on the bench and found to function perfectly. Even with connecting two rotary encoders and the LCD to one PCA9617A output!
A new PCB was designed and ordered, one that incorporates the I2C line drivers and N-MOSFET logic-level shifter circuit. The new PCB will take about a week to be fabricated and shipped.
To see the latest in the BMS Reader redesigns click here.