{"id":15611908,"url":"https://github.com/idoshr/smart-espresso","last_synced_at":"2026-02-04T02:37:30.458Z","repository":{"id":214978413,"uuid":"735359609","full_name":"idoshr/smart-espresso","owner":"idoshr","description":"Smart espresso machine using a Raspberry Pi 4 and a few sensors.","archived":false,"fork":false,"pushed_at":"2024-12-29T21:32:00.000Z","size":4105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T22:23:22.548Z","etag":null,"topics":["coffee","espresso","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idoshr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-24T16:18:51.000Z","updated_at":"2024-12-29T21:32:04.000Z","dependencies_parsed_at":"2024-06-15T09:29:22.125Z","dependency_job_id":"efa33104-5e11-4084-9881-dcb8501c7c08","html_url":"https://github.com/idoshr/smart-espresso","commit_stats":null,"previous_names":["idoshr/smart_espresso","idoshr/smart-espresso"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoshr%2Fsmart-espresso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoshr%2Fsmart-espresso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoshr%2Fsmart-espresso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoshr%2Fsmart-espresso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idoshr","download_url":"https://codeload.github.com/idoshr/smart-espresso/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237446286,"owners_count":19311293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coffee","espresso","raspberry-pi"],"created_at":"2024-10-03T06:20:59.486Z","updated_at":"2026-02-04T02:37:30.451Z","avatar_url":"https://github.com/idoshr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Espresso\n\n[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)\n[![License](https://img.shields.io/badge/license-BSD--3--Clause-green.svg)](LICENSE)\n[![Status](https://img.shields.io/badge/status-beta-yellow.svg)](https://github.com/idoshr/smart-espresso)\n\n_**WORK IN PROGRESS**_\n\nDIY espresso machine monitoring with Raspberry Pi 4, pressure sensors, OLED display, and optional Home Assistant integration.\n\n## Features\n\n- Real-time pressure monitoring (boiler \u0026 brew head)\n- Dual ADC support: MCP3008 (10-bit SPI) or ADS1115 (16-bit I2C)\n- OLED display (SH1106 128x64)\n- Home Assistant integration\n- Extensible sensor architecture\n\n## Hardware\n\n| Qty | Component | Link | Notes |\n|-----|-----------|------|-------|\n| 1 | Raspberry Pi 4 Model B (2GB+) | | Main controller |\n| 1 | MCP3008 ADC **or** ADS1115 ADC | [MCP3008](https://a.aliexpress.com/_olcJc4g) / [ADS1115](https://a.aliexpress.com/_c3c7goPp) | ADS1115 default |\n| 2 | Pressure Sensors (0-0.5MPa, 0-2MPa) | [AliExpress](https://a.aliexpress.com/_omToNFi) | ⚠️ Get 3.3V version (G1/8) |\n| 1 | SH1106 OLED Display (1.3\", I2C) | [AliExpress](https://a.aliexpress.com/_oEzEfpA) | Optional |\n| 2 | Brass Pipe Fittings (F-F-M 1/8\") | [AliExpress](https://a.aliexpress.com/_okOIGjW) | For sensor mounting |\n\n**Tools**: Soldering iron, multimeter, ratchet wrench, Teflon tape\n\n## Wiring\n\n### OLED Display (I2C)\n![Display Wiring](docs/img/display.png)\n\n| Pi Pin | → | Display |\n|--------|---|---------|\n| 1 (3.3V) | → | VCC |\n| 3 (SDA) | → | SDA |\n| 5 (SCL) | → | SCL |\n| 6 (GND) | → | GND |\n\n### MCP3008 (SPI)\n![MCP3008 Wiring](docs/img/analog.png)\n\n| Pi Pin | → | MCP3008 |\n|--------|---|---------|\n| 1 (3.3V) | → | VDD (16), VREF (15) |\n| 6 (GND) | → | AGND (14), DGND (9) |\n| 19 (MOSI) | → | DIN (11) |\n| 21 (MISO) | → | DOUT (12) |\n| 23 (SCLK) | → | CLK (13) |\n| 24 (CE0) | → | CS (10) |\n\nConnect sensors: VCC→3.3V, GND→GND, OUT→CH0/CH1\n\n### ADS1115 (I2C)\n| Pi Pin | → | ADS1115 |\n|--------|---|---------|\n| 1 (3.3V) | → | VDD |\n| 3 (SDA) | → | SDA |\n| 5 (SCL) | → | SCL |\n| 6 (GND) | → | GND |\n\nConnect sensors: VCC→3.3V, GND→GND, OUT→A0/A1\n\n## Installation\n\n```bash\n# Enable interfaces\nsudo raspi-config  # Enable I2C and/or SPI\n\n# Install package\npip3 install smart-esppresso\n\n# Or from source\ngit clone https://github.com/idoshr/smart-espresso.git\ncd smart-espresso\npip3 install -e .\n```\n\n## Configuration\n\nSet via environment variables:\n\n```bash\nexport ADC_TYPE=\"ADS1115\"          # or \"MCP3008\"\nexport HA_ENABLE=\"True\"            # Optional\nexport HA_URL=\"http://192.168.1.100:8123\"\nexport HA_TOKEN=\"your_token_here\"\n```\n\n### Generating Home Assistant API Token\n\nTo integrate with Home Assistant, you need a long-lived access token:\n\n1. Open your Home Assistant web interface\n2. Click on your profile (bottom left corner)\n3. Scroll down to \"Long-Lived Access Tokens\" section\n4. Click \"Create Token\"\n5. Give it a descriptive name (e.g., \"Smart Espresso\")\n6. Copy the generated token and use it as `HA_TOKEN`\n\n**Important**: Save the token immediately - it won't be shown again. For more details, see the [Home Assistant Authentication documentation](https://developers.home-assistant.io/docs/auth_api/#long-lived-access-token).\n\n## Usage\n\nSee [main.py](main.py) for complete example.\n\n```python\nfrom smart_espresso.analog_sensor.ads1115_analog_sensor import ADS1115ADC\nfrom smart_espresso.analog_sensor.pressure_analog_sensor import PressureAnalogSensor\nfrom smart_espresso.smart_espresso import SmartEspresso\n\n# Create sensors\nanalog_devices = [\n    PressureAnalogSensor(adc=ADS1115ADC(pin=0, gain=2/3), name=\"Head\", max_pressure_mpa=2.0),\n    PressureAnalogSensor(adc=ADS1115ADC(pin=1, gain=2/3), name=\"Boiler\", max_pressure_mpa=0.5),\n]\n\n# Run\nse = SmartEspresso(analog_devices=analog_devices, client_ha=None, display=None)\nse.run()\n```\n\n**With MCP3008**: Replace `ADS1115ADC(pin=0, gain=2/3)` with `MCP3008ADC(pin=0)` (keep `max_pressure_mpa` parameter)\n\n## Troubleshooting\n\n- **No devices**: `sudo raspi-config` → Enable I2C/SPI, then `sudo i2cdetect -y 1`\n- **Wrong readings**: Verify 3.3V sensors, check wiring, wait for auto-calibration\n- **Display issues**: Check I2C address with `sudo i2cdetect -y 1` (usually 0x3C)\n- **HA errors**: Verify URL includes `http://`, check token validity\n- **Permissions**: `sudo usermod -a -G spi,i2c,gpio pi \u0026\u0026 sudo reboot`\n\n## Project Structure\n\n```\nsmart_espresso/\n├── analog_sensor/\n│   ├── analog_sensor.py           # Base classes\n│   ├── mcp3008_analog_sensor.py   # MCP3008 ADC\n│   ├── ads1115_analog_sensor.py   # ADS1115 ADC\n│   └── pressure_analog_sensor.py  # Pressure sensor\n├── smart_espresso.py              # Main class\n└── utils.py                       # Helpers\n```\n\n## Contributing\n\nPull requests welcome! Run tests with `pytest smart_espresso/test/`\n\n## License\n\nBSD 3-Clause License\n\n## References\n\n- [DFRobot Pressure Sensor](https://wiki.dfrobot.com/Gravity__Water_Pressure_Sensor_SKU__SEN0257)\n- [Coffee4Randy's Project](https://sites.google.com/view/coffee4randy/home)\n- [Raspberry Pi Pinout](https://pinout.xyz)\n\n---\n\n**Made with ☕ by coffee enthusiasts**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidoshr%2Fsmart-espresso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidoshr%2Fsmart-espresso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidoshr%2Fsmart-espresso/lists"}