James Coulter's Blog

stuff worth sharing

Gaggia Classic ESP32 PID Mod
Coffee will still suck, but you will have more data on why the coffee sucks, but wont understand what the data means.
@Free, Discreet Maker

tl;dr: I installed a community mod for my coffee machine to give it smart temperature and pressure control. It was my first time building an embedded electronic system, and i had a great time learning new skills from internet strangers, and promised myself i'd capture the journey

coffee-drinking bore a coffee-machine-tinkering hobby; and instead of just a new accessory, or mechanical part, i wanted to give my machine electrical smarts and use it as an excuse to try 3d printing and electronics.

The popular systems were too bloated for me, and rolling my own was too advanced. I stumbled upon a young, open source project fronted by a friendly British maker chap. Named Discreet, it was exactly what I wanted: invisible and autonomous operation, built from atomic, off-the-shelf hardware, and customisable software with a direct line to the maker.

what is discreet

A pcb mounted with temperature and pressure sensors and actuators spliced into the machine, and driven by an esp32 controller and sd card memory. Sensors feed temperature and pressure data to the esp32 who turn on/off the boiler and pump to reach a set brew configuration. In my case 93 degrees, and 9 bars. For power, the board piggybacks from 240V mains 12V with an LED driver, followed again by a 5V buck converter to mitigate the risk of full mains.

sourcing the parts

i wanted to shop locally to familiarise myself with nearby resources for future projects, but it came at a cost. while the BOM was comprehensive, sourcing parts with names, specs, and uses you don't understand in english, let alone sourcing them from your local store in a foreign language. this meant i often bought the wrong part, or too many/too few, paid too much, but likely saved myself waiting for international shipping, and won familiarity for future projects.

wiring & soldering

stripping, crimping, insulating. all new, and mediatative. then came soldering, which tested my sight, steadihandedness and temper. while mainly connectors and the odd transistor, molten solder moves in incomprehensible ways; as if it were to spite me. in the end, I didn't feel i tamed it, but rather learned through trial and error, guided by the kind founder, and herded it into its place.

flashing firmware & uploading software

this came most naturally to me as a software guy. after uploading the arduino code to the esp for its brain, i copied the files to the sd card to build the web server, a local site i can (optionally) set and watch my brew.

3d printing

i bought my first 3d printer, an Easythreed k10, early with the idea of christening it with this project by building the pcb housing. UNfortunately, the machine was more toy than tool, and while i wasn't a stranger to 3D modelling, it taught me essential maintenance, print QA checks, and what i'd value in my next upgrade. I settled on the bambu lab a1, and have been printing happily ever after.

installation & first power

embedding the assembly into the machine was a cramped operating theatre where force applied (which a 10yo machine's fused bits requires) in the wrong direction could cost a new boiler. then, there's mains electricity. study all you want, wiring something to 240V and turning a machine on for the first time, you wait for a boom. And if that doesn't, then the new beeps the system communicates in, pump actuated in rapidfire action, and a water pressure system building to explosive levels beside it all, will.

like magic, it powered on and i could access the dashboard to see temperature and pressure reading, the ssr controlling the boiler, and the dimmer the pump!

troubleshooting gremlins

midway through my first shot pull, i heard the esp restart, which turned out to be from the a loose capacitor on the back. a quick resolder fixed the problem, and i appreciated such a forgiving safety mechanism!

next up, my pressure wouldn't break 2 bar. 7 bars were leaking somewhere, or the sensor reading was faulty. other than a leaky steam valve (part 1/3), not even so much as a drip inside. unfortunately in the search i broke (for the 3rd time) my OPV hose, and had to reorder a new one. (2/3)

While awaiting the new OPV, someone smart recommended a deep clean and check of the pump parts, which fascinated me to see it deconstructed it to its atoms where i discovered its deteriorated threading which could be the low pressure culprit since an airleak from a weak bond could deny the pump building power. another part to replace (3/3).

to rule out sensor malreporting, and try customisng the frontend, i vibed raw data inputs & outputs. Another smart person noticed the flickering power of the pressure sensor, indicative of a short or solder problem. after a quick resolder of 2 suspicious pins, the new pump and opv, i recovered 7 bars! 2 more to go.

inbetween reverting the pump to stock wiring to rule out a faulty dimmer i discovered one end of my opv spring was larger than the other. a stretched 9-bar spring could be mechanicallyc apping the pressure to 7 bars. lucky i had a 12-bar spring handy to see if this would unlock more bars, and then envelope it at 9 with the dimmer. it worked!

then suddenly the water stopped boiling. the ssr was off, and i had fun playing detective with the multimeter until i deduced it was again some dodgy soldering on the teeny, weeny transistor. i spent way too much time cursing while desoldering and prying it off the board, before snapping my replacement, forcing another trip to the shops. eventually got it back in and ssr and boiler power came back to life.

my final gremlin was to figure out why it would shutoff mid-brew as the pressure was building. it screamed power problem to me. so i inspected the board once more, and cleaned it up with some IPA. reinstalling it, i noticed from all my assemblying, wires had exposed, and frayed, so i tidied those up as well. and lo-and-behold, it came alive, hit and held 9 bars of pressure!