The Motion Sensor Box is a simple, open-source sensor box available under the CC BY-SA 4.0 license. The sensor box is based on a Raspberry Pi Zero W and ships a variety of sensors as well as a number of interfaces to incorporate the sensor box into a huge variety of measurement projects.
motion sensor box is build around a Raspberry Pi Zero and several external sensors.
The following lists the electronic components:
The mechanical structure consists of:
The software needed to run the motion sensor box is subdivided into a number of systemd service units. The reasoning behind this architecture is the following:
All interprocess communication between services is implemented using zeroMQ
gpsd
's socket and provides it to other motion sensor box services. Further documentation is available here. Code is located at msb/gpsEach process must provide its data in the form of a pickled list via the zmq protocol. The first three elements of the list are set to be a timezone aware datetime object, the actual epoch and the uptime. The rest of the elements are left for whatever payload.
As an example, the data structure from the imu service is shown. Please note, that the number of elements in the list must match the element names, defined in the motion sensor box config file
import datetime
import uptime
import time
# inertial measurement unit
[
datetime.datetime.fromtimestamp(ts := time.time(), tz=datetime.timezone.utc),
ts,
uptime.uptime(),
acc_x,
acc_y,
acc_z,
rot_x,
rot_y,
rot_z,
mag_x,
mag_y,
mag_z,
temp,
]
The data is serialized using pickles and send as a multipart-message onto the zmq bus. To identify the data in other services, each serialized data package is designated with a topic string. Here is a list of the topic strings used by the motion sensor box software:
imu
gps
pwr
att
adc
ldr
motion sensor box runs the latest version of Raspberry OS
Two sub assemblies need to be prepared before general assembly starts
After the subassemblies have been prepared general assembly can start:
1) Mount the camera glass 2) Mount the round camera holder 3) Mount the camera on the camera holder 4) Mount the four Distanzbolzen 5) Insert the camera cable into the base plate's camera canal 6) Mount the base plate by fixing it with two M3x8 screws 7) Connect the camera with the camera cable 8) Insert the hammer head screw into the base plate and fix it using a M6 nut 9) Insert the battery into the base plate's battery compartment 10) Mount the battery lid using four M3x12 screws 11) To be continued: integration of the electronics stack
1) Use Raspberry Pi Imager to flash the SD card with Raspberry Pi OS lite. Reinsert the SD card afterwards.
2) open the partition named rootfs and from the motion sensor box github repository copy the following files (on linux):
sudo cp /path-to-motion-sensor-box-repository/cfg/hosts /path-to-SD/rootfs/etc
sudo cp /path-to-motion-sensor-box-repository/cfg/hostname /path-to-SD/rootfs/etc
sudo cp /path-to-motion-sensor-box-repository/cfg/rtunnel.service /path-to-SD/rootfs/etc/systemd/system
sudo cp /path-to-motion-sensor-box-repository/cfg/wpa_supplicant.conf /path-to-SD/boot
3) in the boot partition, create an empty file called ssh
to enable ssh login:
touch /path-to-SD/boot/ssh
4) afterwards, please open the file /path-to-SD/rootfs/etc/hostname
and /path-to-SD/Arootfs/etc/hosts
and edit the serial number of the motion sensor box to the corresponding value
5) open the file /path-to-SD/rootfs/etc/systemd/system/rtunnel.service
and replace '[REMOTE PORT]' to 65000 + the serial number, e.g. 0014 (65000 + 0014 = 65014)
6) Sense hat's long pins must be removed: Use a screwdriver to lift the yellow part and then cut the pins.
7) Prepare the cables (see cable documentation)
Assemble the stack starting from the bottom to the top:
The following schematics shows how the external hardware is connected to the pi's header:
Connect the Electronics to power, either through a dedicated USB cable or through the Bulgin power connector. Wait 30 s for the raspberry pi to boot.
Login to the box using SSH (replace XXX with the last 3 digits of the serial number and "location-of-key-on-local-machine"):
ssh pi@flucto.tech -p 65XXX -i "location-of-key-on-local-machine"
Alternatively, if you are in the same WLAN you can login locally (replace XXX with the last 3 digits of the serial number):
ssh pi@msb-0XXX-a.local -i "location-of-key-on-local-machine"
Install git:
sudo apt-get update
sudo apt-get install git
Then clone the git repository to the box' home/pi
folder:
git clone https://github.com/flucto-gmbh/motion-sensor-box.git --recursive
To finish the setup, please follow through with system Setup.
To access a motion sensor box via a bluetooth serial console, follow these steps
To provide a good basis for measurements, motion sensor box includes Waveshare's SenseHat. A TL;DR regarding the senseHat for motion sensor box can be found under doc/waveshare_sense_hat/tldr_sense_hat.
It packs a number of sensors, all connecting to a Raspberry Pi via I2C:
An official Raspberry Pi PiCam Noir (v2) is planned. It will allow low resolution live streams or high resolution imaging at fixed intervals.
motion sensor box features a Navilock NL-852ETTL GNSS receiver. This modern GNSS receiver is based on the ublox8 chipset. It allows to receive navigation signal from any two GNSS systems simultaneously. The Chip supports all currently available GNSS Systems.
Four analog inputs are available via the SenseHat. Additionally, I2C piuns are also exposed, allowing for easy connection to other embedded devices. For more high level applications, three USB-A port are available, allowing additional devices, such as cameras or network interfaces.
The original motion sensor box was jointly developed by Uni Bremen and Flucto GmbH. Its development was inspired by a sensor box that was designed for a research project by Uni Bremen's Institute for Integrated Product Development (BIK) where measurements during the installation of "Trianel Windpark Borkum" were conducted.