Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
If you want to DIY the Raspberry Pi into a robot that can detect motion posture and orientation, or if you want the Raspberry Pi to collect data such as temperature, humidity, and atmospheric pressure in the environment, this HAT can just meet the above requirements.
Product Parameters | |
Operating Voltage: | 3.3V |
Communication Interface: | I2C |
Logic Voltage: | 3.3V |
Product Size: | 65 x 30.5(mm) |
Accelerometer Features: | Resolution: 16-bit |
Range (optional): ±2, ±4, ±8, ±16g | |
Gyrometer Features: | Resolution: 16-bit |
Range (optional): ±16, ±32, ±64, ±128, ±256, ±512, ±1024, ±2048°/sec | |
Magnetometer Features: | Resolution: 16-bit |
Range: ±4912µT | |
Barometer Characteristics: | Resolution: 24-bit pressure data, 16-bit temperature data; |
Measurement Accuracy (at room temperature): ±0.025hPa | |
Measuring Range: 260 ~ 1260 hPa | |
Measurement Rate: 1 Hz - 75 Hz | |
Temperature And Humidity Sensor Characteristics: | Measurement Accuracy (humidity): ±2% rH |
Measuring Range (humidity): 0% ~ 100% rH | |
Measurement Accuracy (temperature): ±0.2°C | |
Measuring Range (humidity): -30 ~ 100°C | |
Color Recognition Sensor | Resolution: 4 channel RGBC, 16 bits per channel |
AD Conversion Chip | Resolution: 16 bits |
PK Item | Sense HAT (C) | Sense HAT (B) | Note |
Gyroscope | Measurement range: ±16/32/64/128/256/512/1024/2048 dps Resolution: 16-bit | Measurement range: ±250/500/1000/2000 dps Resolution: 16 bits | C-type angular velocity range is more |
Accelerometer | Measurement range: ±2/4/8/16 g Resolution: 16 bits | Measurement range: ±2/4/8/16 g Resolution: 16 bits | |
Magnetometer | Measurement range: ±±49.12 gauss Resolution: 16-bit | Measurement range:±49 gauss Resolution: 16-bit | C-type magnetic measurement range is wider |
Barometer | Measurement range: 260 ~ 1260 hPa Measurement accuracy (at room temperature): ±0.025hPa Measurement rate: 1 Hz - 75 Hz | Measuring range: 260 ~ 1260 hPa Measurement accuracy (room temperature): ±0.025hPa Measurement rate: 1 Hz - 75 Hz | |
Temperature and Humidity Sensor | Measurement accuracy (humidity): ±2% rH Measurement range (humidity): 0% ~ 100% rH Measurement accuracy (temperature): ±0.2°C Measurement range (temperature): -30 ~ 100°C | Measurement accuracy (humidity): ±2% rH Measurement range (humidity): 0% ~ 100% rH Measurement accuracy (temperature): ±0.2°C Measurement range (temperature):-30 ~ 100°C | |
Others | Color sensor High-precision 16-bit AD conversion chip | Color sensor High-precision 16-bit AD conversion chip |
Hardware connection as shown:
Connecting with Raspberry Pi Zero
Connect to Raspberry Pi 4 (required to add a 2x20PIN female header)
Connect to Raspberry Pi Zero
sudo raspi-config Choose Interfacing Options -> I2C ->yes start i2C kernel driver
and then reboot Raspberry Pi
sudo reboot
#Open the Raspberry Pi terminal and run the following command wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz tar zxvf bcm2835-1.71.tar.gz cd bcm2835-1.71/ sudo ./configure && sudo make && sudo make check && sudo make install # For more information, please refer to the official website: http://www.airspayce.com/mikem/bcm2835/
#Open Raspberry Pi terminal and execute sudo apt-get install wiringpi #For Raspberry Pi systems after May 2019 (earlier than before, it is not necessary to execute), an upgrade may be required wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # Run gpio -v and version 2.52 will appear. If it does not appear, the installation is wrong. #Bullseye Branch systems use the following commands: git clone https://github.com/WiringPi/WiringPi cd WiringPi ./build gpio -v # Run gpio -v and version 2.70 will appear. If it does not appear, the installation is wrong.
sudo apt-get update #python2 sudo apt-get install python-pip sudo pip install RPi.GPIO sudo pip install spidev sudo apt-get install python-smbus #python3 sudo apt-get install python-pip3 sudo pip3 install RPi.GPIO sudo pip3 install spidev sudo apt-get install python3-smbus
wget https://www.waveshare.com/w/upload/0/04/Sense_HAT_C_Pi.zip unzip Sense_HAT_C_Pi.zip -d Sense_HAT_C_Pi cd Sense_HAT_C_Pi/RaspberryPi
ADS1015: AD conversion demos (STM32, BCM2835, WringPi and Python) Device address: 0x48
QMI8658C: 6-axis sensor demos (STM32, BCM2835, WringPi and Python) Device address: 0x6B
AK09918C: 3-axis sensor demos (STM32, BCM2835, WringPi and Python) Device address: 0x0C
LPS22HB: Air pressure sensor demos (STM32, BCM2835, WringPi and Python) Device address: 0x5C
SHTC3: Temperature and humidity sensor demos (STM32, BCM2835, WringPi and Python) Device address: 0x70
TCS34087: Color recognition sensor demos (STM32, BCM2835, WringPi and Python) Device address: 0x29
Note: The I2C addresses of all the sensors of this module are different, and the user can use all the sensors on the board at the same time.
Enter the terminal of the Linux and execute the following command:
cd /home/pi/Sense_HAT_C_Pi/RaspberryPi/IMU/bcm2835/ #pi for account sudo make clean sudo make sudo ./main
Expected result:
Press Ctrl+C to end the program.
Enter the terminal of the Linux and execute the following command:
cd /home/pi/Sense_HAT_C_Pi/RaspberryPi/IMU/wiringPi/ #pi for account sudo make clean sudo make sudo ./main
Expected result:
Press Ctrl+C to end the program.
This demo is based on XNUCLEO-F103RB and exports the data by serial port 2. The wiring as shown below:
Sense HAT (C) | STM32 |
3V3 | +3.3V |
GND | GND |
SDA | PB9 |
SCL | PB8 |
Compile and download the program:
Open the serial port assistant and set the baud rate to 115200.
Expected result:
The unit of acceleration measured by the program is LSB (least significant bit), and the unit is often converted to gravitational acceleration (g) in actual use. The default range is 16384 LSB/g (±2g), so the actual acceleration measured is: