BMS Readout Redesign 2

The Arduino Nano ESP32 that I reviewed in my previous blog below (link) seemed on paper to be what I needed to solve the memory problem of my BMS Reader program.  After I redesigned the BMS Reader PCA to use the ESP32 with a logic-level shifter, I found the ESP32 processor is just too different from Arduino products. Many of the libraries for the components in the BMS Reader were different and did not work the same. Although the SPI communication with the SD card reader worked, the SPI communication with the MCP2515 CANBUS integrated circuit did not and that is the primary function of the BMS Reader. After doing some more research I found Arduino makes several other Nano size processor boards.

The Nano 33 IOT with the Arm® Cortex®-M0 32-bit SAMD21 CPU, operating at 48MHz.  32KB SRAM and 256KB flash memory. The WiFi and Bluetooth® connectivity is performed with a module from u-blox, the NINA-W102, which is the same chip used on the ESP32. 

The Nano 33 BLE with the 32-bit Arm® Cortex®-M4 nRF52840 CPU, operating at 64 MHz, 256KB SRAM, 1 MB flash. The Bluetooth® connectivity are performed with u-blox® NINA-B306. The module does not have WiFi capability.

The Nano RP2040. This board has a dual-core ARM® Cortex® M0 Raspberry Pi® RP2040 CPU, operating at 133MHz. It has 264KB of SRAM and the 16MB of flash memory is off-chip to give extra storage. Also uses the u-blox NINA-W102 for WiFi connectivity.

You can see the processor speed and memory increases with each of these versions.  So does the cost of the module.  The Nano 33 IOT is the the lowest cost and the and flash memory is 5 times more and the SRAM is also more than 5 times that of the Nano Every so it should work for replacing the Nano Every.  The Nano ESP32 was even lower cost than the Nano 33 IOT.  That is because the ESP32 chip is used in many WiFi applications so the price is leveraged against that large volume.  Not surprising all these modules come with the ability to connect to the internet since that is where everything is going now.

All of these board processors run at 3.3V so same problem as the ESP32 communicating with the BMS Reader components.  However, the new BMS Reader PCA board that I designed with the an 8-channel logic-level shifter surface-mount integrated circuit (link) works with any of these boards.  Since all these Nano boards have exactly the same pinouts they are interchangeable. The code might be different for some libraries.  The libraries for the Serial, I2C, SPI and CANBUS that used on the Nano Every don't necessarily work for all these boards, since they all have different microprocessors. I found with the ESP32 the compile time was significantly longer than for the Nano Every.  That is because the original code for the Atmel processor has to be converted to code for the Xtensa processor and that will also be the case for the Nano 33 BLE and the Nano RP2040.

Nano 33

The Nano 33 IOT is nearly identical pinout and connection as the Nano Every.  But there is no 5V source pin just like the ESP32. The Nano 33 IOT and ESP32 look similar because they really only differ in the main microprocessor. However, for my application that is really key.  The Atmel microprocessor is the same family as all original Arduino modules so all the the libraries created for interfacing the modules to other components will work.

 

Update:  I recently purchased a Nano 33 IOT and after some slight modification of the BMS Reader code I was able to compile and run the test program on the Nano 33 IOT.  The complied code only uses 19% of the processor memory so the loop test program that I created to simulate nine BMS modules runs without any issue!  The name of this board IOT is the acronym for Internet Of Things, which just means the board has the ability to connect to the internet.  Because it has the same u-blox WiFi chip as the ESP32 it has both Bluetooth and WiFi connectivity. I might learn how to program the WiFi so it could be possible to view the battery voltages remotely. 

Below is the new BMS Reader PCA, showing the 8-channel logic-level shifter IC from Texas Instruments (link).  The resistor pads not populated are there because I did not know if pull-up resistors were needed when I designed the PCA.  But I found that the Adafruit components, the Rotary Encoder and SD card reader do not have open-collector logic gates, so no pull-ups needed.  The resistors that are populated are for the SPI port of the Nano 33 IOT, which do require pull-ups. The I2C pins have internal pull-ups on the Nano 33 IOT, so no external pull-ups needed. The fantastic feature of the 8-channel logic-level IC is that it works with either open-collector logic gates or push-pull logic gates. Although, according to the data sheet on the logic-level shifter, the push-pull logic gate connections are much faster, like 100X.  That is not an issue for this design.

  IMG 4249

 

To see the latest in the BMS Reader redesigns click here