Raspberry Pi Smart Cockailmachine

by LoewieNuytten in Circuits > Raspberry Pi

331 Views, 1 Favorites, 0 Comments

Raspberry Pi Smart Cockailmachine

cocktailmach.jpg

During my time at school, I had the exciting opportunity to create a cocktail machine using a Raspberry Pi. Combining my love for programming, electronics, and mixology, this project allowed me to merge technology and beverage craftsmanship.


As an aspiring engineer, I wanted a project that showcased my technical skills while also being practical and enjoyable. Inspired by automated bartending, I set out to design and build a Raspberry Pi-powered cocktail machine capable of mixing a variety of delicious beverages.


Throughout the development process, I encountered challenges, from designing the mechanics to programming the software. One major hurdle was creating a system that could accurately measure and dispense precise quantities of each ingredient, ensuring consistent taste and presentation. I also integrated sensors and actuators to create a user-friendly interface, allowing users to select their desired cocktail from a menu and witness the machine flawlessly execute the mixology process.


Experimenting with different cocktails was the most enjoyable part of this project. It was fascinating to see how the Raspberry Pi brought together my passion for technology and mixology, resulting in a unique creation that impressed both myself and my peers.

Supplies

  • Raspberry Pi
  • Assembled Pi T-Cobbler Plus
  • Wires
  • Breadboards
  • Breadboard power supply (5V)
  • Resistors (330 / 470 ohm)
  • 4x diodes

Sensors:

  • 4x water level sensors
  • 4x temperature sensors (DS18B20)
  • 1x ultrasonic sensor

Actuators:

  • 4x dosing pumps
  • 1x LCD screen (16x2)
  • 1x trimmer
  • 1x led
  • 1x button

Housing:

  • 4x waterhoses for pumps
  • 4x bottles
  • Wood

Tools:

  • Hand screw machine & screws
  • Hammer

Making the Housing

353007500_6223125137807289_4247194522262367131_n.jpg

For my Raspberry Pi-powered cocktail machine, I chose a simple and elegant white wooden box as its housing. This minimalist design provided a clean and modern aesthetic while ensuring durability. The dimensions of the box were carefully calculated to accommodate all the necessary components, including the Raspberry Pi, pumps, tubing, and ingredient containers. The sleek white wood added a touch of sophistication, making it an attractive centerpiece. By keeping the exterior unobtrusive, the focus remained on the captivating mixology process orchestrated by the Raspberry Pi. The white wooden box successfully blended aesthetics with functionality, providing a visually pleasing and robust enclosure for the cocktail machine.

Fritzing

breadboard schema3.png

The circuitry of my Raspberry Pi-powered cocktail machine featured four one-wire interfaces, four pumps, four water level sensors, a distance sensor for glass detection, and an LCD 16x2 display with PCF I2C. This setup allowed for precise ingredient dispensing, accurate liquid level monitoring, glass presence verification, and a user-friendly interface. The one-wire interfaces facilitated communication with the pumps, while the water level sensors ensured precise measurements. The distance sensor ensured that a glass was present before initiating the mixing process. The LCD display provided visual feedback and easy navigation through cocktail selections.

Database

database.translated.jpg

In my MySQL database, named 'projectone', I implemented several tables to support my Raspberry Pi project.

The 'Cocktails' table consisted of columns such as 'cocktail_id', 'naam' (name), 'instructies' (instructions), 'afbeelding' (image), and 'aantal' (quantity). This table stored information about various cocktails, including their unique identifiers, names, preparation instructions, associated images, and available quantities.

The 'CocktailIngredienten' table had columns such as 'combiId', 'cocktailId', 'ingredientId', and 'hoeveelheid' (quantity). It served as a junction table, linking cocktails with their corresponding ingredients based on their respective IDs. The 'hoeveelheid' column stored the quantity of each ingredient required for a specific cocktail.

The 'Ingrediƫnten' table contained columns such as 'IngredientId', 'naam' (name), 'categorie' (category), and 'pomp' (pump). This table stored information about individual ingredients, including their unique identifiers, names, categories, and the corresponding pump numbers.

Additionally, there was a 'Device' table that stored various device-related information for my project. The 'historiek' table had columns such as 'actiedatum' (action date), 'waarde' (value), 'commentaar' (comment), and 'deviceid'. This table was used to record the historical data related to the devices used in the project.

By utilizing these tables, the database provided an organized structure to manage and retrieve information related to cocktails, ingredients, devices, and historical data effectively.

Building the Circuit

fritzing.jpg

To create the circuitry for my Raspberry Pi cocktail machine, I connected various components using a combination of wiring, GPIO pins, and appropriate resistors. I ensured proper connections between the Raspberry Pi, one-wire interfaces, pumps, water level sensors, distance sensor, and LCD display. Additionally, I used appropriate power sources and implemented necessary safety measures such as fuses and grounding. This well-designed circuitry enabled seamless communication and control between the Raspberry Pi and the cocktail machine's components, ensuring precise ingredient measurements and smooth operation.

Coding (backend)

In the backend programming of my Raspberry Pi cocktail machine, I created a dynamic website that allowed users to interact with the machine. The website displayed a list of available cocktails retrieved from the MySQL database, including their names, instructions, images, and quantities. Users could select a cocktail and request it to be made using Socket.IO for real-time communication.

The backend was responsible for handling user requests, retrieving and updating cocktail data, and communicating with the Raspberry Pi. When a user selected a cocktail, the backend sent commands to the cocktail machine via Socket.IO, triggering the dispensing of the required ingredients in precise quantities.

Additionally, the backend provided functionality for users to add their own custom cocktails. Through the website, users could input the cocktail's details, including name, instructions, image, and ingredient quantities. These custom cocktails were stored in the MySQL database, expanding the selection available for future use.

By combining Socket.IO with backend programming and database integration, the Raspberry Pi cocktail machine offered a seamless and interactive experience, allowing users to explore and enjoy a variety of pre-existing and personalized cocktail options.

Frontend

website.png
website2.png

The frontend of my Raspberry Pi cocktail machine featured a clean and intuitive website design. The main color scheme revolved around a calming blue tone, providing a visually pleasing experience. The website's primary purpose was to enable users to easily select and create cocktails. Additionally, a graphical representation, such as a chart or graph, was implemented to display the number of cocktails made, allowing users to track their usage and explore their cocktail-making history.

Github Files

https://github.com/howest-mct/2022-2023-projectone-LoewieNuytten