Our Barbot was born from our passion for creating gadgets with Arduino. We thought it would be fun to bring an out of the ordinary product to our YouTube Channel using the technology that Arduino offers us. Our Barbot is a connected object capable of preparing tasty drinks using a dashboard on Arduino IoT Cloud or using the MKR IoT Carrier as a remote-controlled controller to be placed on a table.
THE DASHBOARDThe dashboard of the barbot allows you to adjust the milliliters of liquid desired for each mixture. It is possible to select the size of the glass from a minimum of 0 to a maximum of 400 ml. Thanks to the Barbot Nano Carrier library it will be possible to take the current filling level of the glass and also show us its percentage. The green check mark indicates that the Barbot is ready to receive the start command.
REMOTE CONTROLUsing the Oplà IoT Kit we have introduced a sort of remote control to prepare the drink remotely, without the use of a mobile phone or PC.
Thanks to the gestures it is possible to change the drink to be customized by moving the hand from right to left or from left to right to browse the various levels available.
Using the touch button 1 or the touch button 4 it is possible to change the liquid level for each drink to be mixed.
The touch button 2 allows you to start mixing drinks based on the selected levels.
As also happens on the dashboard, the display and a led of the MKR IoT Carrier turn green or red according to the operations the Barbot is doing: if green is ready to accept a new job, if red is busy preparing a drink or not yet fully ready.
We have created a dedicated library for our barbot in order to guarantee less implementation in terms of codes for the user. The library consists of the barbot.cpp and barbot.h files which are already included in the codes on this page.
CODE TRICKS
To return the barbot to home it is possible to use this code in the setup:
// Inizialize barbot
barbotCarrier.begin();
// Barbot tower to home
bool home = false;
barbotCarrier.mixerTowerGoTop();
while (!home) {
home = barbotCarrier.mixerToTop();
}
barbotCarrier.mixerTowerStop();
PUMP ACTIVITY TIME: HOW DOES IT WORK?
Due to the lack of level sensors we have tried to find a way to transform the milliliters we set for each level into milliseconds of activity.
The formula we used is: 60 * milliliters / pump speed (lt/m).
To do this in the setup we must indicate how many liters the pump we use can move, in our case our diaphragm pumps have a flow rate of 2 liters every minute, so we set this parameter for all the pumps in the setup :
//Pumps setup ml/m
barbotCarrier.setPump1LitersOnMinute(2); //2lt/m
barbotCarrier.setPump2LitersOnMinute(2);
barbotCarrier.setPump3LitersOnMinute(2);
barbotCarrier.setPump4LitersOnMinute(2);
barbotCarrier.setPump5LitersOnMinute(2);
Then we set the milliliters for each drink to be mixed:
//Pumps setup
barbotCarrier.setPump1Milliliters(400); //for 400ml
barbotCarrier.setPump2Milliliters(400);
barbotCarrier.setPump3Milliliters(400);
barbotCarrier.setPump4Milliliters(400);
barbotCarrier.setPump5Milliliters(400);
We turn on the pumps with :
barbotCarrier.pumpWrite(PUMP1, HIGH);
barbotCarrier.pumpWrite(PUMP2, HIGH);
barbotCarrier.pumpWrite(PUMP3, HIGH);
barbotCarrier.pumpWrite(PUMP4, HIGH);
barbotCarrier.pumpWrite(PUMP5, HIGH);
We perform the power-up operation only once in the setup or by using a flag associated with a button.
In the loop we check the sleep timer with:
barbotCarrier.pumpTimerOff(PUMP1, 60 * (barbotCarrier.getPump1Milliliters() / barbotCarrier.getPump1LitersOnMinute()));
barbotCarrier.pumpTimerOff(PUMP2, 60 * (barbotCarrier.getPump2Milliliters() / barbotCarrier.getPump2LitersOnMinute()));
barbotCarrier.pumpTimerOff(PUMP3, 60 * (barbotCarrier.getPump3Milliliters() / barbotCarrier.getPump3LitersOnMinute()));
barbotCarrier.pumpTimerOff(PUMP4, 60 * (barbotCarrier.getPump4Milliliters() / barbotCarrier.getPump4LitersOnMinute()));
barbotCarrier.pumpTimerOff(PUMP5, 60 * (barbotCarrier.getPump5Milliliters() / barbotCarrier.getPump5LitersOnMinute()));
In our example that we have attached to this page (Barbot Firmware), a drink preparation routine has been created which starts from line 123 to line 175 and allows you to do the various operations at various instants using flags made up of boolean variables.
NOTE : This system obviously does not use level sensors and therefore could be unstable and react incorrectly with respect to the behavior we expect. We advise you to set the milliliters by under-sizing the values to have a minimum margin of error and thus prevent the spilled liquid from escaping from the container. We have set 140ml for a 200ml container!
DEMOHere a video demo:
Italian video (English subtitles available) :
Comments