Hello Element14 community. Recently, one of my questions which I asked on ST Industrial Pressure Sensors for Air and Liquid Monitoring Applications Webinar was selected as one of five best questions and about one month ago I received reward for it. As a reward I received Evaluation board containing pressure sensor ILPS22QS from STMicroelectronics. Board is named STEVAL-MKI228KA . Today I will show my first steps with this evaluation board. I consider this blog post as mini review of the board. For this reason, I assigned it to the RoadTest section.
Unboxing
Board come in paper box. As far I received all previous evaluation boards from ST packed in blister but now it come in paper box. Box looks strong but box come significantly deformed. It come from Farnell store and because it was only item on invoice, they sent it in envelope and not a proper package. But contents remained safe.
At the back side of cover is letter and in main part there are two PCBs. One of them is evaluation board itself and second part is extension board for evaluating ST’s unique QVAR feature of the MEMS pressure sensor.
First connection
For a first time I connected sensor on breadboard and used it with 8-pin STM32G031 MCU on Discovery board which I recently received as part of my recent Project14 competition reward.
Library
In the meantime, when I was waiting for the sensor, I downloaded library. Library is available at Github. But downloading and integrating this library was no needed because ST provide software pack allowing easy integration of the library when using STM32 MCU. I originally thought that STM32 Software Package contains exactly the same library as it is on Github but opposite is true. STM32 Cube IDE contains newer version of the library which contains some (mostly minor) bug fixes. For some reason ST did not update library on Github. Software pack come with GUI configurator. Configurator allows selecting bus used for communicating with sensor. Sensor supports I2C and SPI. Selection is done using CS signal of SPI. When it is high, then I2C is active. Additional bus configurations are possible using registers. You have to manually pull-up I2C signals.
For integrating software pack click Software Packs and Select Components.
Then find MEMS1 pack and click install. After installing expand it, find ILPS22QS in PressTempQvar section and select I2C or SPI bus.
I used I2C for my first experiments.
I originally misunderstood concept of this software pack and I did not find any port for STM32, instead I manually implemented communication function and provide them to the driver. I was confused because after adding software pack it stopped generating code for initializing I2C driver. Later I found generated functions containing initialization and used them. It is not very easy to understand this content and I did not find documentation regarding it. Similarly most documentation for the software packs in general omit ILPS22QS sensor. It is most probably too new and it is not included in documentation and examples yet.
Software stack has two layers. The lower layer library is similar to library from Github and upper layer is wrapper which is most probably used for assuring SDK compatibility with other sensors drivers as part of software pack.
First program
My first program was simple program for reading data from sensor and showing them on I2C display. I used higher layer library in this project because I thought it is preferred way of using sensor.
Program simply initializes sensor and reads pressure and temperature from it. Outputs are shown on display:
Sensor works well and returns realistic values. I tried to test it in 3 floors. In cellar I measured 975.2 hPa, at groud level I measured 974.9 hPa and in first floor I measured 974.6. It is about 0.3 hPa per floor and according to some online calculator it is equivalent of 2.3 meters of altitude which sounds realistic.
Qvar
For a next experiment I was interested in Qvar Electrostatic sensor feature which was also mentioned on webinar. Qvar can be used for various task including for example detecting water leak according to ST resources. As part of evaluation kit I received board containing electrodes designed for detecting touch gestures. I originally wanted to extend my first project by printing the value related to Qvar, but I found that higher level library which I used in first project do not support working with Qvar. So, instead I created new project and used lower-level library. Qvar is measured instead of pressure. Measurements are exclusive. You can read pressure or Qvar. Sensor can’t read both at the same time or it is not supported by library provided by ST. In datasheet inside registers description I found bit mentioning interleaved pressure/Qvar mode, but this bit is not supported in library and related application note also do not mention this option. Qvar output is internally read from the same register from which measured pressure is read. Operation of Qvar measure is hidden in bunch of mystery. While it has two pins (QVAR1 and QVAR2) it produces only one value. Maybe it is differential measurement or something like this. According to application note it is measured voltage and after dividing by magic constant 438000 we get voltage in mV unit. I implemented this and shown values (after converting to mV) on my display.
As you can see it is possible to identify pressing left or right button. As I mentioned above, I do not exactly understand what the value means. In my case I received different values for each button but aways the same for the same button. I tried touch it several days after (when I was most probably charged by static electricity differently) and I received exactly the same values from both buttons. Transitions are very sharp. It is not as a seamless as it was for example when I was RoadTesting Cypress PSoC CapSense. You can read state of “each” button with software thresholding but you can’t efficiently detect finger location in between. In case of PSoC it is possible because PSoC can utilize large range of ADC. In case of Qvar it returns values per button or noise. Nothing in between (or I was unable to reach any state in between). Note that this comparison is slightly misleading because Qvar technology works differently than capacitive sensing in case of PSoC. In case of Qvar and you need to directly touch the electrode. In case of standard capacitive sensing (like capacitive touch of PSoC) it works when you press sensor too near but in fact you do not need to touch PCB directly. I tried adding thin plastic cover. In case of capacitive detection, it is not problem and detection work over plastic cover well, but electrostatic sensor does not work over any plastic at all.
I accept this result because I do not consider touch button as main feature of pressure sensor. It is nice goodie. It is definitely usable for sensing two buttons and can be detect for presses or basic swipe gestures, but it is not as accurate as capacitive sensitive and do not provide so detailed output. For basic detection it is of course sufficient and in it is much easier to implement.
Conclusion
I would like to thank Element14 for organising webinar and sending me this nice evaluation kit. I would also like to thank STMicroelectronics for sponsoring both webinar and reward. ILPS22QS is nice sensor and evaluation board allows evaluating it very well. I am also happy that I was able to test Qvar feature which is available in some ST mems sensors and was mentioned on webinar. Sensor is easy to use and provided libraries are good quality. Integration to STM32 environment is good but hard to understand at the first look. It is possible to use Qvar for touch sensing, but it does not provide output as detailed as competitive solutions do.