A Raspberry Pi-based application for precisely controlling temperature and humidity in a dry aging refrigerator.
This system maintains optimal conditions for dry aging meat by controlling refrigeration components and monitoring environmental conditions through redundant sensors. It provides reliable operation with failover capabilities, automatic defrosting, and remote monitoring through Google Sheets integration.
- Precise Temperature Control: Maintains temperature between configurable limits (default: 1-4°C)
- Humidity Monitoring: Tracks and manages humidity levels for optimal dry aging
- Redundant Sensor Setup: Uses dual BME280 sensors (I2C and SPI interfaces) for reliability
- Automatic Defrost Cycles: Scheduled defrost cycles to prevent ice buildup
- Data Logging: Records all sensor readings and system states to Google Sheets
- Email Notifications: Sends alerts for critical events and sensor issues
- Graceful Shutdown: Properly handles termination signals to safely shut down components
- Raspberry Pi (3B+ or newer recommended)
- Two BME280 temperature/humidity sensors:
- One connected via I2C
- One connected via SPI (for redundancy)
- Relay module for controlling:
- Refrigeration compressor
- Evaporator fan
- Appropriate power supply
- Jumper wires and connectors
Raspberry Pi GPIO Pin Layout:
+-----+
| USB |
+-----+
| |
+-----+ +------+-----+------+ +-----+
| | | | | |
| USB | | Pi GPIO | | PWR |
| | | | | |
+-----+ +-+---------------+-+ +-----+
3V| |5V
5V| |GND
SDA/GPIO2-| |TXD/GPIO14
SCL/GPIO3-| |RXD/GPIO15
GPIO4 ___| |___ GPIO18
| Raspberry |
GPIO17-___| Pi |___-GPIO27
(BME280) | | (Compressor Relay)
GPIO22-___| |___-GPIO23
| |
3.3V ______| |______ GND
MOSI/GPIO10 | MISO/GPIO9
SCLK/GPIO11 | CS/GPIO8
| |
(BME280 CS)GPIO5-----------|GPIO6
| |
| |
GPIO19-----| |-----GPIO16
| |
GPIO26-----| |-----GPIO20
| |
GND--------| |-----GPIO21
| | (Evaporator Fan Relay)
GPIO12-----| |-----GND
+-+-------------+-+
| |
| HDMI |
| |
+-------------+
-
Clone the repository:
git clone https://github.com/yourusername/dry-ager.git cd dry-ager -
Install dependencies:
pip install -r requirements.txt -
Create a Google Service Account and download the credentials:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Sheets API
- Create a service account and download the JSON key file
- Place the key file in the project directory as
credentials.json - Share your Google Sheet with the service account email
-
Set up environment variables:
export DRY_AGER_EMAIL_PASSWORD="your_email_password" -
Configure the system:
- Edit
config.pyto match your hardware setup and preferences - Update email settings in
config.py
- Edit
Run the application:
python main.py
--test: Run in test mode with shorter intervals (for development)--debug: Enable detailed debug logging--no-email: Disable email notifications--no-sheets: Disable Google Sheets logging
To run as a system service on Raspberry Pi:
-
Create a systemd service file:
sudo nano /etc/systemd/system/dry-ager.service -
Add the following content:
[Unit] Description=Dry Aging Refrigerator Control System After=network.target [Service] ExecStart=/usr/bin/python3 /path/to/dry-ager/main.py WorkingDirectory=/path/to/dry-ager StandardOutput=inherit StandardError=inherit Restart=always User=pi Environment="DRY_AGER_EMAIL_PASSWORD=your_email_password" [Install] WantedBy=multi-user.target -
Enable and start the service:
sudo systemctl enable dry-ager.service sudo systemctl start dry-ager.service -
Check service status:
sudo systemctl status dry-ager.service
- Google Sheets: All data is logged to the configured Google Sheet
- Local Logs: Check the
logsdirectory for detailed application logs - Email Alerts: Critical events trigger email notifications
The system is designed with modularity and reliability in mind, following SOLID principles:
main.py: Application entry point and main control loopsensors.py: Manages sensor initialization and readingscontroller.py: Controls refrigeration componentsutils.py: Provides utility functions for logging and notificationsconfig.py: Centralized configuration settings
-
Sensor Initialization Failures
- Check wiring and connections
- Verify I2C/SPI is enabled in raspi-config
-
Email Notification Failures
- Check internet connectivity
- Verify email password environment variable
- For Gmail, enable "Less secure app access"
-
Relay Control Issues
- Check relay wiring and GPIO pins
- Verify GPIO permissions
-
Google Sheets Connection Issues
- Check internet connectivity
- Verify credentials file location and permissions
- Ensure sheet is shared with service account email
MIT License
Contributions welcome! Please feel free to submit pull requests.
This system controls refrigeration equipment. Always ensure proper electrical safety and consult with a professional for installation involving high-voltage equipment.