
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
TEMPERATURE AND AIR PRESSURE SENSOR
SEN-KY052
1. GENERAL INFORMATION
Dear customer,
Thank you very much for choosing our product. In the following we will
show you what has to be observed during commissioning and use.
Should you encounter any unexpected problems during use, please feel
free to contact us.

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. USAGE WITH THE RASPBERRY PI
2.1 Installation
First you need to install git and pip on your Raspberry Pi, this works with
the following commands:
sudo apt-get install git
Now you can download and install the required librarys for the sensor as
follows:
sudo pip3 install adafruit-circuitpython-bmp280
sudo apt-get install python3-pip
sudo pip3 install adafruit-circuitpython-lis3dh
2.1.1 Installation SPI
To use the sensor with SPI, you must first activate the SPI interface.
To do this, enter the following command:
sudo raspi-config
Now navigate to 3 Interfacing Options -> P4 SPI and enable the SPI in-
terface.
Now you need to reboot your Raspberry Pi with the command:
sudo reboot
Now open the configuration of the Raspberry Pi and activate I2C as
follows:
sudo raspi-config
sudo apt-get install -y python-smbus
sudo apt-get install -y i2c-tools
Now enter the following commands for installing the I2C interface:
2.1.2 Installation I2C
Now navigate to 3 Interface Options -> P5 I2C and enable the I2C inter-
face.

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
Raspberry Pi KY052
3.3 V
(Pin 1, Pin 17)
VCC, SDO, CSB
GND (Pin 6) GND
SCL (Pin 5) SCL
SDA (Pin 3) SDA
2.2.1 Wiring I2C
2.2.2 Wiring SPI
Raspberry Pi KY052
3.3 V
(Pin 1, Pin 17)
VCC
GND (Pin 6) GND
SCLK (Pin 23) SCL
MOSI (Pin 19) SDA
Pin 29 CSB
MISO (Pin 21) SDO
2.3 Programming example
In the following programme example, the temperature, the air pressure
and the calculated altitude are shown.
In order for the altitude to be calculated correctly, the following line in
the programme example must be adjusted:
Replace the 1013.25 with the QNH pressure in hPa (the pressure at sea
level) at your location. Weather services can give you information on this.
sensor.sea_level_pressure = 1013.25