Matlab and Raspberry Pi 4 with Analog Voltage Inputs
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am looking for a way to measure analog voltage signals with Matlab/Simulink and Raspberry Pi 4 for further processing in Matlab/Simulink. Here are the following questions:
- Cany anyone recommend a solution for acquiring data (analog voltage signals) with Pi4 directly in Matlab/Simulink. What is the recommondation for the analog-digital-converter (ADC) for Pi4?
- The Digilent MCC 128 and 172 are good ADCs for Pi4. But it's not possible to directly acquire the data in Matlab only in the Pi OS by C or Python Code. Does anayone has a solution fpr MCC 128 / 172 to acquire data directly in Matlab?
- Are the other general recommendations for analog signal acquisition with Pi4 in Matlab/Simulink? Any general DAQ solution?
Thanks
Risposte (1)
recent works
il 30 Ago 2023
There are a few different ways to acquire analog voltage signals with MATLAB/Simulink and Raspberry Pi 4. One way is to use a dedicated ADC board, such as the Digilent MCC 128 or 172. These boards have a built-in SPI interface that can be used to communicate with the Raspberry Pi. MATLAB/Simulink has a library of functions that can be used to acquire data from these boards.
Another way to acquire analog voltage signals is to use the Raspberry Pi's built-in ADC. The Raspberry Pi has a 12-bit ADC that can be used to measure analog voltages in the range of 0 to 3.3V. However, the Raspberry Pi's ADC is not as accurate or as versatile as a dedicated ADC board.
If you are using a dedicated ADC board, you can acquire data directly in MATLAB/Simulink using the following steps:
- Connect the ADC board to the Raspberry Pi.
- Install the necessary drivers for the ADC board.
- Create a MATLAB/Simulink model that includes the ADC block.
- Configure the ADC block with the settings for the ADC board.
- Run the MATLAB/Simulink model to acquire data from the ADC board.
If you are using the Raspberry Pi's built-in ADC, you can acquire data in MATLAB/Simulink using the following steps:
- Install the necessary drivers for the Raspberry Pi's ADC.
- Create a MATLAB/Simulink model that includes the Raspberry Pi ADC block.
- Configure the Raspberry Pi ADC block with the settings for the Raspberry Pi's ADC.
- Run the MATLAB/Simulink model to acquire data from the Raspberry Pi's ADC.
3 Commenti
recent works
il 30 Ago 2023
I am not familiar with any way to use these boards directly in MATLAB/Simulink.
The Digilent support team is correct in saying that these boards require Pi OS. This is because the MCC 128 and 172 are SPI devices, and the Raspberry Pi's SPI interface is not available in the Linux kernel that is used by MATLAB/Simulink.
If you are still interested in using the MCC 128 or 172, you could use the following steps:
- Install the Pi OS on the Raspberry Pi.
- Install the necessary drivers for the MCC 128 or 172.
- Write a Python script to communicate with the MCC 128 or 172.
- Use MATLAB/Simulink to call the Python script.
This is a bit of a roundabout way to do things, but it is the only way to use the MCC 128 or 172 directly in MATLAB/Simulink.
As for other ADC boards that you can use directly in MATLAB/Simulink, I am not sure. I would recommend searching for ADC boards that are compatible with the Raspberry Pi's SPI interface
Vedere anche
Categorie
Scopri di più su MATLAB Support Package for Raspberry Pi Hardware in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!