Skip to content

Installation Steps

Basic Installation

The Minimum hardware requirements are:

Step 1 - Raspberry Pi OS Installation

Go to the Raspberry Pi Software page and download the Raspberry Pi Imager tool. Proceed with the installation of the OS that meets the hardware requirements.

Raspberry Pi

After the installation of the OS, make sure that you have cloned the following repository on your local machine:

git clone https://github.com/TEXTaiLES/Environmental-Condition-Monitoring
  • The code folder contains the script used to perform sensor measurements, the corresponding sensor library, and a shell script that installs all Python dependencies.

Step 2 - Wiring

The Raspberry Pi Zero W and sensor pins are depicted in the following images.

Raspberry Pi Pins

Raspberry Pi Pins

To connect the DFRobot Gravity sensor with the Raspberry Pi Zero W, use the following connections:

Sensor Pin Raspberry Pi Pin
VCC (+) 5V (Pin 4)
GND (-) GND (Pin 6)
D/T RXD (Pin 10)
C/R TXD (Pin 8)

Important Note: Make use that you select the UART mode on the sensor by moving the switch to the UART position.

Step 3 - Raspberry Pi Setup

After the Raspberry Pi is connected to the sensor and the project folder has been cloned, enter the folder and follow these steps:

1) Install the required libraries:

bash dependencies.sh

2) Once the installation is complete, edit the boot configuration:

sudo nano /boot/firmware/cmdline.txt

Find and remove the part console=serial0, 115200. Save the file and exit.

3) Enable UART and disable Bluetooth:

sudo nano /boot/firmware/config.txt

At the bottom of the file, make sure the line enable_uart=1 is present, and add right above it: dtoverlay=disable-bt. After the configuration, reboot the Raspberry device.

4) Open the prod.py with a code editor and update the database attributes. After that, run:

python prod.py

and the collected data will be displayed in the terminal after each sampling step.