Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

3 axial Analog accelerometer data transmitted wirelessly to Raspberry Pi 3B+ using LINX toolkit

Solved!
Go to solution

Hello, 

I will give info about my project so that you understand the topic. 

 

The project is drop testing for playgrounds that involves an accelerometer. The last is currently wired to a cDAQ9171, with the IEPE BNC extension NI 9234. The code is written with LabVIEW to aquire data and calculate some criteria based on the acceleration curve of the drop. 

My job is to make this machine wireless, using the same code utilized for calculation.

 

The European norm requires: 

  • ADC: -12-bit, minimum 20kHz Sampling, anti-alias filter with -30dB attenuation at half of the sampling rate. (So if the ADC is not simultaneous, we should have a 60kHz minimum ADC for 3 axes)
  • Accelerometer: +/-500G, minimal frequency response 1-1000Hz

I had the idea of using RaspberryPi with the sensor connected to an ADC, and read the values with LabVIEW connected with Linx to the RaspberryPi using the WIFI protocol.

 

1) Can I simply use any ADC that does the job and has SPI connection? for example this one or this one

If yes, what is the programming part that should I do or libraries to import in order to configure it, and read its value from LabVIEW 

 

2) Should I use an ADC that has libraries to the makerhub in order to read it? Any suggestion for and ADC that works with RaspberryPi and has libaries/support for LINX. (and sure meets the 12 bit and sampling criterion). Then, if the data is transmitted wirelessly (2-3 meters max), what are the cons? Will I lose some sampling or data rate? 

 

Sorry for being basic with my questions, I am new to the LINX firmware, and to analog to digital signal processing

 

Thanks for any suggestion/help. 

 

 

 

0 Kudos
Message 1 of 4
(2,148 Views)

I can provide any assistance with selecting an ADC but I got some questions about your overall design which may help overall.

 

So based on your explanation here is what I understand:

 

Current System: It sounds like you have an accelerometer which is connected by wires to your cDAQ 9171 chassis with a NI 9234 card.  In this situation you only drop the accelerometer and the NI equipment is stationary.

 

Wireless System:  Here you want to use an accelerometer connected to a Raspberry Pi to collect the data.  In this situation you will drop the accelerometer and the Raspberry Pi.  Then you want to transmit the data to another system wirelessly.

 

Here are my thoughts:

1)  Do you really want to drop the Raspberry Pi?  I am not sure the drop test rating of a Raspberry Pi but I could see issue in long term use of this type of setup if it is not properly protected.

2)  If you are able to collect the data on the Raspberry Pi, you can post process it without needing the data in real-time.  During the test save the data to the Raspberry Pi and then retrieve it later.  You can retrieve it wirelessly if you want or from the SD card or over Ethernet if you prefer.

David Wilt
The New Standard LLC
0 Kudos
Message 2 of 4
(2,129 Views)

Thanks for your reply. 

You are 100% right, I would want to drop the raspi, but with encapsulated resin, and it will be in a metallic sphere that simulates the human head.

https://www.raspberrypi.org/forums/viewtopic.php?t=134658 with a basic google search I found this. 

In fact, that is the first prototype, and I think the RPi will do it for this test phase, and when it works, I think that the solution will be developed with another SOC like the PSOC from cypress. It is a prelimnary thought for now. 


Second, I connected raspberry pi and LabVIEW using LINX and the wifi protocol (Local I/O) and a MEMS digital accelerometer (I2C connection) and it worked really well and the data was outputted in real-time. 

 

It is a little complicated to retrieve the data after because: 

1) The technicians do 10 sites a day (300 drop test) so there's a lot of work knowing each drop test to each site (or even game) 

2) There's the actual LabVIEW code that has an HMI for the technicians to put the entries like the location and client, which game (swing, slide), then the program calculates the maximum acceleration and a constant named HIC(Head injury criterion) and attributes each these constants to each game. It is a very big LabVIEW VI with more than 100 sub-VI. It was developed by programmers in 8 months of internship. 

 

I am willing to use the same program and input the data directly to it because of the lack of time to build a new application from scratch. 

 

Is it convenient to use LINX and transmit the data from an ADC reading the sensor's output? Do I need to configure the ADC on the Raspi or can I connect it simply using SPI and retrieve data from LabVIEW? 

 

0 Kudos
Message 3 of 4
(2,126 Views)
Solution
Accepted by topic author jadkh

Well if it is OK to drop the Raspberry Pi, then lets move past that.

 

Back to your program architecture.

 

You said that you are willing to use the original program and feed data to it.  So I assume this means there will be some other device this program runs on and the only thing you want to run on the Raspberry Pi is the data acquisition.  If this is the case, you can still collect the data on the Raspberry Pi and then send it to the other device running the main program.  This would not necessary be real-time as it is not streaming the data while it is being collected but you could still get your results right after the test.  This is just something to keep in mind as you work through the data acquisition part as it may be easier to do this this way then to stream the data live.

 

As for your questions about SPI, I am not very familiar with SPI but I know there is some hooks from LINX to the SPI IO on the Raspberry Pi.  So you may have to create your own driver for what every ADC you select but it should be do able.  The question about using a ADC which already has drivers or not, this depends on how comfortable you are with creating your own driver.  If there is an ADC which meets your requires with drivers already built, it will save you time but you will have to see if you can find something that meets your needs.

 

Sorry I cannot provide more direct assistance on your project.

David Wilt
The New Standard LLC
0 Kudos
Message 4 of 4
(2,123 Views)