Microcontroller-Regulated Eggshell Grinder and Reactor for Efficient Calcium Acetate Fertilizer Synthesis π±βοΈ
An automated Arduino-based system that grinds eggshells to precise weights and reacts them with vinegar to produce calcium acetate fertilizer, with intelligent monitoring and control throughout the entire synthesis process.
- About
- Features
- How It Works
- Hardware Requirements
- Software Requirements
- Installation
- Usage
- Project Structure
- Configuration
- API Reference
- Contributing
- License
- Author
This project implements a complete automated synthesis system for calcium acetate fertilizer production. The microcontroller regulates an eggshell grinding process to achieve precise weight measurements, followed by automated vinegar addition in optimal ratios, and continuous monitoring of the exothermic reaction until completion.
Chemical Reaction: CaCOβ (egg shells) + 2CHβCOOH (vinegar) β Ca(CHβCOO)β (calcium acetate) + HβO + COβ
Key Features:
- Precision grinding with real-time weight feedback
- Automated 1:2 ratio vinegar addition
- Reaction monitoring until bubbling cessation
- Temperature stabilization at ~39Β°C
- Complete process automation with LCD user interface
- Precision Grinding: Automated eggshell grinding to exact weight specifications
- Intelligent Ratio Control: Automated 1:2 eggshell-to-vinegar ratio addition
- Reaction Monitoring: Continuous tracking until bubbling stops and temperature stabilizes
- Complete Process Automation: From grinding to final product with minimal user intervention
- Temperature Sensing: DHT22 sensor tracking reaction temperature (target: ~39Β°C)
- Weight Measurement: HX711 load cell for precise grinding and ratio control
- pH Level Detection: Analog pH sensor monitoring reaction progress
- Serial Output: Real-time data logging and display
- Grinding Motor Control: Relay-controlled motor for eggshell grinding
- Automated Pumping: SSR-controlled pump for precise vinegar addition
- LCD User Interface: I2C LCD for process status and user input
- Button Input System: User controls for process initiation and parameter input
- Dual Relay Control: Regular and solid-state relays for mixing operations
- LCD Display: I2C LCD for local status visualization (configurable)
- Power Management: Sleep/wake functionality for energy efficiency
- Modular Design: Separate configuration files for each component
- Centralized Pin Management: All hardware pins defined in one location
- Extensible Codebase: Easy to add new sensors or actuators
START
β
Put Eggshell β Press Button β LCD Shows Message
β
Input Desired Grams (g) to Grind β Loadcell Ready
β
Motor ON (Grinding Starts)
β
ββ Decision: Loadcell = Desired Weight?
β NO β Continue Grinding (Motor ON)
ββ YES β Motor OFF β Pump ON
β
Pump Runs Until 1:2 Ratio Achieved
β
Monitor Solution (Temperature & pH)
β
Store Data & Continue Monitoring
β
Until Bubbling Stops & Temp β 39Β°C
β
END (Fertilizer Ready)
- System Initialization: Arduino boots up, initializes sensors and LCD
- Eggshell Loading: User places eggshells in grinding chamber
- Process Start: User presses button to begin synthesis
- Parameter Input: LCD prompts for desired eggshell weight in grams
- Grinding Phase: Motor activates, load cell monitors weight in real-time
- Weight Verification: System checks if target weight is achieved
- Grinding Completion: Motor stops when desired weight is reached
- Vinegar Addition: Pump activates to add vinegar in 1:2 ratio
- Reaction Monitoring: Continuous temperature and pH monitoring begins
- Data Logging: All sensor readings stored and displayed
- Completion Detection: Process continues until bubbling stops and temperature stabilizes at ~39Β°C
- System Shutdown: Automatic completion when reaction is finished
- Grinding Control: Relay 1 controls grinding motor with weight feedback
- Pumping Control: Relay 2 (SSR) controls vinegar pump with ratio feedback
- Reaction Endpoints: Process completes when COβ evolution ceases and temperature peaks
- Safety Monitoring: Continuous parameter checking prevents unsafe conditions
- Arduino Board (Uno, Mega, or compatible)
- DHT22 Temperature & Humidity Sensor
- HX711 Load Cell Amplifier + Load Cell (for weight measurement)
- Analog pH Sensor Module
- I2C LCD Display (16x2 or 20x4)
- Momentary Push Button (for process initiation)
- DC Motor (for eggshell grinding)
- Peristaltic Pump (for vinegar addition)
- 2-Channel Relay Module (Regular + SSR for motor/pump control)
- Grinding Chamber: Container for eggshell grinding
- Reaction Vessel: Container for fertilizer synthesis
- Load Cell Mounting: Proper setup for weight measurement
- Tubing System: For vinegar transfer from pump to reaction vessel
DHT22 Sensor -> Pin 2
HX711 DT -> Pin 25
HX711 SCK -> Pin 23
pH Sensor -> A0
LCD I2C -> I2C pins (SDA, SCL)
Push Button -> Pin 7 (with pull-up resistor)
Grinding Motor -> Pin 22 (via Relay 1)
Vinegar Pump -> Pin 23 (via Relay 2)
- Version: 1.8.19 or higher
- Board: Arduino Uno/Mega (or compatible)
Install via Arduino Library Manager:
DHT sensor libraryby AdafruitLiquidCrystal_I2Cby Marco SchwartzHX711by Bogdan Necula
-
Clone the Repository
git clone https://github.com/qppd/Smart-Mixer.git cd Smart-Mixer -
Open Arduino IDE
- Navigate to
src/arduino/SmartMixer/SmartMixer.ino - Open the file in Arduino IDE
- Navigate to
-
Install Required Libraries
- Go to
Sketch > Include Library > Manage Libraries - Search and install:
- DHT sensor library
- LiquidCrystal_I2C
- HX711
- Go to
-
Configure Hardware
- Connect sensors according to pin configuration
- Verify power supplies for all components
-
Upload Code
- Select correct board and port
- Click Upload button
- System Setup: Power on Arduino, ensure all sensors are connected
- Load Eggshells: Place eggshells in the grinding chamber on the load cell
- Start Process: Press the push button to initiate synthesis
- Parameter Input: LCD displays "Enter weight (g):", use buttons to input desired grams
- Grinding Phase: Motor activates, grinding continues until target weight is reached
- Weight Verification: System automatically stops grinding when load cell measures desired weight
- Vinegar Addition: Pump activates to add vinegar in 1:2 ratio to eggshell weight
- Reaction Monitoring: System continuously monitors temperature and pH
- Data Logging: All readings displayed on Serial Monitor and optionally LCD
- Completion Detection: Process ends when bubbling stops and temperature stabilizes at ~39Β°C
Temperature: 39.20Β°C --- Weight: 150.00g --- pH: 4.80 --- Status: REACTING
Temperature: 39.50Β°C --- Weight: 450.00g --- pH: 5.20 --- Status: COMPLETE
- Grinding Weight: User-defined (typically 100-200g eggshells)
- Vinegar Ratio: Automatic 1:2 eggshell-to-vinegar ratio
- Reaction Temperature: Target ~39Β°C (normal temperature change)
- Completion Criteria: Bubbling cessation + temperature stabilization
- Monitoring Duration: Continuous until reaction completion
// Start grinding motor
operateRELAY(RELAY_1, true);
// Check if target weight reached
if (getLOADCELLWeight() >= targetWeight) {
operateRELAY(RELAY_1, false); // Stop grinding
operateSSR(RELAY_2, true); // Start vinegar pump
}
// Monitor reaction completion
if (getPHValue() >= 4.5 && getDHTTemperature(false) >= 38.0) {
// Reaction complete - stop all operations
operateSSR(RELAY_2, false);
}Uncomment LCD initialization in setup():
initLCD();
setLCDText("Fertilizer", 0, 0);
setLCDText("Production", 0, 1);Smart-Mixer/
βββ LICENSE
βββ README.md
βββ src/
βββ arduino/
βββ SmartMixer/
βββ SmartMixer.ino # Main Arduino sketch
βββ PINS_CONFIG.h # Hardware pin definitions
βββ DHT_CONFIG.h/.cpp # Temperature sensor
βββ HX711_CONFIG.h/.cpp # Load cell amplifier
βββ PH_CONFIG.h/.cpp # pH sensor
βββ LCD_CONFIG.h/.cpp # LCD display
βββ RELAY_CONFIG.h/.cpp # Relay control
βββ SD_CONFIG.h/.cpp # SD card logging
βββ BUTTON_CONFIG.h/.cpp # 3-button input handling
SD_CONFIG.*: SD card logging and storageBUTTON_CONFIG.*: Three-button input handling with debounce
- Target Grinding Weight: User-defined (100-200g recommended)
- Vinegar Ratio: 1:2 eggshell-to-vinegar (automatic calculation)
- Reaction Temperature: ~39Β°C (normal temperature increase)
- Completion Criteria: Bubbling cessation + temperature stabilization
- Safety Limits: Max 45Β°C, Min pH 4.0, Max weight 500g
- HX711 Scale Factor:
22500.3f(adjust for your load cell) - pH Calibration:
21.34(calibrate with pH 4.0 and 7.0 buffers)
Edit PINS_CONFIG.h to modify hardware connections:
#define DHT_PIN 2 // Temperature sensor
#define HX711_DT 25 // Load cell data
#define HX711_SCK 23 // Load cell clock
#define PH_PIN A0 // pH sensor analog input
#define BUTTON_1 24 // Button 1 input
#define BUTTON_2 5 // Button 2 input
#define BUTTON_3 6 // Button 3 input
#define SD_CS 53 // SD card chip select (Arduino Mega)
#define RELAY_1 22 // Grinding motor relay
#define RELAY_2 23 // Vinegar pump relay- DHT Type: Currently set to DHT22 (configurable)
- pH Sampling: 10 readings with median filtering for noise reduction
- Weight Averaging: 10-sample moving average for stability
- Button Debouncing: 50ms debounce delay
- LCD Refresh Rate: 500ms update interval
void initDHT(); // Initialize DHT sensor
float getDHTTemperature(boolean fahrenheit); // Get temperature
float getDHTHumidity(); // Get humidityvoid initLOADCELL(); // Initialize HX711
float getLOADCELLWeight(); // Get weight reading
void operateHX711sleep(); // Put HX711 to sleep
void operateHX711wake(); // Wake HX711float getPHValue(); // Get filtered pH readingvoid initLCD(); // Initialize LCD
void clearLCD(); // Clear display
void setLCDText(String text, int x, int y); // Display text
void setLCDText(float value, int x, int y); // Display numbervoid initRELAY(); // Initialize relays
void operateRELAY(uint16_t relay, boolean state); // Control regular relay
void operateSSR(uint16_t relay, boolean state); // Control SSRWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Arduino coding standards
- Add comments to complex logic
- Test hardware compatibility
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
Sajed Lopez Mendoza
- GitHub: @qppd
- Project: Smart-Mixer
β Star this repository if you find it useful!
For questions or support, please open an issue on GitHub.