On the mission to develop affordable, small, and customizable vending machines for everyone.
Kaishita is a student-led project born at USP São Carlos, Brazil, aiming to revolutionize automated sales systems with compact and intelligent vending machines.
- Deliver automated sales solutions that fit any environment.
- Create a purchasing process as simple as grabbing the product (secure and theft-proof).
- Offer diverse payment methods like Pix and credit/debit cards.
- Provide real-time feedback to vendors, including stock management and AI-based pricing suggestions.
The Kaishita vending machine integrates weight sensors, MQTT communication, and a centralized server to automate and analyze purchases.
- User Interaction:
The user selects the desired product and quantity to withdraw from the vending machine. - Server Logic:
The server receives the request, monitors the event, and determines the state of the purchase:- Candies Taken (Successful)
- Candies Not Taken (Unsuccessful)
- Weight Verification:
The ESP32 weight system ensures the correct amount of product has been taken. - Data Analysis:
Every successful purchase is logged in a CSV file and automatically analyzed for trends.
- Project Overview
- Goals
- How It Works
- Project Structure
- Key Features
- Setup Instructions
- Example CSV File Format
- Results
- Project Images
- Contribute to the Project
- Credits
Kaishita/
├── Hardware_Firmware/ # ESP32 firmware code for the vending machine
│ ├── components/ # External libraries and components
│ │ ├── arduino/ # Arduino libraries for ESP-IDF compatibility
│ │ ├── pubsubclient/ # MQTT library
│ │ ├── WiFiManager/ # Wi-Fi management library
│ ├── include/ # Header files for MQTT and weight logic
│ ├── main/ # Main source code
│ │ ├── 3Cell.cpp # Weight scale logic (HX711 integration)
│ │ ├── mqtt.cpp # MQTT communication
│ │ ├── main.cpp # Firmware entry point
│ ├── CMakeLists.txt # Build configuration
│
├── Website/ # Server code (handles vending machine communication)
│
├── Analysis/ # Automated purchase data analysis
│ ├── analise_compras.py # Script for trend analysis
│ ├── requirements.txt # Python dependencies
│ └── README.md # Instructions for running analysis
│
└── README.md # Main project documentation
- Monitors the weight of products using HX711 load cells connected to an ESP32-S3.
- Publishes weight data to a server via MQTT for purchase verification.
- Handles user requests, verifies events, and tracks product states:
- Product Taken
- Product Not Taken
- Logs successful purchases into a CSV file.
- Automatically generates:
- Trend graphs: Showing product purchases over time.
- Purchase probabilities: Calculating likelihood of sales at specific times (morning, afternoon, evening).
-
Clone the repository:
git clone https://github.com/GUUDIN/Kaishita.git cd Kaishita/Hardware_Firmware/src
-
Install Arduino Component:
git submodule add https://github.com/espressif/arduino-esp32.git components/arduino cd components/arduino git submodule update --init --recursive
-
Add Required Libraries:
idf.py add-dependency "tzapu/WiFiManager" idf.py add-dependency "knolleary/pubsubclient"
-
Configure Wi-Fi and MQTT Broker in
main/mqtt.cpp
:const char* mqtt_server = "YOUR_MQTT_BROKER_ADDRESS"; const int mqtt_port = YOUR_MQTT_BROKER_PORT;
-
Build and Flash Firmware:
idf.py build idf.py flash
-
Navigate to the
analysis
folder:cd Kaishita/analysis
-
Install Dependencies in a Virtual Environment:
python3 -m venv venv source venv/bin/activate # Linux/MacOS pip install -r requirements.txt
-
Run the Analysis:
python analise_compras.py
-
Provide the CSV file path when prompted.
data | hora | produto | quantidade |
---|---|---|---|
2024-01-01 | 8 | KitKat | 10 |
2024-01-01 | 14 | Mentos | 5 |
2024-01-01 | 20 | Bala | 7 |
- Trend Graphs: Visualize total quantities of products sold at different times.
- Purchase Probabilities: Calculate product popularity in the morning, afternoon, and evening.
If you want to collaborate:
- Fork the repository.
- Grab an issue and start coding!
- Submit a pull request.
- ESP32 Firmware Development: Pedro Gudin & Mateus Messias
- Analysis and Server Integration: Mateus Messias & André Messias
- Documentation: Pedro Gudin & Mateus Messias & João Breches