Gaggia Baby Twin front panel protocol

I recently got (and fixed) a broken Baby Twin off ebay. I want to experiment with the extra boiler. Anyway, it turns out the Twin talks to its front panel using a TWI based protocol. Here are my notes (which I made in an ASCII editor – enjoy the ASCII graphics and sorry about the scroll bar at the bottom):

A 14 wire ribbon cable connects the front panel to the controller
board. If we number the wires from 1 to 14, starting at the red end,
then the connector on the board alternates sides:

14  12  10   8   6   4   2
 |   |   |   |   |   |   |
-----------------------------
|                           ]
|                          |
|                           ]
-----------------------------
   |   |   |   |   |   |   |
  13  11   9   7   5   3   1

I am pretty sure the connector is from te (Tycho Electronics) and the
ribbon cable part number is 1-215083-4 or 8-215083-4 (same part but one
comes in boxes and the other on reels).

My best guess is that the controller board has two interfaces on this
cable, one for the Twin and one for the Dose. For the Twin, it is a
TWI interface and for the Dose it is a simple set of lines to LEDs and
switches. The only pins that seem to make any difference for the Twin
are:

1  VCC
9  SDA
7  Button touch notification
11 SCL
14 GND

The front panel pulls pins 9 (SDA), 11 (SCL) and 7 high. When a button
is touched or released, pin 7 pulses low for 50us. This could be used
to respond or you can you poll regularly.

In addition, the controller board pulls the following high: 2, 4, 6,
8, 10. And 3 and 5 are high impedence. And 12 is low or high impedence
(can't remember). None of these are relevant to the Twin front panel.

The controller polls the front panel periodically with the following
protocol:

Poll rate: normally every 48ms. When a button is being touched,
  continuously.
SCL clock speed: 62500Hz.

At each poll, the controller writes the LED state and then reads the
buttons.

To write: write two bytes, the first is address and the second is
value.

To read: write one byte (address) and read one byte (value).

The front panel only responds to the general call TWI address 0.
The address of the LEDs is 0x00 and the address of the buttons is
0x01.

So on the TWI bus, you see:
START, address packet to 0 and W = 0x00, 2 data packets: 0x00, CODE1, STOP,
START, address packet to 0 and W = 0x00, 1 data packets: 0x01, STOP,
START, address packet to 0 and R = 0x01, 1 data packets: CODE2, STOP.

CODE1 is a six bit bitmask plus two parity bits:

| 7        | 6        | 5           | 4         | 3         | 2          | 1         | 0         |
| Parity 1 | Parity 0 | Element LED | Steam LED | Water LED | Manual LED | 2 cup LED | 1 cup LED |

Parity 1 is bit3 XOR bit4 XOR bit5.
Parity 0 is bit0 XOR bit1 XOR bit2.

CODE2 is a pair of 4 bit nibbles where high nibble = 1s complement of
low nibble. Low nibble is a 4 bit bitmask indicating which button is
touched:

| 3     | 2      | 1     | 0     |
| Water | Manual | 2 cup | 1 cup |

Note: if more than one button is touched, this is invalid and
code2 = 0xf0.

 

5 thoughts on “Gaggia Baby Twin front panel protocol

  1. Hi Tom,

    I came across your blog about your Gaggia Baby Twin in my initial research to fix mine. I wanted to ask if you had some helpful insight (or access to useful service manuals beyond a simple one page electrical diagram and a simple one page hydraulics diagram I managed to find on the internet).

    Mine has developed a problem with the front circular control panel. When I power it on with the rear power switch, all the buttons light up momentary and then go 100% dark and unresponsive.. The rest of the machine functions. When I press the rear power button, I can hear the power relay click on. The boiler still heats. And I get hot water/steam via the steam valve on top.

    This all began after I took the boiler solenoid apart to unclog it. The unclogging was successful. I even operated the Gaggia Baby twin without the top on by operating the then functioning front control panel/top laid on its side next to the machine. I powered it down and reassembled everything, only to find that the front control would just turn on momentarily.and then would be 100% dark and unresponsive after.

    I’ve since taken the top off again and visually checked everything. I don’t see anything abnormal with a quick look. I’ve verified the cable connectivity. Its either the front panel or the circuit board. And with the age of the machine, spare parts are impossible to find.

    Thanks

    J

    • It doesn’t sound like you have done much that would damage either of the boards. The front panel board is obviously powered and apparently initialising successfully. So I think it is probably fine. The clicking of the relay (which mine also does) suggests there is also life in the controller board.

      My first guess is either that one of the ribbon cable connectors is making a poor connection with the cable or that there is water condensation on one of the boards. If you are really unlucky the latter could result in the main controller board being damaged but as I say, I think this is less likely.

      Try removing the ribbon cable and pressing the connector together firmly (without breaking the little tab on the side!). On mine I had variable behaviour in front the front panel and I eventually replaced the whole connector, The replacement is pretty standard and was easy enough to source.

      Also take the main board out and make sure it is dry all over. Use warm air (e.g. hairdyer from a distance) to make sure it is dry. Do the same as much as you can with the front panel board. Although I can’t remember how easy that one is to get out – it might not even be possible.

      If by some chance you have access to an oscilloscope, we could look further to see whether the right signals are going between the two boards.

  2. Thanks for your quick reply Tom. I think I’ve found the problem with my Gaggia Baby Twin which is consistent with your comments. The issue is either at the connector on the 14 pin ribbon cable or the matching SMD connector on the control board

    I’m going to get extra parts, first trying a change of the cable/connector and if that doesn’t 100% eliminate the problem, changing the SMD connector on the control board.

    I fiddled with all the front panel/control board connectors/cable and eventually found a scenario where I could reliably get things to work. The cable connector at the control board 100% works if not fully seated, but at a slight angle with the top out a bit. I even cleaned the connector and cable end with electrical contact cleaner.. So there’s a bad connection there.

    Thanks again

  3. Hi Tom, awesome article and research!

    I have Gaggia Baby Class D 2006 with exactly the same front panel with touch buttons. I have modded my machine with the Gaggiuino mod, which is originally developed for Gaggia Classic but it also works with Gaggia Baby due to the similar / identical mechanics.

    In order to make the most out of the mod, I need to find a way to trigger the manual brew button of the Gaggia Baby with a relay. Here’s an example diagram how it looks like with a mechanical switch of Gaggia Classic – https://user-images.githubusercontent.com/80347096/191401329-cdcc0a6a-b414-4c01-bbc8-07d16a5a4282.png .

    Due to the communication protocol and the ribbon cable I cannot easily do the same for the touch buttons of the Gaggia Baby. So maybe you know – is it possible to trigger the manual brew button with a relay? Alternatively is is possible to bypass the board and just power the solenoid and pump with 220V to “simulate” the same brewing behaviour?

    Thank you in advance!

    • Hi Dee.

      I am possibly a bit unclear as to what you are asking but I think it is this… In the diagram you linked, I see the switch block from a Gaggia Classic being used as an input to one pin of a microcontroller which is also driving a relay with another pin. I think you want to be able to use the touch button panel on your Gaggia Baby instead of the Gaggia Classic switch block.

      This post does provide information to help answer this question. You need to connect pins 1 and 14 to 5V and GND respectively and pins 9 and 11 to the microcontroller’s TWI (AKA I2C) interface pins. Then the Gaggiuino firmware needs modifying to poll the TWI interface periodically to test whether the brew button is being touched. If you google for Arduino and TWI you should be able to find info about programming TWI. And the protocol described in this post should tell you what needs to be sent and received over TWI. Rereading it myself it is clear to me that I knew more about how TWI works when I wrote it than what I remember now! But the information is very much available. IIRC the Atmel documentation is very helpful.

      I think there should be people on the Gaggiuino discord server who could help more with exactly how achieve all this on the Gaggiuino. You can also find me hanging around the on Gaggiuino discord server (@tombrazier#4459) and I would happily join in a conversation there with someone who knows Gaggiuino better than I do.

Leave a Reply

Your email address will not be published. Required fields are marked *