You can find a more comprehensive documentation in the report.md.
RPiDataMonitor
is a small project I worked on to learn more about writing code for a self-contained device using a single-board Raspberry Pi and various sensors. The project includes the following specs:
Raspberry Pi 4 Model B
with theRaspbian GNU/Linux 12
operating systemDHT11
humidity and temperature sensor16x2 LCD Panel
(w/out i2c controller)
Here is a picture and a fritzing diagram that shows the hardware connections for the device:
The project is structured as follows:
├── build intermediate build files e.g. *.o (created by make)
├── include header files
├── src C source files
│ ├── main.c Entry point for the CLI
│ ├── db.c Functions for db operations
│ ├── humidityTempSensor.c Record DHT11 data
│ ├── lcd.c Outputs data to LCD
│ └── gui.c incomplete GUI for the program
├── .gitignore
├── Makefile
└── README.md
There are three dependencies that is required before building and running this project
Install WiringPi (required for GPIO interfacing)
git clone https://github.com/WiringPi/WiringPi
Intall mariadb and mysqlclient (or any choice of database)
sudo apt-get install mariadb-server
sudo apt-get install default-libmysqlclient-dev
Start MariaDB, and log in as root
sudo systemctl start mariadb
sudo mysql
Create a user (choose a username
and password
to replace {username} & {password}, without the curly braces)
create user '{username}'@'localhost' identified by '{password}';
Clone repository
git clone https://github.com/jayd-lee/RPiDataMonitor
Build executable
make
./build/main