• sales

    +86-0755-88291180

Sense HAT (B)

Introduction

Sense HAT (B) for Raspberry Pi, Onboard Multi Powerful Sensors, Supports External Sensors. Can be plugged to Raspberry Pi directly.


Feature

  • Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards
  • Onboard ICM20948 (3-axis accelerometer, 3-axis gyroscope, and 3-axis magnetometer), detects movement, orientation, and magnetic
  • Onboard SHTC3 digital temperature and humidity sensor, allows monitoring the environment
  • Onboard LPS22HB barometric pressure sensor, allows monitoring the environment
  • Onboard TCS34725 color sensor, identifies the color of nearby object
  • Onboard ADS1015 ADC, 4-ch 12-bit precision, AD expansion to support more external sensors
  • Brings I2C control pins, for connecting other host boards like STM32
  • Comes with development resources and manual (examples for Raspberry Pi/STM32)

Specification

Specification of Sense HAT (B)
Working voltage3.3V
InterfaceI2C
Dimension65mm x 30.5mm
AccelerometerResolution: 16-bit
Ranging:±2/±4/±8/±16g
GyoscopeResolution: 16-bits
Ranging:±250/±500/±1000/±2000°/sec
MagnetometerResolution: 16-bits
Ranging:±4900µT
BarometerResolution:24-bits (Pressure), 16-bits(Temperature)
Accuracy (ordinary temperature): ±0.025hPa
Speed: 1 Hz - 75 Hz
Temperature & HumidityAccuracy (humidity):±2% rH
Ranging(humidity): 0% ~ 100% rH
Accuracy(temperature): ±0.2°C
Ranging(temperature): -30 ~ 100°C
Color sensorResolution: 4-channels RGBC, 16-bits per channel
ADCResolution: 12-bits

User Guides

Download examples

Download demo code from #Demo codes. Unzip it and get the codes as below:

  • ADS1015: ADC examples (STM32, BCM2835(Pi), WiringPi(Pi) and Python(Pi) four examples)   Device address:0x48
  • ICM-20948: 9 axis sensor examples (STM32, BCM2835(Pi), WiringPi(Pi) and Python(Pi) four examples)   Device address:0x68
  • LPS22HB: Barometric pressure sensor examples (STM32, BCM2835(Pi), WiringPi(Pi) and Python(Pi) four examples)   Device address:0x5C
  • SHTC3: Temprature & Humidity sensor examples (STM32, BCM2835(Pi, WiringPi(Pi) and Python(Pi) four examples)   Device address:0x70
  • TC34725: Color sensor example (STM32, BCM2835(Pi), WiringPi(Pi) and Python(Pi) four examples   Device address:0x29

Raspberry Pi examples

You should copy raspberrypi example to Raspberry Pi firstly. There are more than one examples, you can rename the folder and put them to one raspberrypi folder for easy using.

You need to copy the examples to /boot of Raspberry Pi and then copy them to /home/pi

Libraries installation

Before you run examples, you should install related libraries.

  • BCM2835 library:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
sudo tar zxvf bcm2835-1.60.tar.gz
cd bcm2835-1.xx
sudo ./configure
make
sudo make check
sudo make install
Note: You can also go to http://www.airspayce.com/mikem/bcm2835/index.html for newest libraries.

  • wiringPi libraries
sudo apt-get install git
sudo git clone git://git.drogon.net/wiringPi
cd wiringPi
sudo ./build
  • Python libraries
sudo apt-get install python-pip 
sudo pip install RPi.GPIO
sudo pip install spidev
sudo apt-get install python-imaging
sudo apt-get install python-smbus
Enable I2C interface
Before running examples, you also need to enable I2C.
Open terminal, run command sudo raspi-config to enter configuration menu
Choose Interfacing Options -> I2C -> Yes
Hardware connection

To connect the Sense HAT (B) to Raspberry Pi, you can directly add it on the 40PIN GPIO or wire it pin by pin.

Sense HAT (B)Raspberry Pi
BoardBCM2835
VCC3.3V3.3V
GNDGNDGND
SDA3P2
SCL5P3
1. ICM20948 examples
  • bcm2835 example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/ICM-20948/wiringPi/bcm2835
sudo make
sudo ./ICM20948_D
  • WiringPi example

Open terminal of Raspbian, run example by command:

cd ~/Sense HAT (B)/ICM-20948/Raspberry Pi/wiringPi
sudo make
sudo ./ICM20948_D
  • python example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/LPS22HB/Raspberry Pi/python
sudo python ICM20948.py
  • Expected result:

To stop example, you can press Ctrl + C

2.LPS22HBTR example

Note: the temperature detection of air pressure sensor is only used as compensation. For accurate temperature detection, please observe the value of shtc3 temperature and humidity sensor.

  • bcm2835 example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/LPS22HB/wiringPi/bcm2835
sudo make
sudo ./LPS22HB
  • WiringPi example

Open terminal of Raspbian, run example by command:

cd ~/Sense HAT (B)/LPS22HB/Raspberry Pi/wiringPi
sudo make
sudo ./LPS22HB
  • python example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/LPS22HB/Raspberry Pi/python
sudo python LPS22HB.py
  • Expected result:

To stop example, you can press Ctrl + C

3.SHTC3 example

Note: the raspberry PI's own heat will affect the actual measured temperature. The board has an I2C interface. If accurate ambient temperature is needed, the raspberry PI can be connected to the module at a distance and then tested by wire.

  • bcm2835 example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/SHTC3/wiringPi/bcm2835
sudo make
sudo ./SHTC3
  • WiringPi example

Open terminal of Raspbian, run example by command:

cd ~/Sense HAT (B)/SHTC3/Raspberry Pi/wiringPi
sudo make
sudo ./SHTC3
  • Expected result:

To stop example, you can press Ctrl + C

4. TC34725 example
  • bcm2835 example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/TC34725/wiringPi/bcm2835
sudo make
sudo ./TC34725
  • WiringPi example

Open terminal of Raspbian, run example by command:

cd ~/Sense HAT (B)/TC34725/Raspberry Pi/wiringPi
sudo make
sudo ./TC34725
  • python example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/TC34725/Raspberry Pi/python
sudo python TC34725.py
  • Expected result:

To stop example, you can press Ctrl + C

5. ADS1015 example
  • bcm2835 example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/ADS1015/wiringPi/bcm2835
sudo make
sudo ./ADS1015
  • WiringPi example

Open terminal of Raspbian, run example by command:

cd ~/Sense HAT (B)/ADS1015/Raspberry Pi/wiringPi
sudo make
sudo ./ADS1015
  • python example

Open terminal of Raspbian, Compile codes and run example by command:

cd ~/Sense HAT (B)/ADS1015/Raspberry Pi/python
sudo python ADS1015.py
  • Expected result:

To stop example, you can press Ctrl + C

STM32 examples

The STM32 examples are written based on STM32F103RBT6, it will print measuring result to UART 1.

Hardware connection
Sense HAT (B)STM32
VCC5V/3.3V
GNDGND
SDAPB11
SCLPB10
1. ICM20948 examples

1. Open the project

2. Compiling and download the project

3. Open serial SSCOM software, result are printed as below

2. LPS22HBTR examples

1. Open the project

2. Compiling and download the project

3. Open serial SSCOM software, result are printed as below

3. SHTC3 examples

1. Open the project

2. Compiling and download the project

3. LED 2 lights on if sensor work normally and LED lights on when humidity is larger than 80%



4. TC34725 examples

1. Open the project

2. Compiling and download the project

3. Open serial SSCOM software, result are printed as below

5. ADS1015 examples

1. Open the project

2. Compiling and download the project

3. Open serial SSCOM software, result are printed as below

TAG: Sipeed Lichee Tang Nano1K FPGA MINI Development Board GW1NZ-1 Raspberry Pi 5 TTL IPS Raspberry Pi Display Driver Board Raspberry Pi DSI Scr RoArm M2 4 DOF High Torque Serial Bus Servo ROS2 WIFI ESP NOW UART USB ST3235 QMI8658C For ESP32 Multi Protection Raspberry Pi 5 PCIe to SATA Expansion Board with EEPROM HAT+ voice module Raspberry Pi 3.5 inch LCD F Display Capacitance TouchScreen 60fps ST7796 GT911 320x480 Also For Arduino/Pico2/ESP32/RP2040/RP2350 ESP32 MLX90641 ADXL354CEZ ESP32 3.5 inch Capacitive TouchScreen LCD Display ST7796 FT6336 320x480 For Arduino/Raspberry Pi/Pico RV1103 SC3336 MPW7 Raspberry Pi 5 PCIe to WIFI7 Adapter Board HAT Pi5 For Google TPU BE200 AX210 AI Computer USB Monitor Screen Raspberry Pi Pico NVIDIA Jetson Xavier NX AI 21TOPS Supercomputer Edge Computing eMMC-16GB RAM 8/16GB Raspberry Pi 11.6 inch LCD HDMI /Type C Display In-Cell Capacitive TouchScreen 1768x828 For Jetson Nano/mini Computer PC LCD Screen Driver Board