Skip to main content

Gaggiuino

· 27 min read

I first heard about Gaggiuino a number of years ago on one particular deep dive on espresso machines.

I should preface this by making it clear my 'deep dives' mainly searching "[search term] + reddit".

Reddit is far from a source of truth, but its community knowledge is a hell of a lot better than, say, random blogs like this one.

It quickly became clear that Gaggiuino is first and foremost a community of espresso and tinkerer enthusiasts.


What is Gaggiuino?

The often mispelled "Gaggiuino" is an amalgamation of "Gaggia" (as in the Italian Espresso Machine Brand) and "Arduino", also an Italian company that provides microcontrollers and kits for building various devices.

Simply put, Gaggiuino is (was? - see next section) a community effort to document a process that turns a simple manual espresso machine into a "smart" espresso machine.

It does so by modding the internal components of the simple, yet elegant and quality Gaggia Classic espresso machine.

The Gaggiuino homepage lives at https://gaggiuino.github.io

The Stock Gaggia Classic

The Gaggia Classic at stock, is basically a boiler, a thermostat, a pump, a three-way valve, and three switches.

It has no digital components, only relying on simple electronic components to "best guess" temperature and pressure. The thermostat and over-pressure valve (OPV) spring, respectively.

A home barista may need to spend some time with the stock machine in order to learn its subtle ways - how long it takes to heat up, if you need to "temperature surf" by pressing the steam button to heat up the boiler before pulling a shot, or how to build up pressure for steaming the milk.

Giving it brains

In comes the Gaggiuino project:

By implenting into this simple machine a few digital components:

  • A thermocouple sensor to accurately measure temperature
  • A dimmer to control the pump, and thus flow volume.
  • A relay to control the valve.
  • A pressure transducer to measure water pressure
  • And a microcontroller to bind them all...

We have now created the potential to first and foremost learn quite a bit about espresso machine internals, microcontrollers, and being a home barista...

But to also transform a simple machine into something much more advanced. Our machine can now pinpoint pressure, temperature, and flow at different points in time. Variables required to be fine-tuned for a quality shot of espresso.

In addition to the above, the project provides software for the microcontroller, a touchscreen interface to set your profiles, and 3d printed housings and parts to match the machine's elegance ( as to not make it look like some mad tinkerer put it all together - hruff!)


What isn't Gaggiuino?

It is no longer open source for future iterations

Gaggiuino gained its reputation as an open-source project for Generation 1 and 2, and it is one of the qualities that attracted me to the project in the first place.

However as of 06/10/2024 and in its 3rd iteration - which includes a bigger screen and WiFi OTA updates - a decision was made to close-source this part of the project.

The reasoning provided is:

Gaggiuino Gen 3 is free to use and will offer free software updates, but the source code is no longer available. This decision was made to maintain high standards for the hardware required for the project and prevent individuals from fracturing the community with subpar, non-standard components and processes that were untenable for Gaggiuino’s community-driven support to accommodate.

Sincerely,
The GAGGIUINO Team

The last update of Generation 2 is still open source and can be accessed at its designated github branch: stm32-blackpill

It is not quite a business (yet)

Gaggiuino is still very much community driven, especially in its Discord - which exists as a source of truth and community driven support channel.

Though, it is hard not to question the future of the project by close-sourcing and requiring "activation" of components for Generation 3.

This project also makes efforts to designate 'official' vendors for pre-built components (PCB) and 3D printed parts. I am sure someone is making money here, but at the same time it is hard not to argue that it makes supporting this project easier and clearer for newcomers.

It is not newbie-friendly

The project often receives criticism of its poor documentation. It is simply a github pages site with aliexpress links, schematic pictures, and some notes to clarify certain parts of the build.

All tied together in a somewhat disorganized side nav-bar.

To top that off, there are several different builds - ones for particular Gaggia models, and ones using pre-assembled components (PCB build), and another for assembling the components yourself (LEGO builds), and ones for each Generation.

The project avoids any 'official' build video, due to complication introduced above.

One is expected to know how to read schematics, to know how to work with and solder electrical components, to know how to work safetly with high voltage electricity, and to know how to use a multimeter.

One is also expected to be familiar with flashing firmware for devices, and to build and upload software using Visual Studio.

If one desires support, one is expected to know how to navigate the often clunky and disorganized Discord interface. If you don't, for example, read all your notifications and bot messages, you may not know you have to type in a secret command in order to "activate" your account in the discord channel.

But if one has the patience to wade through all that, you will come out the other side rewarded with a capable machine and a new appreciation for this project.


My Gaggia Classic Evo Pro Gen 2 LEGO Build Experience

That was a mouthful, wasn't it?

This section will detail my build experience, and offer tips and guidelines for those who may be thinking about embarking on this project.

It will not serve as a detailed guide. For that, you must refer directly to the documentation and schematics.

Deciding on a Build Path

It is important to know what path you will take when building the Gaggiuino. Here are the variables we must decide on first:

  • What Gaggia Classic model we will modify

    Gaggia has made several variations of the Gaggia Classic over the years. Some require specific mods.

  • What Generation we will use

    Generations are in reference to the software, firmware, and screen utilized.

    Gen 2 uses open-source software, and the Nextion touchscreen display.

    Gen 3 uses closed-source software, and the SP32-S3 touchscreen display (which must be activated by the official vendor)

  • What Build we will follow (PCB or Component/LEGO)

    PCB involves ordering a Printed Circuit Board from an official vendor where the components are already assembled together.

    Component/LEGO involves ordering the individual components and soldering them yourself.

  • What wiring method will we use? (Stock Wiring Integration or Custom Wiring)

    Stock Wiring involves utilizing the wiring that already exists with jumper connections.

    For those wanting a cleaner and professional look, the Custom Wiring path has you assemble your own wiring harness.

    For some Gaggia models, one is recommended over the other.

With this information, we can now intelligently navigate the Gaggiuino documentation for the info we need.

Picking a Gaggia Classic

This build was done on a refurbished Gaggia Classic Evo Pro 100-120V ordered from WholeLatteLove. Model ID#: SIN035R RI9380

I saved about $100 ordering a refurbished model.

Boilergate

With regards to "boilergate" - (an issue where some models have a coated boiler that flakes off over time into the water) - I was assured by WholeLatteLove that the model I was ordering did not have the issue:

All of the GAGGIA CLASSIC EVO PRO models are going to be POST 2023 updates, I don't have specific dates beyond that.
Also, all of the GAGGIA CLASSIC EVO PRO machines are going to have uncoated boilers EXCEPT the anniversary edition.

— WholeLatteLove

warning

This means that the gold "Anniversary Editions" you find cheap on Amazon will have the boilergate issue.

Deciding on Generation and Build

I decided on the Generation 2 LEGO Build for the Gagguino.

This decision was made due to simply enjoying the learning process. The documentation expresses that the LEGO build offers flexiblity, and I suppose that is true if I wanted to add more modules or sensors to the microcontroller. But really, I just wanted the experience of assembling it from scratch.

This decision was also made before Gen 3 was announced. In hindsight, I think I would still have picked Gen 2, because Gen 3 was announced to be closed- source. At some point, I would like to enjoy the flexibility of forking the project and diving into the code.

tip

If you are not a tinkerer, and simply desire something that "works", the closed-source Gen 3 PCB build may be for you.

Deciding on Stock Wiring vs Custom Wiring

I decided on Stock Wiring for my first build, not knowing quite what I was getting into.

It was quite easy and straight forward. The Wiring section of the documentation comes with its own schematics for both HV (High Voltage) and LV (Low Voltage) wiring.

If I ever do a round 2 of the build, I will opt for the custom harness now that I know what is involved. It will have a cleaner look, and create more room in the casing.

Ordering from AliExpress

Parts required and their AliExpress links are offered on the project's Bill of Materials.

Assembling the cart in AliExpress was time-consuming. The links refer to the general AliExpress product page, but it is up to you to select the correct options.

One mistake I made was with the Arduino Nano Expansion board. I accidentally ordered the blue one (default), instead of the green one.

tip

Take extra care when ordering from AliExpress, it is easy to make the wrong selections on its clunky user interface. Especially when one item has many options and variations.

My order took a couple weeks to arrive, oftentimes at odd hours and in one envelope per item fashion.

AliExpress has many oddities during the ordering process, but it is no doubt one of the cheapest ways to procure parts.

Double check your packages and match them with your order status on AliExpress. There will be a tracking number on the envelope/package you can match with your order online.

This is very manual work, and a spreadsheet may come in handy to ensure you received all the items you ordered.

Due to the nature of receiving gargantuan amounts of e-mail spam from AliExpress, receiving one-envelope per item, and AliExpress depending on you to confirm delivery - it may not be immediately obvious if you have received everything.

In my case, I was never sent the 100pcs for the Clamps set I ordered. This was necessary to attach the silicone hose modification. Luckily I had an extra set I forgot about in my garage. I notified AliExpress that my item was never received, but I never got a follow-up. Shady, but the price we pay for cheap.

3D Printed Parts

Initially I thought it would be easy to visit my local makerspace and have them help me procure the housings and 3D printed components.

After visiting, I realized it would be very time consuming and would likely not have been satisfactory the first round.

I would have needed to drive over before they closed so I could start my printing and let it run overnight.

Lacking 3D printing experience, I would have needed to assume they set up and calibrated the machines correctly and according to the recommendations by the authors.

It was easy to imagine them tiring of me after the first round and asking them to do it again, and to modify the printer settings.

Then I would have to drive back and forth several times, picking up and confirming quality for each part.

This entire process would have cost me at least a week or two.

Alternatives?

  • Buy a 3D printer
  • Order from the official vendor

I chose the latter. I decided learning about 3D printing was a task better suited for later in life.

The package came delivered in a box with each component, including the portion of printing filament used to act as a hinge for the Nextion screen housing.

One part that I neglected was a small piece for holding the 5v breadboard inside the main microcontroller housing. It came separate in a tiny bag and I simply did not inventory it.

It did not end up in my final build, but proved non essential.

Inventory and Workspace

Conducting an inventory before beginning the build is a great way to make sure things go smoothly. It also marks a milestone in your build.

The way I did this was lay everything out on a table. Components in static bags were labeled with a sharpie.

Wire bundles were grouped by color and size.

3D Printed parts were grouped in another section.

Hardware and tools required were in another. I will not go into great detail on tools required for the project, as it should be relatively obvious to those who have experience soldering and working with electronics. And if you don't - well you will learn by doing it anyway. I will say a quality wire stripper, a mm ruler (for measuring wire lengths), and a "helping hands" tool are all quite useful.

I printed out the schematic, but also set up a laptop so I could reference back to the documentation and pictures.

Finally, I made my last cup of espresso from the stock Gaggia Classic, took a deep breath, and began.

Starting the Build

The source of truth for our build is the schematic. Everything else in the docs is just tips or clarification. When in doubt, refer to the schematic.

It is important to note there is more than one schematic in any given build:

  • There is your main schematic for the microcontroller and components (depending on your build - LEGO vs PCB)
  • There is a HV (high voltage) wiring schematic
  • There is a LV (low voltage) wiring schematic

The natural process is to assemble our microcontroller, components, and housing. Then wire up the High Voltage connections. And finally wire up the Low Voltage connections.

Three Mistakes

Nothing is truly broken if it is fixable, right?

Mistake #1: The Expansion Board

I did receive an expansion board from AliExpress, just not the correct one. I received a blue one instead of a green one.

The difference is the way these boards are grounded. The blue one is grounded in a non-standard way and requires modification if you accidentally ordered it like me.

The modification is described in "Expansion Board Compatibility" in the LEGO Build guide

It involves cutting the internal copper layer that acts as the ground plane in the board, and using a multimeter to confirm the two opposing GND pins are not connected.

I used a utility knife with a new razor, and a straight-edge guide to make my cuts. After using a multimeter to confirm lack of continuity, I then used liquid electrical tape to seal the cuts to ensure a separation.

tip

To avoid this extra work, double and then triple check your AliExpress carts before ordering.

Mistake #2: Overheating the Thermocouple

One of the first steps is to remove the pins from the thermocouple and dimmer interface boards.

My soldering skills are not quite A+, and I ended up overheating the pin connections and caused them to separate away from the board.

The end result? An unsolderable pin connection - there was nothing for solder to stick to.

The solution? Paid about 5x the cost for a new interface on Amazon for a next-day delivery.

tip

Take your time soldering. Use a wick or solder sucker, use a tinning compound, use a spade tip. All make for a cleaner, better job.

Once your project is complete and the machine is acting funny, you do not want to question which solder connection might be loose or short-circuiting.

Mistake #3: Not using the 3D printed housing for the 5V stripboard.

The sparse documentation for the 3D printed parts may make it easy to think you have everything.

This was my issue. I did not realize there was a small 3D printed part to house the 5V stripboard inside the main housing.

This ended up being a non-issue. The stripboard is still held in place by natural barriers inside the housing.

tip

Ensure you have a good idea of how the 3D printed parts fit together by first: inventorying all the parts and second: cold assemblying them.

As the documentation will assume that as a child you were good at LEGOs

The "optional" ADS 5V pull-up

The ADS board is an analog-to-digital converter interface, which is used to convert the analog signal from the pressure transducer to a digital signal the microcontroller can read.

It has 4 inputs. By only utilizing 1 input, the theory is that the other 3 are vulnerable to noise.

By connecting a constant 5V to the 3 extra inputs, a cleaner signal is achieved, and digital output will be more consistent.

I recommend doing this "optional" step, as we are now controlling all 4 inputs to the interface.

If your discord search-foo is good, you may be able to find more anecdotes on this optional step on the official discord.

Flashing the MCU and Display

Flashing the STM32 Blackpill microcontroller unit and the Nextion display is the final step before we do our component test. (hooking everything up before wiring integration with the Gaggia to make sure it is working correctly)

This step is one of the more technical steps in the build. And understandably one that many get caught up on. I will offer a bit more detail and guidance in this section.

Blackpill MCU

Flashing the Blackpill with the latest Gen 2 build requires the following:

  • The STM32 Blackpill - the microcontroller itself
  • A mini debugger - a device used to connect, read, and write to the MCU via USB
  • Visual Studio Code - a development environment used to build the software
  • Platform IO - a VS Code plugin for embedded software development
  • GIT - a source control software used to pull the latest codebase from the Gaggiuino repository
  • STM32 Cube Programmer - official software for programming the Blackpill

The rest of the steps are done using Platform IO. It will automatically import and setup the project once it is cloned from GIT.

tip

It is essential that you are on the correct GIT branch. Which, at this time of writing, is neglected in the video provided in the official documentation.

For Generation 2, you must select the release/stm32-blackpill branch in VS Studio / Platform IO before building and uploading.

Cloning and importing may take some time. VS Studio and Platform IO may need to be updated multiple times.

In my case, I needed to start from scratch and re-import the project - as I had tried to build it without updating first, and without enough disk space. After failing, it left a stale build directory that I needed to remove and restart the process after clearing up space.

tip

Let VS Studio and Platform IO fully update before cloning and importing the Gaggiuino project.

And ensure you have enough disk space before building and uploading.

Once the project is correctly imported, and on the correct branch, Platform IO will offer a number of scripts for building and uploading.

Since I am doing the stock LEGO build without the added hardware scales accessory - I chose the lego-forced-predictive-stlink task directory.

Run the build script, connect to the STM32 via the minidebugger via usb, then run the upload script. After many log messages, we are presented with a SUCCESS message.

note

I was able to complete this step using a Chromebook with the Linux subsystem installed. All the software above was installed on the Linux subsystem. USB access was provided to the subsystem, and everything worked perfectly (after I resolved the low disk space issue)

This was NOT the case for flashing the Nextion display. See next section for details.

Nextion Display

Flashing the Nextion Display is a little less technical, but much more picky.

To complete this step I needed to format my microSD card on a Windows operating system. Formatting to FAT32 on my Fedora or other Linux installations did not work. The Nextion Display would hang while flashing, offering no errors or decipherable messages. This is likely due to default FAT32 variables each system uses, something that I did not investigate deeper into.

The official Nextion flashing guide also explicitly says to flash under Windows.

Once I formatted on the Windows system, the Nextion Display could read from the microSD card and flash correctly. It offered a % complete for flashing and was clear it flashed successfully.

Component Test

The component test is another milestone in the build. It is the point where we can safetly say "The system boots up normally."

The system will be powered on with the interfaces, sensors, relay, and screen components connected.

And obviously the Gaggia switches will be disconnected, the thermocouple will not be sensing temperature in the boiler, the pressure transducer will not be experiencing water pressure, and the relay will not be outputting voltage to a pump.

Good signs from a successful component test are:

  • A build number displayed during boot
  • A relay click and light signal.
  • Temperature reading that changes when heat is applied to the thermocouple
  • A pressure value of 0.0
  • A temperature target in the 90s.

It is not necessarily a sign that I soldered and connected everything perfectly, but it is a good sign nevertheless.

Wiring Integration

The stock wiring integration is relatively straightforward. Two schematics are provided, one for high voltage (to be done first), and one for low voltage.

The Gaggia should be disassembled to make this go smoothly. Connections to the pump and to the boiler are in places hands do not fit when it is in its assembled state.

The boiler can be disassembled from 4 screws at the bottom reverse side near the group head. At this point, the steam wand can be removed and put aside as well.

The pump is held in place by a couple of screws at the bottom of the chamber, which will require a long philips to remove.

The wire lengths specified in the docs were more than generous in my experience.

tip
  • Use small zip ties to keep things organized
  • Try to keep wires from touching the boiler, use silicone tape if it is inevitable.
  • Keep high voltage AC wires away from low voltage wires. They can introduce noise / phantom voltage to digital signals.
  • Keep the area above the water hole clear, as the funnel will need to be able to be placed and removed without entangling or pulling on wires.

Some additional creativity may be needed for organization using the Stock Wiring. In my case, I noticed Gaggia had used some 3M tape wire anchors stuck on the inside of the case. I wish I had some more of those to keep things routed around the perimeter neatly.

Pressure Transducer

The Wiring Integration documentation also covers assembling the barbed 3-way tee, hoses, clamps, and the pressure transducer.

Hose and Tee sizes

I found that the hose options slightly differ in size on AliExpress. Some are advertised as both 1/4 and 6mm. As us observant people should know: these values are close, but not the same. And any tinkerer should know what happens when you flub steps like these.

In my case, I had ordered a silicone hose that did have a bigger inner diameter closer to 1/4 in.

Additionally, I had failed to order the right brass tee part due to the wrong option selected on AliExpress (again, triple check your order)

This conundrum ended up resolving itself as I had located a barbed brass tee combo pack at my local auto parts store (AutoZone). It included a 1/4 brass barbed tee, which worked well with the slightly larger silicone hose.

Here are some tips on the assembly:

tip
  • The hose should be pushed past all the barbs on the tee.
  • Warming up the silicone hose in hot water can help make it more flexible when pushing it on.
  • Do NOT clamp the hose until you have positioned the pressure transducer correctly - see below ( clamps can be placed around the hose but not "clamped" yet )
  • Consider using Worm Gear hose clamps instead of the Ear clamps, to make loosening or disassembly possible without destroying the clamp.
warning

Positioning is important:

  • Ensure the hose connection going toward the pressure transducer is pointed downward to avoid trapped air bubbles which will interfere with pressure sensing.
  • Ensure the pressure transducer is positioned at the very bottom of the case.
  • This way any air bubbles should find their way out of the system and pressure sensing will be accurate.

In my case, I had clamped the tee before positioning, and required some fandangling to ensure the hose had a downward position.

In hindsight, I wondered if a different tee connection would be better here, one with a 45 or 90 deg angle to ensure the downward trajectory.

Final Assembly

The final assembly involved strategic positioning of the microcontroller casing, ensuring high voltage and low voltage wires were separated and routed away from the boiler, and a bit of fandangling of the display screen's 3D printed casing.

I positioned the microcontroller+component vertically on the right wall of the chamber. This allowed me to route the high voltage pump and relay wires far away from the low voltage sensor, switch, and display wires. It also allowed the necessary room for the water funnel to be positioned, which is quite important if you want to refill the water reservoir and not make a mess!

The 3D printed casing for the Nextion Display was a bit of a conundrum for me. The routing of the cable through the backside of the casing is positioned in a strange place, not quite close to where the connection is at the end of the display board. This required me to fold the ribbon cable in a tight area in order to make the connection - which I was uncomfortable doing as tight folds of wires are not preferrable.

The hinge function of the display is, by the documentation, made with a piece of 3D Printer filament acting as the rod (with the ends melted to secure it). This seemed a bit too flimsy and permanent to me, so I used some spare machine screws along with nuts to make a more robust hinge - one that also keeps its position and doesn't let the screen fall over.

First Use and Tinkering

The machine powered on, the relay clicking to release pressure, and the loading screen displaying with the version number.

Soon I was met with the UI displaying temperature, pressure, and various configurations.

I immediately found the touchscreen quite unusuable with my not-so-nimble fingers, often hitting the wrong UI elements or not registering at all.

These are issues I have with all touchscreens, so I will not place blame on specifically the Gagguino here, but rather our lack of progress in the haptic feedback field.

I found the eraser at the end of a pencil quite a useful tool to manipluate the resistive screen interface instead.

First Shots

Being a day-one home barista, I dived into pulling shots with very little knowledge. Bitter and sour shots abound, 4-5 a day. My body was met with an abrupt spike in caffeine. Such is the cost of knowledge.

I found the default profiles to miss the mark with my setup and technique. They were all based on flow rate (ml/s), which is fine, but all sources of information I have found on pulling good shots have used pressure (bar) as the main metric.

Using dark roasts such as Pete's Coffee Major Dickasons or Kirkland's Espresso Blend, I found a 40g dose at 93C with a pre-infusion to 1.8 bar, a ~5 sec soak, a 10-13 sec "transition" at 9.5 - 9.0 bar, and a "profile" of 9.0 bar to 3.0 bar over 10-13 seconds to work well and give a shot that is neither sour nor bitter, but also conveys some natural sweet flavours.

I found that pre-infusion and a soak will make for a smoother shot. A high pressure initial profile will lessen sour notes from 1-15 sec, and 15+ sec a taper off to low pressure will lessen bitter aftertastes.

Tinkering

A couple issues revealed themselves after some weeks of usage.

One was that sometimes the machine would not start-up correctly. A version number was lacking on the loading screen, and I noticed the pressure metric never changed. This told me there was a sensor issue. Opening the machine back up and ensuring good connections and wire placement away from high voltage sources seems to have fixed the issue.

The other, which is yet unsolved, is that sometimes upon starting a shot the pump will begin at 100% for about 1-2 seconds, abruptly stop, and then seem to skip the pre infusion, soak, and transition phases and go straight to the profile. I have learned an interem remedy is that when I hear the pump at 100% immediately, I will flip the switch back up to stop the shot, wait a moment, then flip it again to restart it.

Some upgrades on my equipment and technique also have revealed necessetation!

  • The portafilter basket to an IMS "Nanotech" double
  • A manual grinder. The 1Zpresso K-Ultra works well for me. I keep it around a 2.5 setting. The hex nut on top also allows a drill attachment to make things less manual - though in my experience it produces a different grind - possibly one with less fines as the shot will be pulled a bit faster.
  • A 58.3 tamper with a 30lb spring. I modified this tamper by adding a couple washers. This allowed me to tamp fully down but also be able to rotate and "swirl" the grounds. Perhaps unorthodox, but it allowed me to get a good tamp. Whereas before the rim contact would prevent the aforementioned.
  • A new Group Head Screen. The stock one on my Gaggia seemed to invert itself on occasion, possibly due to an uneven cup like shape instead of being flat. The result was water leaking from the sides and preventing a good "shower" until it was cleaned, re-bent, and re-attached. A new 55 mm was ordered and works perfectly - no tinkering needed.

Final words

It has been very enjoyable and fun to learn more about coffee and microcontrollers through this project, and look forward to using it for years to come.

Ideas for the future:

  • Implementing the scales for more accurate shots
  • Forking Gen 2 and studying the code, in the spirit of open-source
  • Brainstorm ways to make a mobile espresso machine ( for traveling with in a vehicle )