on a fresh install of Raspbian Buster lite
sudo apt-get update
sudo apt-get upgrade
install pip and venv (may be needed on Lite versions of Raspbian)
sudo apt-get install python3-pip
sudo pip3 install --upgrade setuptools
sudo apt-get install python3-venv
git clone [email protected]:albioninnovate/sensors_balloon.git
cd sensors_balloon
make
source ./bin/activate
mkdir data
pip3 install -e ./
if that does not work try :
pip3 install -r requirements-freeze.txt
pip3 install -e ./
sudo apt-get install python3-venv
python3 -m venv ./sensors source ./sensors/bin/activate
(not automaticly installed on lite versions of raspbian)
sudo apt-get install python3-pip
sudo pip3 install --upgrade setuptools
sudo apt-get install -y python-smbus sudo apt-get install -y i2c-tools
sudo raspi-config
pip3 install RPI.GPIO pip3 install adafruit-blinka
sudo pip3 install adafruit-circuitpython-sht31d sudo pip3 install adafruit-circuitpython-as726x sudo pip3 install adafruit-circuitpython-fxos8700 sudo pip3 install adafruit-circuitpython-fxas21002c
(#TODO test with and with out pip3 install adafruit-circuitpython-lis3dh)
to test run: sudo sht31d_test.py (#TODO Investigate need for sudo)
sudo nano /etc/rc.local
add this line above the "0" at the bottom of the file
sudo python /home/pi/sensors_balloon/sensors.py &
or sudo python &
Ref: https://learn.adafruit.com/nxp-precision-9dof-breakout/python-circuitpython
https://circuitpython.readthedocs.io/projects/fxos8700/en/latest/
sudo pip3 install adafruit-circuitpython-fxos8700 sudo pip3 install adafruit-circuitpython-fxas21002c
VIN - 3.3-5V input, which feeds the on board 3.3V voltage regulator and optionally sets the signal levels for the I2C pins (SCL and SDA) if you are using a 5V system. On a 3.3V system (any Adafruit Feather, for example), connect 3.3V to VIN for 3.3V logic throughout the system. On a 5.0V system, connect VIN to 5V, and the signals will be shifted downward to 3.3V before reaching the NXP sensors (which are limited to 3.6V or less for the pins).
3Vo - This is the output of the 3.3V linear regulator on the NXP Precision 9DoF Breakout. On a 5V system, you can use this as an additional 3.3V supply if you need some extra 3.3V power.
GND - This should be connected to GND on your development board.
SCL - I2C, Connect this to SCL on your development board. This pin is level-shifted and 3-5V logic safe.
SDA - I2C, Connect this to SDA on your development board. This pin is level-shifted and 3-5V logic safe.
RST - Optionally connect this to RST on your development board (depending on the logic level used), or to a GPIO pin if you wish to manually reset the sensors on the breakout. This pin isn't required in most circumstances, but can be useful to recover from error conditions on long running systems where the sensors might have entered an unknown config state. This pin is level-shifted and 3-5V logic safe.
AI1, AI2 - This two pins allow interrupts from the Accelerometer/Magnetometer (see the datasheet for details). These are not level shifted but since they are outputs only, you can use with 3 or 5V logic systems.
GI1, G12 - These two pins allow interrupts from the Gyroscope (see the datasheet for details). These are not level shifted but since they are outputs only, you can use with 3 or 5V logic systems.
fxos8700_test.py
import time
import board
import busio
import adafruit_fxos8700
i2c = busio.I2C(board.SCL, board.SDA) sensor = adafruit_fxos8700.FXOS8700(i2c)
#sensor = adafruit_fxos8700.FXOS8700(i2c, accel_range=adafruit_fxos8700.ACCEL_RANGE_4G) #sensor = adafruit_fxos8700.FXOS8700(i2c, accel_range=adafruit_fxos8700.ACCEL_RANGE_8G)
while True: # Read acceleration & magnetometer. accel_x, accel_y, accel_z = sensor.accelerometer mag_x, mag_y, mag_z = sensor.magnetometer # Print values. print('Acceleration (m/s^2): ({0:0.3f}, {1:0.3f}, {2:0.3f})'.format(accel_x, accel_y, accel_z)) print('Magnetometer (uTesla): ({0:0.3f}, {1:0.3f}, {2:0.3f})'.format(mag_x, mag_y, mag_z)) # Delay for a second. time.sleep(1.0)
#FXAS21002C_test.py
import time
import board import busio
import adafruit_fxas21002c
i2c = busio.I2C(board.SCL, board.SDA) sensor = adafruit_fxas21002c.FXAS21002C(i2c)
#sensor = adafruit_fxas21002c.FXAS21002C(i2c, gyro_range=adafruit_fxas21002c.GYRO_RANGE_500DPS) #sensor = adafruit_fxas21002c.FXAS21002C(i2c, gyro_range=adafruit_fxas21002c.GYRO_RANGE_1000DPS) #sensor = adafruit_fxas21002c.FXAS21002C(i2c, gyro_range=adafruit_fxas21002c.GYRO_RANGE_2000DPS)
while True: # Read gyroscope. gyro_x, gyro_y, gyro_z = sensor.gyroscope # Print values. print('Gyroscope (radians/s): ({0:0.3f}, {1:0.3f}, {2:0.3f})'.format(gyro_x, gyro_y, gyro_z)) # Delay for a second. time.sleep(1.0)