4907 views|11 replies

931

Posts

3

Resources
The OP
 

X-NUCLEO-IKS01A3 sensor test based on STM32F401RE development board - STTS751 temperature sensor test [Copy link]

 
 

After receiving the X-NUCLEO-IKS01A3 kit, I have been searching and downloading materials, reading relevant manuals and analyzing codes. I used the STM32F401RE development board and tested it under the Keil V5.28 platform. After several days of repeated tests, the STTS751 temperature sensor finally passed the test. In order to make the test more intuitive, I also added LCD5110 as a display. The following is a detailed description of the test process.

1. Hardware Connection

Before starting the test, the first thing to consider is how to connect the wires. At first, I followed my habit and looked up the wiring definitions on the sensor board in the downloaded materials so that I could connect it to the development board with Dupont wires. Later, I learned that the pins of both boards followed the Arduino UNO R3 specification, so I just had to plug them in directly. No wonder there is a notch on the sensor board, which is just for operating the buttons on the development board and observing the LED lights. When I first got the sensor board, I wondered why it was made into such an irregular shape.

After plugging in the sensor board, the notch is facing the button and LED light on the development board:

2. Software and Development Platform

After the hardware connection is solved, the next step is the software and development platform. After downloading, decompressing and checking multiple software packages, I found that the STM32CubeExpansion_MEMS_V6.20 software package is the latest version.

In the projects subfolder of this software package, there are four types of STM32 development board materials, including the STM32F401RE-Nucleo development board. This is undoubtedly good news for a beginner like me, and it can help me avoid many detours.

After clicking in, there are two subfolders: Applictions and Examples. My English is poor, so I took screenshots of these two folders and marked them in Chinese for easy use.

I saw from the " ST_Open_MEMS Tutorial" that I first had to accept the software license agreement online and obtain the development board key before I could unlock it (as shown in the figure below). I looked everywhere for the interface to accept the license online. I finally found one, but it didn't work after I clicked it. Then I saw that I needed a " Sensor Fusion GUI " software to assist with debugging, but I couldn't download it after searching for a long time. Finally, I decided to add an LCD5110 display to display the test process.

3. Add LCD5110 display

This addition was not a difficult task for me. After selecting the pins to drive the LCD , I connected the LCD with Dupont wires , and then transplanted the corresponding code.

I put all the LCD driver, display files and font files in the mydrive folder. I just need to copy this folder, set the search path, and write the following code in the main program:

LCD_init(); // Initialize LCD5110

display_main();

The following picture shows the LCD display that is ready to be added :

The following are test photos:

The following image shows what is displayed on the initial screen:

4. STTS751 temperature sensor test

For the first use, I naturally opened the "Example" folder first, selected the " IKS01A3 " subfolder, and then opened the STTS751 engineering example. In order to display the current temperature on the LCD screen, in the main loop of the main() function, I followed the clues to find the MX_MEMS_Process() function, and then found the Send_Temperature() function to get the variable name of the temperature. I figured out that the system uses the out_value.sign variable to indicate the positive and negative of the temperature value ( 0 is a positive number, and greater than 0 is a negative number), then the out_value.int variable represents the integer part of the temperature value, and the out_value.dec variable represents the decimal part. At this point, it is easy to display on the LCD screen. The following is the display code:

if (out_value.sign > 0)

LCD_write_ASCII(0,5,(uint8_t *)"TEMP:-");

else

LCD_write_ASCII(0,5,(uint8_t *)"TEMP:+");

LCD_write_ASCII(54,5,(uint8_t *)".");

LCD_write_value(36,5,3,0,0,(int)out_value.out_int);

LCD_write_value(59,5,2,0,1,(int)out_value.out_dec);

This is the testing process:


The following figure is the real-time temperature displayed dynamically:

The following figure is the comparison between the screen display and the serial communication data:

This post is from MEMS sensors

Latest reply

But the expansion board I use is not exactly the same as this one, and it has no file  Details Published on 2024-6-18 22:43
 
 

931

Posts

3

Resources
2
 

Here is a video of the test:


This post is from MEMS sensors
 
 
 

931

Posts

3

Resources
3
 

LCD5110 driver code:

my_drive.rar (8.88 KB, downloads: 11)

Test code for STTS751:

STTS751_TemperatureLimit.rar (7.43 MB, downloads: 21)

This post is from MEMS sensors
 
 
 

282

Posts

2

Resources
4
 

Hello, can you send me the STM32CubeExpansion_MEMS_V6.20 package? I can't download it from the official website.

This post is from MEMS sensors
 
 
 

931

Posts

3

Resources
5
 

The original package has been deleted by me. After compression, it is 181M and cannot be uploaded to the forum. You can send it to the email address to see if it can be sent.

This post is from MEMS sensors

Comments

Sure, thank you. My email address is: 1398660197@qq.com. Thank you.  Details Published on 2019-7-27 12:14
 
 
 

282

Posts

2

Resources
6
 
hujj posted on 2019-7-27 09:50 The original package has been deleted by me. After compression, it is 181M. It cannot be uploaded to the forum. You can send it to the mailbox to see if it can be sent.

Sure, thank you. My email address is: 1398660197@qq.com. Thank you.

This post is from MEMS sensors

Comments

Emails have been sent, please check them carefully. Large emails have time limits and will be automatically deleted after expiration. You can also download the ones uploaded by the moderator at this link: https://bbs.eeworld.com.cn/forum.php?mod=viewthread&tid=1084046&page=1#pid2889321   Details Published on 2019-7-27 12:31
 
 
 

931

Posts

3

Resources
7
 
hehung posted on 2019-7-27 12:14 Sure, thank you, my email address is: 1398660197@qq.com, thank you

Please check the emails that have been sent. Extra large emails have time limits and will be automatically deleted after the expiration date.

You can also download the version uploaded by the moderator at this link: https://bbs.eeworld.com.cn/forum.php?mod=viewthread&tid=1084046&page=1#pid2889321

This post is from MEMS sensors

Comments

Thanks bro, I have received it.  Details Published on 2019-7-27 12:33
 
 
 

282

Posts

2

Resources
8
 
hujj posted on 2019-7-27 12:31 Email has been sent, please check it. Large emails have time limits and will be automatically deleted after expiration. You can also download the ones uploaded by the moderator at this link: http://b ...

Thanks bro, I have received it.

This post is from MEMS sensors
 
 
 

2

Posts

0

Resources
9
 

How to connect the line specifically, and how to configure it


This post is from MEMS sensors

Comments

1. As mentioned above, just plug it into the development board. 2. The development board has a matching damo, so you just need to display the value on the screen.  Details Published on 2024-6-17 10:04
 
 
 

931

Posts

3

Resources
10
 
The miserable person posted on 2024-6-16 14:52 How to connect specifically, and how to configure it

1. As mentioned above, just plug it directly into the development board.

2. The development board has a matching damo, and you only need to display the value on the screen.

This post is from MEMS sensors
 
 
 

2

Posts

0

Resources
11
 
hujj posted on 2024-6-17 10:04 1. As mentioned above, just plug it into the development board. 2. The development board has a matching damo, so you just need to display the value on the screen.

But the expansion board I use is not exactly the same as this one, and it has no file



This post is from MEMS sensors
 
 
 

931

Posts

3

Resources
12
 

The sensor on my board communicates via I2C. I use the manufacturer's damo, but I haven't delved into the specific communication protocol.

This post is from MEMS sensors
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list