Data Acquisition System Setup with Raspberry Pi

Background

The data acquisition system is primarily responsible for real-time data collection and visualization of the sensors on the racing car during its operation.To achieve real-time data transmission, a microcontroller is often used as a medium for data processing and transmission,which requires the microcontroller to operate like a small computer.For general microcontrollers, due to limited memory and processing power, it is impossible to directly install an operating system. However, for microcontrollers with higher processing capabilities,such as the STM32Z series and Raspberry Pi, it is possible to directly install an operating system.Common Linux operating systems for microcontrollers include Ubuntu, μClinux, etc. Here, we take Raspberry Pi as an example.

Preparation Work

To configure the Raspberry Pi,you first need to install the operating system.The Raspberry Pi functions like a small computer, and the operating system installed on it is equivalent to Win11 or Mac on our computers. Download the operating system image file that is compatible with the hardware from the internet.

Data Acquisition System Setup with Raspberry Pi

Use Win32DiskImager to burn the downloaded image file onto an empty SD card. After burning, insert the SD card into the Raspberry Pi and power it on for initial configuration.

Data Acquisition System Setup with Raspberry Pi

When using the Raspberry Pi, the operating system we install is Raspbian OS, which is the official operating system for Raspberry Pi,this operating system is similar to Cent OS and is also derived from Linux. When configuring the Raspberry Pi,you also need to prepare a monitor and keyboard/mouseto modify configurations directly on the Raspberry Pi, or you can use VNCviewer to view the Raspberry Pi’s interface.

Basic Configuration

Data Acquisition System Setup with Raspberry Pi

After powering on, first enable SSH and VNC in the settings. Use Putty or Windows’ built-in cmd to remotely connect and check if SSH is enabled, and use VNCviewer to check if VNC is enabled.If both are enabled, you can start operating the Raspberry Pi through remote connection.

Then open the terminal on the Raspberry Pi, find two files, and copy them for backup.

Data Acquisition System Setup with Raspberry Pi

After saving the backup, modify the contents of these two files to make them compatible with the operating system version.

Data Acquisition System Setup with Raspberry Pi

The prefix ‘sudo’ indicates that the command is executed with temporary administrator privileges.

Then update and upgrade to complete the basic configuration of the Raspberry Pi.

Serial Port Transmission

In the use of Raspberry Pi, serial port transmission is crucial,first, enable the Raspberry Pi’s serial (serial) function in the settings. Then adjust the mapping relationship of the serial port to make serial0 correspond to ttyAMA0 for normal use.

When adjusting the mapping relationship of the serial port, it is necessary to back up and modify the system files.

Data Acquisition System Setup with Raspberry Pi

And add the following characters to the last line of that file.

Data Acquisition System Setup with Raspberry Pi

Disabling Serial Port

To prevent the serial port from continuously receiving login requests from Raspberry Pi, it is also necessary to disable the serial console.

Data Acquisition System Setup with Raspberry Pi

In Linux operating systems, a commonly used serial debugging tool is minicom. Through minicom, you can check whether the serial port configuration is normal and feasible in the Linux system.

Wecan also install MySQL or MariaDB on the Raspberry Pi for data storage,in conjunction with the database on the server to achieve dual databases for onboard and cloud, enhancing the system’s data storage and retrieval performance.

Data Acquisition System Setup with Raspberry Pi

Images & Text | GW-HRT

Layout | Chen Yujing

Editor | Zhang Mingyue

Verification | Fan Fangyuan

Special Thanks To

Data Acquisition System Setup with Raspberry Pi

Leave a Comment