Raspberry Pi for research labs (2) Connecting an accelerometer

1 min read

Raspberry Pi for research labs (3)
Raspberry Pi for research labs (1)

We recently used a smartphone to measure participants’ head motion during an NIRS experiment and got decent results. Smartphone is easy to use, but its size is relatively bulky on participants’ head. Is it possible to use a much smaller device?

In this summer, Joe Baker and Semir Shafi in our lab at Stanford tackled this problem with Raspberry Pi and a standard alone accelerometer. Raspberry Pi costs ~$40 and the accelerometer costs ~$20. So the total investment is ~$60. Not bad.

Joe and Semir
Joe and Semir

The accelerometer was purchased from adafruit.com. The size of the accelerometer is like a quarter, fairly small and would have no effect on a participant’s head.


Semir connected Raspberry Pi, the accelerometer, a monitor and a keyboard/mouse. He then developed a python program to read the data from the accelerometer and displayed it in real time.

Raspberry pi and accelerometer
Raspberry pi and accelerometer

How did it work? Let’s see a real demonstration by Semir. As you see in the video, while the program is running, Semir took the accelerometer back and forth. The x, y, and z data from the accelerometer is displayed on the screen in the real time.

According to Joe, this accelerometer can capture data at 100Hz, much faster than a smartphone’s accelerometer. Besides, it’s easier to integrate with other devices because Raspberry Pi is highly programmable. For example, it is possible to trigger the measuring with an external program so different data sources can be synchronized.

What is more, it’s possible to integrate Raspberry Pi/Accelerometer system with a tablet (e.g. Microsoft Surface or iPad, or even a smartphone). This will make the system much easier to use.


Want to receive new post notification? 有新文章通知我

第五十四期fNIRS Journal Club通知2024/07/27, 10am 黄鑫

Wanling Zhu
10 sec read

第五十三期fNIRS Journal Club视频 李洪

Youtube: https://youtu.be/czyJTrXhees优酷:https://v.youku.com/v_show/id_XNjQwNjc5OTk0OA==.html 个体在处理不同
Wanling Zhu
12 sec read

第五十三期fNIRS Journal Club通知2024/06/22, 10am 李洪

Wanling Zhu
8 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *