The idea behind this work was to test the capabilities of using a near-field communication (NFC) tag to store the information acquired through an analogue input of a microprocessor powered by an energy harvesting source.
The setup includes these components:
- Peltier cell
- Energy harvesting system
- Dynamic NFC/RFID tag IC
- Temperature sensor
Energy harvesting system
The capabilities of Peltier cells to harvest energy from differences of temperature between its two sides has already been studied in other posts starting with this link, so I will not develop this part of the work here.
The energy harvesting system used in this project is now based on the outstanding Linear Technologies (now part of Analog Devices) Ultralow Voltage Step-Up Converter and Power Manager LTC3108. This device can work with four selectable output voltages: 2.35 V, 3.3 V, 4. V or 5 V to power wireless transmitters or sensors and a low dropout voltage regulator output (VLDO) to power an external microprocessor. According to its datasheet it can start harvesting energy from voltages as low as 20 mV which is precisely indicated for applications that use thermo-electric generator (TEG) such as Peltier cells. The energy is stored in a bank of supercapacitors connected to two outputs of the LTC3108. Two 1 F supercapacitors in series are connected to VOUT and charged when VAUX has reached 2.5 V. Another two 1 F supercapacitors are connected to VSTORE supporting VOUT and preventing an unexpected drop of voltage due to a high power demand by the load. A picture of the setup for this integrated circuit (IC) is:
The total time to charge the capacitors up to 3.3 V was 1 h and 50 minutes with a difference of temperatures of 6 – 7 K in the Peltier cell. The measuring setup to find this important datum consisted on two resistors adhered with silicone to one of the sides of the cell to heat it; the other side was attached to an aluminium heat sink. The resistors were connected to a power source to regulate their temperature and the temperatures in both sides of the cell were measured with two LM35 temperature sensors. The output of these sensors were connected to two voltmeters as seen in the next figure:
This setup was used to test the charging times in a controlled environment, the actual use of the TEG and LTC3108 would be installed somewhere there can be a temperature gradient such as residual heating from industrial processes, electrical or thermal machines, body heat or sun radiation.
We also tested a direct charge of the harvester applying a fixed voltage of 400 mV at the input and the charging time was below 20 minutes. However, it is not expected that the TEG can maintain this voltage within a standard range of temperatures.
Once the capacitors of the energy harvested were charged, it was connected to an STM32L031 to test whether it was possible to run a program and for how long was the microprocessor (MCU) able to run it. The STM32LXXX series is a ultra-low power family of microprocessors by ST that is quite well suited for applications in which the power consumption is an issue. The STM32L031 was flashed with a simple blinky program to turn a LED on and off with STLINK as shown in this link. The LED was connected to a digital output of the MCU and the tests showed that the program was able to run for 9 minutes until the emitted light faded away completely. Probably the program continued to run but the harvester couldn’t drive enough current to light the LED. In any case, 9 minutes is, by far, much more than the time needed in the typical applications of embedded systems powered with harvested energy where the usual procedure is to wake up the MCU, acquire a signal, process it, store o send the data and put back to sleep. The results were, then, encouraging to proceed to the next step: the use of a NFC tag to save information and recover it with a mobile phone.
Once we had the program to read and write the NFC tag we realized that it was too large to be programed in an STML031 with only 32 KB. No matter how we tried to strip the program of unnecessary code, we weren’t able to flash the MCU. We had many other possibilities: STM32L432 which has its own libraries available in os.mbed.com and with a development board the NUCLEO-L432KC. The problem with this MCU is that the only available packaging is UFQFPN32, and we cannot solder it so we had to find an MCU with a more friendly packaging. The options were STM32L433 with an LQFP48 which also has a development board the NUCLEO-L433RC-P. Unfortunatelly, in the date of writing this post, the target is not still available in mbed so we had to use the STM32L432 target to develop the program to communicate the MCU and the NFC tag and to get data from an analogue input. We had some features missing as pointed out by Helmut but the application didn’t need them so far.
Pay special attention to the decoupling capacitors in all VDD and VBAT inputs. It was mandatory to place these capacitors at the VDD_MCU inputs, otherwise the MCU won’t work: I couldn’t even flash it.
Also, remember to connect the GND of the ST-Link port to ground even if you are taking the supply from the 3V3 and GND pins of the Discovery board. If it is left unconnected, the ST-Link Utility won’t be able to detect the MCU.
The pin definition to connect the NFC tag was:
const uint8_t XNucleoNFC01A1::M24SR_ADDR=0xAC;
const PinName XNucleoNFC01A1::DEFAULT_SDA_PIN=PB_7;
const PinName XNucleoNFC01A1::DEFAULT_SDL_PIN=PB_6;
const PinName XNucleoNFC01A1::DEFAULT_GPO_PIN=PB_5;
const PinName XNucleoNFC01A1::DEFAULT_RF_DISABLE_PIN=PB_4;
const PinName XNucleoNFC01A1::DEFAULT_LED1_PIN=PA_12;
const PinName XNucleoNFC01A1::DEFAULT_LED2_PIN=PA_11;
const PinName XNucleoNFC01A1::DEFAULT_LED3_PIN=PA_10;
We only had to put special care to use the I2C SDA and SDL pins that were the same in both the STM32L432 and STM32L433.
NFC tag IC
Since we were using MCUs from the STM32LXXX family we needed an NFC tag IC with libraries for them and the easiest option was to use an X-NUCLEO-NFC01A1 which is an NFC tag expansion board based on the M24SR integrated circuit for STM32 and STM32 Nucleo:
The library and some examples can be found here.
The communication with the MCU to access the NFC tag is done through I2C though it is also possible to read/write the tag externally with a 13.56 MHz RFID reader or an NFC phone.
Only two pins would be needed to connect the MCU, SDA and SCL as mentioned before. However, there are another two pins GPO and RF_DISABLE and access to three LEDS in the board for signaling purposes. We connected pins GPO and RF_DISABLE to the MCU because they were defined in the library in mbed. However, I strongly suspect that they are not strictly necessary so I’ll check if everything works correctly without them in the near future.
We used an LM35 connected to the PA_0 pin of the STM32L433 to sample the temperature every second and write it to the NFC tag. Then, a mobile phone would read the tag and recover the data. This sensor needs a 5 V power supply which is higher than the voltage given by the energy harvester so we used an external supply. The idea is to use in the future an BMP280 (you can find breakout boards below 1 € in ebay/aliexpress pages) which can work at 3.3 V but, for now, we only wanted to test whether the energy harvester was able to supply enough power to the MCU and NFC tag.
When all the setup was ready and the STM32L433 flashed with the code, we connected the energy harvester and started writing temperatures. Notice that we didn’t disconnected the NFC when we weren’t writing on it neither put the MCU to sleep when it didn’t acquire the temperature. Under these unfavorable circumstances, the energy stored in the supercapacitors was able to store four temperatures until it dropped well below 3.3 V to 2.4 V and no longer could drive the NFC tag. These results are very encouraging since with a correct power management we can acquire an analogue signal and write it to an NFC tag with an affordable difference of temperatures in the Peltier cell.
There are many things still to do:
- Clean the code
- Include the BMP280 temperature and pressure sensor
- Clean the code again
- Activate or deactivate the BMP280 and the NFC tag with a mosfet connected to the MCU
- Improve the code once more.
- Put the MCU to sleep and wake it up with an interruption request from the energy harvester.
- Test the overall setup