Introduction: SmartBar Cocktails

In this instructable i'll help you make a smartbar. i made this project because i like to drink a cocktail and i wanted to automate the process.

Supplies

The supplies needed for this project are as followed:

At least

  • 1 Raspberry Pi
  • 1 SD card (16GB)
  • a few jumper wires
  • electrical tape
  • 2 sided sticky tape

Sensors

  • 1 LCD display
  • 1 RFID sensor
  • 1 magnetic contact sensor
  • 2 load sensores + HX711 chip

Actuators

  • 4 peristaltic pumps (12V)
  • 1 4-channel relay

My building materials

  • OSB wood 12mm
  • plexiglass
  • copper tube (1m)

Step 1: Setup

To get started we’ll first need to set up your Pi.

You'll need two things:

  • win32 Disk imager
  • Raspbian OS image

The installation

  1. Open win32 disk imager
  2. Select your image of the Rasbian OS
  3. Select your SD card
  4. Click on write

Before we can start coding we'll need to setup a few things on the pi.

  1. Go to the boot directory of the SD card
  2. Open the file "cmdline.txt"
  3. Add ip=169.254.10.1 At the end of the long line of text separated with a space
  4. Save the file.
  5. Create a file named ssh with no extension in the same directory

Now you can safely eject the SD card and start up the pi with the SD card

Connecting to the pi

You can connect with different methods to the pi, but i like to use the comand prompt.

  1. Open the command prompt
  2. Enter "ssh pi@169.254.10.1"
  3. Click enter
  4. Fill in the password "raspberry"

WiFi

To acces your site on your phone you'll need a WiFi ip. here for you'll need to make a connection to the WiFi.

  • enter "sudo wpa_passphrase "SSID" "PASSWORD" >> /etc/wpa_supplicant/wpa_supplicant.conf"
  • Enter the WPA client

wpa_cli

  • Select interface

interface wlan0

  • Reload config

reconfigure

Python packages

  • Flask
  • Flask-cors
  • Flask-MySQL
  • Flask-SocketIO
  • Gevent
  • Gevent-websocket

use the following code to install the packages

"pip install Flask Flask-Cors Flask-MySQL Flask-SocketIO Gevent Gevent-websocket"

Step 2: The Database

For my database i use 7 tables

  • pompConfig
  • sensors
  • MesureSensors
  • users
  • orderedCocktails
  • cocktails
  • account

Step 3: Wiring

Use my scheme to wire the whole project together.

The relay uses 5V but is controlled with 3.3V

The LCD uses 5V

Step 4: Make a Service Out of You Program

To make sure your program starts when you start up your pi, you'll need to make your code a service. You do this a followed.

"sudo systemctl enable myscript.service"

Step 5: Housing

For this project i used OSB wood. You'll need planks of the following size

  • 2 times 60 x 42 cm (front and back panel)
  • 2 times 15 x 42 cm (side panels)
  • 2 times 13 x 40 cm (inner dividers)
  • 2 times 10 x 7 cm (platform for 2 bottles)
  • 1 time 23 x 10 cm (platform for 2 bottles)

To cut this wood please be careful and ask help if needed!!

After assembling my case i drilled a few wholes for my components.

  • LCD.(7cm x 2.5cm)
  • Buttons (circle of 15mm)
  • Bottle Display (40 cm x 25 cm)
  • RFID (4 cm x 3mm)

After this is started to place in my electonices.

Step 6: Start the App

  1. plug in the pi
  2. wait untill the program is running
  3. go to the ip you see on the LCD screen
  4. choose a cocktail
  5. scan your RFID
  6. Enjoy a well deserved drink