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.
Downloads
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)
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
- Open win32 disk imager
- Select your image of the Rasbian OS
- Select your SD card
- Click on write
Before we can start coding we'll need to setup a few things on the pi.
- Go to the boot directory of the SD card
- Open the file "cmdline.txt"
- Add ip=169.254.10.1 At the end of the long line of text separated with a space
- Save the file.
- 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.
- Open the command prompt
- Enter "ssh pi@169.254.10.1"
- Click enter
- 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"
The Database
For my database i use 7 tables
- pompConfig
- sensors
- MesureSensors
- users
- orderedCocktails
- cocktails
- account
Wiring
Use my scheme to wire the whole project together.
The relay uses 5V but is controlled with 3.3V
The LCD uses 5V
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"
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.
Start the App
- plug in the pi
- wait untill the program is running
- go to the ip you see on the LCD screen
- choose a cocktail
- scan your RFID
- Enjoy a well deserved drink