CocktailMaker is the name of my project, the function can already be deduced from the name.
The goal is to make the cocktail that you choose on a self created website. On the website, you can find wich cocktails can be made, the history of the cocktails(how many were made). The machine Itself produces driven by pumps the cocktail that you selected on the site.With a temperature sensor, you can see on a display the temperature inside the machine. The ultrasonic sensor is used for detecting if a glass is present. Without a glass you can't produce the cocktail. The last sensor is the force sensing resistor.He will be used to measure the liquid in the bottle. When there is an error the buzzer goes off and the error code will be shown on the display.
- Raspberry Pi
Sensors & actuators
- HCSR04(Ultrasonic sensor)
- Force squary resistor
- DS18B20(Temperature sensor)
- LCD20x4 -I2C (Display)
- Beverage crate
- Metal case(RPI,breadboards...)
Step 1: Installing Raspberry Pi
Before we can start at our project, we need to install and program our Raspberry Pi.
- Install the IMG. file on the SD card(16GB>).
- Plug the SD card into the Pi.
- Install Putty(SSH) and connect with 169.254.10.1.
Now, we start to program our Raspberry Pi.
- Setting up your Home network, use this command for setting it on your Pi:wpa_passphrase "YourNetwork" "YourSSID" >> /etc/wpa_supplicant/wpa_supplicant.conf .Reboot your Pi and type ifconfig. If everything is fine you will see an IP addres.
- After it you should change your password.Every default pi has the same password and username and that makes it easy for hackers to invade the Pi. You can do that by typing the command passwd.
- Install following packages that we need for future things: sudo apt install apache2 -y, sudo apt install php libapache2-mod-php -y, sudo apt install mariadb-server mariadb-client -y, sudo apt install php-mysql -y, sudo systemctl restart apache2.service, sudo apt install phpmyadmin -y .
- Now we need to install libraries.We use the pip3 command: pip3 install mysql-connector-python, pip3 install flask-socketio, pip3 install flask-cors, pip3 install geventpip3 install gevent-websocket .
- As a final step, we set our Pi enabled for one wire, spi and i2C. Use following command to enter the config file: sudo raspi-config.
- When you are in the file, move to Interface options and enter.
- You see options that you can disable or enable, We need to enable the one-wire, spi and i2C.
Step 2: Getting Things Ready
Now everything is set on our Raspberry Pi, we move on to the circuit. The best option to start is taking everything step by step but first we need to set our SSH connection on Visual Studio. This link explains how to do that: https://code.visualstudio.com/docs/remote/ssh .
- Connect the Pi to the circuit.
- Integrate the temperature into the circuit.
- Test the circuit.
- Integrate the HC SR04 into the circuit.
- Test the circuit.
Step 3: Database
After testing the components we will create a database to store data. First we need to make a connection over SSH.This link shows how we do this: https://dev.mysql.com/doc/workbench/en/wb-mysql-co... . When you're connected you can start making tables and add columns or you can import data by using "Data Import". That file includes all data and structures.
Step 4: Case
As last step, you need to make your product attractive. I used 3 cables for 12 connections instead of 36 loose wires and everything is stored in a box. After that I used a beverage crate and I sprayed it with paint to make it look new and fresh.Inside, the bottles are cooled by a fan on top of the beverage crate.I also used leds to make it look colorful inside.