Giter VIP home page Giter VIP logo

smart-bartender's Introduction

Smart Bartender

Why spend lots of money going out for drinks when you can have your own smart personal bartender at your service right in your home?! This bartender is built from a Raspberry Pi 3 and some common DIY electronics.

Prerequisites for the Raspberry Pi

Make sure you can connect a screen and keyboard to your Raspberry Pi. I like to use VNC to connect to the Pi. I created a tutorial about how to set that up on a Mac.

Make sure the following are installed:

  • Python 2.7 (should already be installed on most Raspberry Pi)
  • pip

Enable SPI

You'll need to enable SPI for the OLED screen to work properly. Typing the following command in the terminal will bring you to a configuration menu.

raspi-config 

Then navigate to Interfacing Options and select SPI. Make sure it's turned on and reboot.

See this article for more help if you need it.

I2C

Make sure i2c is also configured properly. Type

sudo vim /etc/modules

in the terminal

press i, then make sure to paste the following two lines in the file:

i2c-bcm2708
i2c-dev

press esc then ZZ to save and exit.

OLED Setup

The Raspberry Pi Guy has a nice script to setup the OLED screen on your raspberry pi. Download the following repository on your Pi:

https://github.com/the-raspberry-pi-guy/OLED

then navigate to the folder with the terminal

cd ~/path/to/directory

and run the installation script

sh OLEDinstall.sh

There is also a guide on the Adafruit website if you get stuck.

Running the Code

First, make sure to download this repository on your raspberry pi. Once you do, navigate to the downloaded folder in the terminal:

cd ~/path/to/directory

and install the dependencies

sudo pip install -r requirements.txt

You can start the bartender by running

sudo python bartender.py

How it Works

There are two files that support the bartender.py file:

drinks.py

Holds all of the possible drink options. Drinks are filtered by the values in the pump configuration. If you want to add more drinks, add more entries to drinks_list. If you want to add more pump beverage options, add more entries to the drink_options.

drinks_list entries have the following format:

{
		"name": "Gin & Tonic",
		"ingredients": {
			"gin": 50,
			"tonic": 150
		}
	}

name specifies a name that will be displayed on the OLED menu. This name doesn't have to be unique, but it will help the user identify which drink has been selected. ingredients contains a map of beverage options that are available in drink_options. Each key represents a possible drink option. The value is the amount of liquid in mL. Note: you might need a higher value for carbonated beverages since some of the CO2 might come out of solution while pumping the liquid.

drink_options entries have the following format:

{"name": "Gin", "value": "gin"}

The name will be displayed on the pump configuration menu and the value will be assigned to the pump. The pump values will filter out drinks that the user can't make with the current pump configuration.

pump_config.json

The pump configuration persists information about pumps and the liquids that they are assigned to. An pump entry looks like this:

"pump_1": {
		"name": "Pump 1",
		"pin": 17, 
		"value": "gin"
	}

Each pump key needs to be unique. It is comprised of name, pin, and value. name is the display name shown to the user on the pump configuration menu, pin is the GPIO pin attached to the relay for that particular pump, and value is the current selected drink. value doesn't need to be set initially, but it will be changed once you select an option from the configuration menu.

Our bartender only has 6 pumps, but you could easily use more by adding more pump config entries.

A Note on Cleaning

After you use the bartender, you'll want to flush out the pump tubes in order to avoid bacteria growth. There is an easy way to do this in the configuration menu. Hook all the tubes up to a water source, then navigate to configure->clean and press the select button. All pumps will turn on to flush the existing liquid from the tubes. I take the tubes out of the water source halfway through to remove all liquid from the pumps. Note: make sure you have a glass under the funnel to catch the flushed out liquid.

Running at Startup

You can configure the bartender to run at startup by starting the program from the rc.local file. First, make sure to get the path to the repository directory by running

pwd

from the repository folder. Copy this to your clipboard.

Next, type

sudo vim /etc/rc.local

to open the rc.local file. Next, press i to edit. Before the last line, add the following two lines:

cd your/pwd/path/here
sudo python bartender.py &

your/pwd/path/here should be replaced with the path you copied above. sudo python bartender.py & starts the bartender program in the background. Finally, press esc then ZZ to save and exit.

If that doesn't work, you can consult this guide for more options.

smart-bartender's People

Contributors

atainter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smart-bartender's Issues

Not Booting When 3v3 Pin is connected

I have everything wired according to the circuit diagram. The only differences are the type of oled screen I have and I also don't have an LED strip. The oled screen has only four pins. When I have everything except the 3v3 pin connected to the pi, it boots fine. As soon as I connect it, it turns off, but it still has the red LED. It's a Raspberry Pi 3B+. I can still boot it, just not when that pin is connected.

Is there something I have to install on the Pi in order to make it work?

Step Down Converter Heating Up

Hello all! I am having a problem where the DC to DC step down converter (5V regulator in the schematic) is getting very hot when I plug in the power. Any suggestions on what the problem might be?

Pours drinks 2 times

The bartender pours one drink than finishes the progress but without any extra input it pours a second drink. It's not possible to do anything between those two processes. On some boots of the Pi it does only pour one at a time but that's gone on the next restart.

Power Distribution Board Instead of Breadboard

In the wiring diagram it shows that they used a bread board for power distribution instead of the 5V Power Distribution board shown in the parts list. I just need some help figuring out how to wire the power distribution like they do in the video and not the bread board.

LEDs not working

I have seen a lot of people talk about how they chose to not include the LED lights to swirl when the drink is being poured. I decided to make a kaleidoscope mirror for the drink to sit on. Unfortunately, the lights fail to activate when the drink pour is activated. I've double checked the pins, but beyond that I'm not sure where else to start trouble shooting.

OLED Screen not working

I have yet to get my OLED screen to work. I have tried two different OLEDs; Adafruit and a generic brand. Admittedly, both screens have cracked at the bottom left while installing them but where they cracked seem to be inconsequential. Since I've gone through two of them I can't help but think that something else is wrong.

ImportError: No module named gaugette.ssd1306

Hello,
I'm a beginner with all of this and installed everything cording to the instructions but i'm getting the following error:
Traceback (most recent call last):
File "bartender.py", line 1, in
import gaugette.ssd1306
ImportError: No module named gaugette.ssd1306

what did I missed?
thanks!

Problems with buttons

So after testing and researching I found out that there's a problem with the gpio pins detecting false Inputs with momentary switch buttons which leads them into a state of floating and therefore not beeing able to correctly detect the input gut rather detect multiple ones. After changing the code in a way that it doesn't recognise these false inputs I manage to get it to work so that it only pours one at a time but now I got the problem that after some pours the system doesn't recognise any inputs anymore where could be the problem that something like that happens? I will add a link to the changed code.

The link to the Raspberry forum where I also stated my problem:
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=214560&p=1320522#p1320522

Interface to communicate with Android App

For a project in university we want to build the bartender project and extend it to be controllable remotely using an Android App.
Unfortunately I am not that experienced with communication and interfaces.
What would you guys suggest on how to implement such a feature?

nokia 5110 screen

Hi

I would like to use an in-expensive nokia 5110 screen.
Has anyone done this, if so. Can you please share the code.
If not, what would need to change in the python script to get this done.

This is a better option for guys like me living in 3rd world countries where some of these electronics are very expensive or not available at all. it will also add value to the project by expanding on options around electronics to use to customize the project.

Thanks
Robert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.