Smart Mixer

by briancuppen in Craft > Digital Graphics

443 Views, 6 Favorites, 0 Comments

Smart Mixer

IMG_2126.jpg
IMG_2120.JPG
IMG_2180.jpg

The smart mixer

I, Brian Cuppen, student of 1MCT2 made a mixer for my project one. This mixer can make drinks, store and display data and has an online dashboard.

The idea behind it

I always wanted to make something that could be useful for any age. a device that even a kid or an old man can use in their daily life. And so, when I was spacing out in my kitchen, a lightbulb above my head turned on and said : 'I'm thristy, but I'm also lazy to get up everytime to make a drink'. The idea of a the mixer was born that moment.

Concept of the mixer

This mixer helps you make drinks, and yes, you need to get up and follow the steps but what makes it interesting is that it can hold a larger quantity of your drink so you won't need to remake it every single time. You can simply refill your glass. In addition, live data can be seen on the online dashboard such as temperature and how much drink there's left.

Why is it called a 'Smart mixer' ?

But Brian, you can just take a normal liter bottle and fill it with your drink. Yes that's true but my mixer can hold a larger quantity, you can remix the drink and above all it's refillable. Aside from this is the mixer completely functional through an online dashboard where you can make drinks, get more info about the mixer itself and search up history data. With this you can see what drinks you'ev made the most or what the average temperature is of your drinks were.

Supplies

My mixer uses these components:

- 5 volt dc motor
- 2 mini ventilators

- 2 watersensors

- raspberry pi

- LM35 warmth sensor

- PCF

- weight sensor + Hx711 module (enhancer)

- 7-segment display

- MCP3008

- LCD display

*****Components*****

- jumper wires (X/Y/Z)

- diodes (fans and motor)

- resistors

- transistors (fans and motor)

- voltage supply (3,3 and 5 volts)

- push button

*****Materials****

- gorilla glue

- multiplex wooden planks (thin ones)

- Tin

- Tin heater

- cup (for the drink to be in, plastic best option) [] - duck tape [] - sink (so you can pour the water in your glass) [] - bolts [] - sticky tape (sticky on both sides)

A Word Before Construction

IMG_2180.jpg

This instructable will help you remake my project. The materials I used are certainly not the best materials. If you prefer you could use a more sturdier type of wood for example.

Though I recommend to not use a glass as water reservoir because you're going to drill holes in it.

This instructable is seperated in 3 parts, backend, frontend and lastly design.

Backend Coding

Schermafbeelding 2022-06-20 165827.png
1.png
2.png

I made use of flask routes to get data of my sql databases. The mixer stores data produced by the sensors in these databases which are requested through these flask routes.

This data is stored in jasons and sent to the frontend.

I also used socket emits to get a live data connection. A quick exmaple is the temperature widget that you see on the right upper corner on the dashboard. these sockets work like this : - frontend or backend sents a socketio.emit with a message and content (not always) - the other side (either frontend or backend), listens if it receives this message, if so the definiiton under the socket will be executed. This proces is live because the emit can be send conditionally. In other words, if you press something -> emit to backend -> backend responds.

Jasons ?

The backend uses seperate threads for the sensors that are present. The values read by the sensors are sent to the mysql databases. By peforming a JSONIFY you can recapture this data in a dictionary which makes it easier to code with.

Threads

Putting all the code in one app.py would crash the pi, due to this I have used threads, basically giving 1 task to one thread in the RPi. Using this method won't crash the Pi, threads are programs that can run the the background.

water security system

The water security system is a perfect example of retrieving data out of the sql database and live emits to the frontend. Process:

  • water is detected -> emit to frontend, don't make new drinks !
  • data stored in database
  • recheck function activated,a flask route that activates the sensor to check if there still is water
  • if so, emit to frontend still blocked + activate recheck funtion again
  • if not, emit to frontend to unblock and you're ready to make drinks again !

Mysql workbench

As said before, I store my data in a sql database. In the example below you see the sql statement used to store the data. I request this data through a flask route, send to the frontend and displayed graphically on the history page.

Frontend

3.png
4.png

Base

the frontend has 2 tasks, listen to data and visualize data, with the use of a (pretty basic) html and css layout. It listens to socketio emits and alters the html & css accordingly.

The history page

The dictionaries sent to the frontend get processed and displayed in graphs by using chart.js this is how it works:

  • get data (dictionaries)
  • make labels to name the data
  • set a data type
  • update the chart so the user sees recent data

Live widget

The live widget displays the temperature of your drink the last time it was measured and how much there's left. This is super efficient, now you can see in your bedroom if there's still something left of the shake you made earlier.

This is how it works:

  • frontend requests live data (most recent values)
  • receives the data send by backend
  • adds the value to the html

Design

6.png
IMG_2181.jpg

Fair enough, the design does look crappy but it has some value and tought to it.

When the water detect system detects water, it blocks the frontend to make new drinks, we do not want a roasted Pi. With this in mind the design has to be reopenable, This simplistic system realizes that, in some sense.

In rest, the ties are put so the middle side closes firmly. By pulling the ties further you create a tension that makes sure the middle side stays on its place while you remove the water.

The wires of the fans are placed in two of the four pillars that support the topside.

Weight sensor

The weight sensor is the only clearly visible eletrical component because it has to be in direct contact with the cup. This sensor measures the force that is pushing the metal in the middle down, the weight of the cup.

It can reach up a range of 50 kilos but that won't be neceassary for this project. A suggestion, for better measurements you can use two sensors so each side is supported evenly.

This is the end of my first instructable. If you have any questions don't hesistate to ask !

https://github.com/howest-mct/2021-2022-projectone-BrianCuppen.gitgithublink