
<aside>

<aside>
</aside>
<aside>
The OS is setup through Raspberry Pi Imager. Here’s a nice tutorial.
<aside>
hostname: bal
username: bal
password: bxxxxxxxRxxxxx
</aside>
I used a 32 GB microSD card, and write the 64-bit RasPberry Pi OS Lite(desktop-free) onto it. The writing process will spend around 5-10 mins. The booting also takes about the same time.
Below is an overlook of the final file tree of the project. For giving bigger picture of how this project is constructed:
<aside>
/home/bal/
├─ bios_logger/ # project holder
│ ├─ bios_logger.py # ✅ Main file: ADS1115 read + CSV + Blynk push
│ ├─ bios_logger.log # service / nohup’s output log (normal/error)
│ ├─ads1115_tds_test.py # ✅ Testing file: without Blynk push
│
├─ logs/ # ✅ data output folder
│ ├─ fermentation_YYYY-MM-DD.csv # ✅ daily CSV generated by bios_logger.py are stored here
│
│
├─ bioenv/ # ✅ Python virtual environment
│ ├─ bin/
│ │ ├─ python # ✅ The python route that would be included in systemd ExecStart
│ │ └─ pip
│ └─ (venv internal folders...)
│
└─ (other users file...)
/etc/systemd/system/ └─ bios_logger.service # ✅ Automatic startup on boot, restart policy, Automatic startup on boot(ex: Blynk auth token), log location
</aside>
</aside>
<aside>
<aside>
Some useful terminal command:
//For ssh into the local pi device:
ssh [email protected]
//By default would be: ssh [email protected]
//for my case, the command code would be: ssh [email protected]
//After connecting to the pi
//for setting wifi or other configuration post-os setup
sudo raspi-config
//shut down and reboot
sudo shutdown now
sudo reboot now
//for testing if device is connected to internet
hostname -I
//for getting the current SSID
iwgetid -r
//for showing a list of registered Wifi SSID
nmcli connection show
//for running a python file in background, while writing the log (error/normal) in the log file
//“Run this now, in the background, until something kills it.”
nohup python script.py > script.log 2>&1 &
//terminate a backgound file
pkill -f your_script.py
//system service
//“This program is part of the system.Start it, watch it, restart it, and start it again after reboot.”
sudo systemctl start app
</aside>
<aside>
A system service will automatically starts running while the machine is powered, unlike nohup background-running python that can be killed simply by power off/reboot.
Make a system service file:
//This is the system service templat file which should be stored as /etc/systemd/system/myservice.service
[Unit]
Description=My Python Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=your_username
WorkingDirectory=/full/path/to/project
ExecStart=/full/path/to/python /full/path/to/script.py
Restart=always
RestartSec=5
Environment=ENV_VAR=value # optional
[Install]
WantedBy=multi-user.target
Useful terminal command:
sudo systemctl daemon-reload
sudo systemctl start myservice
sudo systemctl enable myservice //Enable auto-start on boot
sudo systemctl status myservice //Check service status, see if it's running
journalctl -u myservice -f //view logs
sudo systemctl stop myservice
sudo systemctl restart myservice
sudo systemctl disable myservice
</aside>
</aside>
<aside>
I connected the pi with SSH key in VS code, then started the testing process. I prepared non-additive tangerine juice, and soaked the DFRobot sensor in
<aside>
</aside>
<aside>
</aside>
<aside>
</aside>
<aside>
</aside>
</aside>
<aside>
A Python virtual environment is an isolated Python setup for a specific project, with its own interpreter and packages.
Use it when you want dependency isolation, reproducibility, or to avoid conflicts with system Python—especially for servers, IoT apps, or multiple projects on the same machine. As a rule of thumb, I usually run it before running a python script.
# Create a virtual environment named "bioenv"
python3 -m venv bioenv
# Activate the virtual environment (use its Python & packages)
source bioenv/bin/activate
# Install project-specific dependencies
pip install package_name
# Run your Python script using the venv
python your_script.py
# Deactivate and return to system Python
deactivate
</aside>