Turning cisco switches into cocktail machines



Watch a video of the build process on youtube



I currently do have two transformed switches in use. With a total of 24 pumps.
Cisco switches because:

a) needed to justify to Judith that having them around is smart
b) they do contain pretty beefy power supplies
c) they can each fit 12 pumps + electronics and have 24 ports, 12 for 'in' and 12 for 'out'
d) I liked the idea of building units that you can chain together

The pumps


24 pumps may sound a lot, but is required to have fun.
One pump in itself is pretty slow. They can deliver roughly 1ml per second.
So running them in parallel (set 4 pumps to run orange juice) is required to have a decent experience.
I was pretty amazed by those cheap peristaltic pumps. They just squeeze the tubes to transport the liquid, so only food grade tubing is required to build something that won't kill your friends.
It makes it easy to clean and also easy to explain why it is clean.
My biggest surprise was how accurate those pumps are for my use. I can mix you a cocktail into a 40ml double shot glass.
The code does contain an array called: pump_factors, but all are set to 1 as I found no noticeable difference between them.





other electronics:


16 port relay card
12 are in use
the pumps are on 12v, logic runs on 5v, + it gives you a nice 5v output as bonus.

Arduino Nano
basically only starts and stops pumps
gets its commands via i2c

Wemos lolin esp32 lite
runs a static webpage with some ugly javascript
receives commands via web and tells the local nano (or chained system) which pumps to enable

The esp32 board runs on 3 volt logic and the nano takes 5 volt. So a converter was used to run the i2c bus on 5 volt.
some web browser
display the UI
the localStorage is used to have a mapping from ingredient to pump
{p1: 'vodka', p2: 'gin', p3: 'orange_juice', ...}



You store in the browser which pumps are connected to which liquid. You make this mapping at the start of your party.
Then some default cocktails will appear based on the available ingredients.
You can add more recipes and store them in your local storage.
When you order a tequila sunrise, your browser knows:
pump 3,4,14,15 are connected to orange juice
pump 6 is connected to tequila
and pump 19 is connected to grenadine
If you want 180ml orange juice mixed with 30ml tequila and as a finish 5ml grenadine on top, then the browser would tell the esp basically this:
[{p3: 45, p4: 45, p14: 45, p15 45, p6: 30},{p19: 5}]

The esp will then build a 'drop' sequence to mix the juice and alcohol.
/* fill an array of given size 'evenly' with values */
void get_sequence(unsigned int result[],int boxes, int cats){
  float cats_per_box = (float)cats / boxes;
  int index = 0;
  float stored_cats = 0;
  int full_cats = 0;
  while (index < boxes) {
      stored_cats += cats_per_box;
      int schroedinger_cat = (int) round(stored_cats - full_cats);
      full_cats += schroedinger_cat;
      result[index++] = schroedinger_cat;
  }
}

// gets called like this in the code:
...
/* evenly distribute the ml per max_ml
 this leads to mixing the liquids as good as possible */
for(int i = 0; i < max_pump; i++){
	get_sequence(pump_commands[i], max_ml, data[i]);
}
...
You would observe a constant flow of orange juice running, with a drop of tequila getting added every now and then.
As you can have multipe of those sequences after each other, the 5ml finishing drop of grenadine is possible.

The esp does the mixing and then tells the nano(s) which pumps to start or to stop.


Some pictures

At the company party:

Head of QA is QAing.

24 pumps in use

dispensing beauty

Head of engagement is engaged.

Sales department did send representative for testing.

In action at the Cccamp2019. Attracting a real cyborg.

Both units, still a bit camp dust on top.

My first cocktail mixer, stuffed into a book and an whiskey casing.


Talk to me


IT-Dienstleistungen Sven Tantau
Drostestrasse 3
53819 Neunkirchen
Germany
USt-Id-Nr.: DE203610693
web:

email: sven@beastiebytes.com
skype: sven2342
phone: +49 22 47 90 80 250
mobile/signal: +49 157 3131 4424
xing

OTR-Fingerprint: 7849BD93B65F9E4BC1206B06C09B7445721063BC
GPG/PGP-Key: (pub 4096R/069DD13C 2014-02-13) local copy pgp.mit.edu
GPG/PGP-Key: fingerprint: 9BAD 94D3 9176 5BD1 F64F 542E 37E4 3542 069D D13C