https://github.com/craigwinchester/presspi_2025
Wine Press Program 2025
https://github.com/craigwinchester/presspi_2025
arduino pressure-sensor raspberrypi winemaking wines
Last synced: about 1 month ago
JSON representation
Wine Press Program 2025
- Host: GitHub
- URL: https://github.com/craigwinchester/presspi_2025
- Owner: craigwinchester
- Created: 2025-05-31T07:22:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-25T18:55:55.000Z (12 months ago)
- Last Synced: 2025-06-25T19:31:13.495Z (12 months ago)
- Topics: arduino, pressure-sensor, raspberrypi, winemaking, wines
- Language: Python
- Homepage:
- Size: 1.25 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π PressPi: Automated Wine Press Control System π
PressPi is a Python-based automation system designed to control a pneumatic wine press using a Raspberry Pi, Arduino (or ESP32), and a set of relays, sensors, and GUI components. Itβs built to support both manual and automated pressing cycles with safety features like emergency stop and pressure monitoring.
What started as a pandemic side project to pass the time has recently been completely rewritten, with a help from ChatGPT. Iβll admit it: Iβm not a programmer... Iβm a winemaker.
old version here: https://github.com/craigwinchester/raspberry-pi-wine-press
I havenβt connected the system to the actual wine press yet β but thatβs coming soon. If youβre reading this and have experience with motor controllers and wiring, get in touch. I could use some help in that department. Will pay in wine!
---
## β οΈ Disclaimer
This software is provided as-is, without any guarantees or warranties. Wine presses are powerful, high-pressure machines and can be dangerous if misused. Over-inflating the bladder, improper wiring, or failure to follow safety protocols could result in equipment damage, injury, or worse.
By using this code, you acknowledge that you do so at your own risk. The author assumes no responsibility for any damage to property or personal injury that may result from using or modifying this system. Always consult a qualified electrician or technician when working with industrial machinery.
---
## Features
- Full GUI built with Tkinter
- Fully editable press cycle programs.
- Real-time pressure monitoring via ADS1115 & pressure transducer
- Drum position control using bump-detection and timed rotation
- Emergency stop support (software + physical button)
> β οΈ *Still under development β not yet fully functional!*
- Async control loop using `asyncio`
- Web interface (Flask-based) for remote monitoring (optional)
---

*Above: Screenshot of main GUI
---
## Hardware Requirements
- An old wine press!
Mine is a 1993 Velo 2100 Liter. We will reuse all it's old motor starters, 12 volt transformer. etc...
- Raspberry Pi (tested with a 4 Model B)
- Arduino Uno
- ADS1115 analog-to-digital converter
- Pressure transducer (0β30 PSI)
> 5 volt, 3-wire, 1/8" NPT
> Add 0.1 Β΅F and 10 Β΅F ceramic capacitors to filter noise
> Use push-connect pneumatic fittings (6mm)
- Relay board (to control valves, pump, etc. 8 channel)
- OLED screen (optional, 0.96" I2C for local BAR Pressure display)
- Touchscreen (Im using a 7 inch)
- "Bump detector" button for drum position reference.
> I'm reusing the original roller plunger limit switch from the press.
> Also using a small momentary switch and a resistor for testing with the breadboard.
- 3D-printed mounts and enclosures (see `3d_prints/` directory)
> More designs coming soon
- Wires
- breadboard for testing purposes
- a large Syringe (at least 50ml) plus small hoses to connect to the pressure transducer, to simulate the wine press bladder for testing.
---
## Software Stack
- Python 3.x
- Tkinter
- `pyserial` for serial comms
- `aiofiles`, `asyncio` for async control loop
- Arduino/ESP32 sketch to handle sensor readings & display
- Flask web server for remote monitoring
---
## Development Tools
- VS Code (Python)
- Arduino IDE
- VNC Viewer (for remote Pi access)
- WinSCP or other FTP client
- MU or Thonny on the Pi
---
## System Diagram
Wiring of Components
Raspberry Pi to Relay Pin Mapping
```text
GPIO Pin Mapping
| Raspberry Pi GPIO | Physical Pin | Relay Channel | Function |
|-------------------|--------------|----------------|-----------|
| GPIO 17 | Pin 11 | IN1 | LEFT |
| GPIO 27 | Pin 13 | IN2 | RIGHT |
| GPIO 22 | Pin 15 | IN3 | *extra |
| GPIO 23 | Pin 16 | IN4 | DEFLATE |
| GPIO 24 | Pin 18 | IN5 | DEFLATE |
| GPIO 25 | Pin 22 | IN6 | DEFLATE |
| GPIO 16 | Pin 36 | IN7 | INFLATE |
| GPIO 26 | Pin 37 | IN8 | INFLATE |
Power and Ground
| Function | Physical Pin | Description |
|--------------|--------------|-------------------------|
| 5V Power | Pin 2 | Connect to Relay VCC |
| Ground | Pin 6 | Connect to Relay GND |
```
Raspberry Pi to Roller Plunger Limit Switch / Button
```text
GPIO Pin Mapping
| Raspberry Pi GPIO | Physical Pin | button/switch
|-------------------|------------------------------------|
| GPIO 21 | Pin 40 | side 1
Power
| Function | Physical Pin | Description |
|--------------|--------------|--------------------------|
| 3.3V Power | Pin 1 | Connect to side 2 button |
*optional: place a 1kΞ© or a 10kΞ© resistor here in line to button
```
Arduino - ADS1115 - OLED - Pressure Transducer
```text
This gets a bit confusing... hopefully I get this correct!
See above image.
Pressure Transducer - Wiring: Red for +5V; Black for ground; Green for signal output.
Red to both Capacitors(side 1) then ADS1115 VDD
Black to both Capacitors(side 2) then ADS1115 Ground
Green to ADS1115 A0
OLED 0.96 inch 128x64
SCL to ADS1115 SCL & ARDUINO SCL
SDA to ASD1115 SDA & ARDUNIO SDA
VCC to ARDUINO VIN
Ground to ARDUINO Ground or shared ground on breadboard. My Arduino has 2 grounds
ARDUINO
USB to Raspberry Pi USB
A4 to ADS1115 SDA
A5 to ADS1115 SCL
Ground to Pressure Transducer Ground & ADS1115 Ground
5V to ADS VDD
```
---
## ποΈ File & Directory Overview
Click to expand full file structure and descriptions
```text
PressPi_2025/
βββ main.py # Launches the full application (GUI + controller logic)
βββ gui.py # Tkinter GUI for user interaction
βββ controller.py # Async core logic for press stage sequencing
βββ press_logic.py # Press-specific actions (inflate, hold, rotate, etc.)
βββ config.py # Centralized configuration values (thresholds, ports, etc.)
βββ program.py # Press cycle program logic (stage definitions)
βββ program_editor.py # GUI for creating/editing press programs
βββ drum_position_editor.py # GUI tool for calibrating drum position timings
βββ relays_off_boot.py # Optional script to reset all relays on boot
βββ sms_alerts.py # Sends SMS alerts using contact list
βββ status.py # GUI/status bar updater module
βββ utils.py # Helper functions (e.g. formatting, time conversion)
βββ web_server.py # Flask web interface (optional for remote monitoring)
βββ hardware.py # Interfaces with GPIO pins and relay logic
βββ start_PressPi2025.sh # Shell script to auto-start the program on boot
βββ Press_Pi_2025.desktop # Desktop shortcut for GUI launch
βββ README.md # This file β project documentation
βββ .gitignore # Files/folders excluded from Git tracking
β
βββ json_data/ # Saved configuration and contact data
β βββ drum_position.json # Time-based drum position settings
β βββ email_contacts.json # Email alert list (if used)
β βββ programs.json # User-defined press programs
β βββ sms_contacts.json # List of phone numbers for SMS alerts
β
βββ tmp/ # Temp folder for logging
β βββ pressure_history.json # Rolling pressure history log
β βββ pressure_log.json # Main pressure log output
β
βββ static/ # Icons, fonts, images
β βββ FONT/ # Custom fonts (used in GUI)
β βββ wine-press.ico # Application icon
β βββ wine-press.png # GUI/README image
β
βββ Transducer_Arduino/ # Arduino sketches for pressure sensing
β βββ Transducer.ino # Basic serial pressure output
β βββ Ardunio_Screen_Pressure.ino # OLED + pressure
β βββ Ardunio_Screen_Pressure_ADS1115.ino # OLED + ADS1115 version
β βββ backup_115200.hex # Precompiled backup
β
βββ __pycache__/ # Python bytecode cache (auto-generated)
```
---
## Getting Started
1. Clone the repository:
```bash
git clone https://github.com/craigwinchester/PressPi_2025.git
cd PressPi_2025
2. Upload the Arduino sketch to the microcontroller. /Transducer_Arduino/Arduino_Screen_Pressure_ADS1115.ino
3. optional: add relays_off_boot.py to crontab. Turns off all relays at boot. just a saftey precaution. You will need to edit the file first to change the logging pathway.
'''bash
crontab -e
@reboot /your/pathway/here/relays_off_boot.py &
4. Make sure the Arduino is connected via USB and recognized on /dev/ttyUSB0 (or update the port in config.py)
5. run the GUI. python3 main.py. Or better yet test with Thorny on the pi first.