# Gaggia Classic Scales Mod - Integrated Drip Tray Volumetrics (well kinda...)



## mcrmfc (Sep 17, 2016)

Hi All,

It bugged me that I couldn't find any scales mods out there as I really like using weight as my constant target variable and adjusting everything around this.

So I hacked together something for my classic.

It's ugly as sin and the video is terrible but you get the gist.

Adapted some 3 quid ebay scales with an analogue to digital converter, hooked up to 8 quid arduino switching pump circuit via an SSR.






I hope to tidy everything up over the coming weeks and will post an update when I have done so.

Nothing clever in code or electronics...but good clean fun!

Matt.

Update:

Since a couple of you asked for more details about what's going on, here's the story so far - please don't feel obliged to read this, it will get pretty geeky.

Usual disclaimer - I know very little about electronics, please do not take my advice as accurate, coffee machines run at mains voltage and can kill. Even when everything is wired up and ready to go I still use an RCD adaptor just to be extra safe (https://www.amazon.co.uk/gp/product/B000RZDNZM/ref=oh_aui_detailpage_o07_s00)

1. Scales

At first I was thinking about USB scales as they easily interface to a small programmable computer e.g. Raspberry Pi, but they are all postal based things and way too big for our needs. Then I read some blogs that claimed it was fairly simple to strip the load cell bits out of any scales and hook them up to a chip that can do the analogue to digital conversion and then of course you need something on the software side.

I used these from good old ebay:

http://www.ebay.co.uk/itm/361579373883









For some reason they have gone up 2 quid since I bought them a month or so ago (they cost me £2.89). I ripped all the build in electronics out so I was just left with the load cell (the weighing bit) and 4 wires.

Then I purchased a chip known as a HX711 which does the analogue to digital conversion (£3.19).

http://http://www.ebay.co.uk/itm/111970281034

http://www.ebay.co.uk/itm/111970281034









2. Arduino

I started using a Raspberry Pi but it turns out that for a couple of reasons that wasn't a great choice:

i) Because it's running a full operating system and getting interrupts all over the place accurate interface to analogue device such as HX711 can be a bit hit and miss especially coding in a high level language.

ii) The 3.3v pins on the Pi can't reliably switch an SSR (despite the spec of the SSR suggesting it should be possible).

So I switched to an arduino, they again are dead cheap - I got this one, abot 8 quid.

https://www.amazon.co.uk/Sintron-ATMEGA328P-Cable-Reference-Arduinos/dp/B00CGU1VOG/ref=sr_1_1









(You can later replace this with the tiny Arduino which you can pick up for around a quid)

3. SSR

You will probably be familiar with these if you use a PID, essentially it's a switch that can be triggered from low voltage signals and then switch mains voltage. This is used in the pump circuit to be able to switch it on and off using our arduino.

I used this one http://www.ebay.co.uk/itm/252599211929









Bear in mind that most of the SSRs sold on ebay are fake and although they work are potentially very dangerous (can actually only cope with half the advertised current). Again see disclaimer and never ever leave a machine on for extended periods with these SSRs in place.

4. LCD

Simple lcd that requires no soldering and easily interfaces to Arduino, I used this one.

https://www.amazon.co.uk/gp/product/B01GPUMP9C/ref=oh_aui_detailpage_o02_s00









5. Software

My code is incredibly simple and crude at the moment:

https://gist.github.com/mcrmfc/8f724d9891c0d4d5abc8a38fb37f87ad

Of course I am not clever enough to write the code to read the scales so we just use an existing library for this:

https://github.com/bogde/HX711

Essentially the logic is:

i) calibrate scale

ii) when button is pressed tare the scale and trigger ssr to start pump (also start a timer)

iii) loop continually reading the weight and incrementing our timer

iv) when we hit our target weight trigger the ssr to stop pump

That's pretty much it.

Sounds more complicated than it really is and feel free to shout if you want any more info!


----------



## jimbojohn55 (Jan 15, 2016)

now that has great potential - would be good to see a breakdown of components and how you went about it - impressive !!


----------



## Jon (Dec 3, 2010)

I'd love to do this!


----------



## timmyjj21 (May 10, 2015)

Yep, thats pretty awesome.

Ive been playing with volumetric and shot timer modules and now have 3 boxes attached to the side of my classic. Getting it simplified to do everything would be fantastic!


----------



## jimbojohn55 (Jan 15, 2016)

timmyjj21 said:


> Yep, thats pretty awesome.
> 
> Ive been playing with volumetric and shot timer modules and now have 3 boxes attached to the side of my classic. Getting it simplified to do everything would be fantastic!


get that into a single display box on the front of the machine and I would buy one - got to be cheaper than a descent espresso machine - then there is the Bluetooth app as well - kickstarter time !


----------



## Missy (Mar 9, 2016)

This looks really cool. Starting to wish I was vaguely technical now!


----------



## GCGlasgow (Jul 27, 2014)

Looks good, some potential for the next upgrade.


----------



## ronsil (Mar 8, 2012)

Now that looks a really good mod for the Classic.

Combined with Mr Shades PID mod it could really develop the full potential of the Machine.


----------



## Khashy (Mar 10, 2015)

+1 to this, I'd love to implement this


----------



## Rhys (Dec 21, 2014)

That's great, a but Heath Robinson looking but certainly works well. You just need a OPV pipe to stop water splashing everywhere when it dumps









Lots of potential for a cheap, consistent machine.

Wondering about another Classic mod.. (shame I sold mine) that could be done. A solenoid from the pump outlet to a needle valve to restrict the flow of water, coupled to a switch on the front. That way you cold pre-infuse with a constant low flow rate until the puck is fully saturated then switch to full flow rate for extraction. You could then maybe switch back to the low flow rate for a declining profile. Now I'm wondering if this has been done before














For some reason I've got the song '





' going round in my head..









At this rate you'd need two Classics fastened together just t have enough room inside to put all of the gubbins.


----------



## Missy (Mar 9, 2016)

Rhys said:


> Wondering about another Classic mod.. (shame I sold mine)
> 
> At this rate you'd need two Classics fastened together


As someone selling a classic. I agree wholeheartedly!


----------



## mcrmfc (Sep 17, 2016)

Thanks for all the comments guys.

I have updated the original post with some more info for those that asked (very geeky so be warned).

I was heavily inspired by this project: http://int03.co.uk/blog/project-coffee-espiresso-machine/

Way way more clever than anything I did but fascinating and good inspiration.

Also thanks to @MrShades as his shot timer project got me started thinking about all this. His PID is awesome and I plan to keep that as doubt anything in software will be as good.

I will add a flow meter at some point just for the extra info.

It's all very hacky at the moment as I don't get much time to worry about UX inbetween work, family etc!


----------



## Khashy (Mar 10, 2015)

Thank you for this @mcrmfc, fantastic inspiration.

A while ago I remember seeing someone had wired the scales through to a dimmer switch to vary pump pressure. I really wanted to do something like it but did not know how to.

Not only what you have done here is really fantastic, but I think it opens the way for a lot of other things.

Thank you again.

K.


----------



## Khashy (Mar 10, 2015)

Hey @mcrmfc, would you be able to share what you connected the SSR to (diagram or a photo would be great)?

I presume the way you have hooked it up, the solenoid kicks in after the shot has ended, right?

thanks


----------



## mcrmfc (Sep 17, 2016)

Hi Khashy so i placed the ssr at exaclty the same point in the pump circuit as MrShades positioned his shot timer and all of thr pics of that can be found here:

http://coffeeforums.co.uk/showthread.php?t=21171

It seems to be ok, although a couple of times i have noticed that the pump has made a weird noise and water comes out of the solenoid all the time i.e. it's deenergised. This might be due to some dodgy connections on my side as I am just using jumper cables at the moment.

Sorry that's not a great deal of help, i need to do some more research on the best place to position the relay in the circuit.

If anyone has any advice please do chip in!


----------



## timmyjj21 (May 10, 2015)

Sounds like a dodgy connection. My shot timer has been rock solid and it's wiring position working perfectly for over a year.


----------



## Khashy (Mar 10, 2015)

Thanks @mcrmfc, @timmyjj21 I take it you have the SSR wired to the same location?

thanks.


----------



## timmyjj21 (May 10, 2015)

I have my shot timer wired up as per MrShades instructions. The shot timer doesn't utilise an SSR, but has an internal relay, so basically the same...

The shot timer is wired up so the internal relay is closed when you flick the brew button. When you energise the SSR it will be closed too, so the function should be identical.

If there is any glitch in the circuit I would be checking the wiring to ensure it is solid, or consider that you may have a fake Chinese Fotek SSR that is acting up. Personally, if you are using alligator clips that would be the main culprit!


----------



## mcrmfc (Sep 17, 2016)

timmyjj21 agreed think that's the issue, it's all going to get soldered with better guage wire shortly so that should fix it.

Like you say logically it's a relay like the timer so should be fine.


----------



## mcrmfc (Sep 17, 2016)

Ok quick update found a decent case on eBay, screw shield on arduino so no more loose connections and better guage cable all round.


----------



## Khashy (Mar 10, 2015)

I've ordered my arduino, waiting for the ssr and scales!


----------



## mcrmfc (Sep 17, 2016)

Awesome Khashy just shout if you need any pointers!


----------



## Khashy (Mar 10, 2015)

Definitely will @mcrmfc. The scales have arrived, ready to go. Need the rest of the stuff to arrive now.


----------



## gw368 (Aug 18, 2016)

Would be great to see someone work out how to do something like this to the Baratza Sette 270 (basically to make a homemade 270W). Baratza charging an extra £100 is absolute robbery just for adding the load cell.


----------



## destiny (Jun 4, 2015)

Mcrmfc, this is the kind of mod I was hoping to put in place instead of the flow control for shots.

Good job for getting it done, I will most likely lean on your discoveries here.

What did you use to calibrate the balance for Arduino? I assume the output is amplified already and this is what goes to your ADC board?


----------



## mcrmfc (Sep 17, 2016)

Hi destiny...yes so the hk711 does the load cell amplification and there are loads of libraries for arduino and a few for pi that will make interfacing this quite easy. To calibrate you just need something of a known weight, simple as that. Again Arduino might be more straightforward and reliable but i got it working with my pi as well using a python library on github.

Just let me know if you need any specific info, more than happy to help.


----------

