DIY coin dispensing machine using ESP32 board

ESP32 11-03-26
42 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- Micropython program of ESP32

 

 

Objective of the project

The objective of this project is to design and build a smart coin dispensing machine controlled by an ESP32 board. The system allows a user to select and dispense a specific amount of coins using push buttons. The selected amount is displayed on an LCD I2C screen, and a servo motor activates a mechanical coin dispensing mechanism to release the required number of coins automatically.

This project aims to:

1- demonstrate the use of the ESP32 in automation systems.

2- develop a simple electronic control system for coin dispensing.

3- combine electronic components (ESP32, buttons, LCD, servo) with a mechanical coin dispensing mechanism.

4- provide a low-cost prototype of an intelligent coin dispenser that can be used in vending machines, kiosks, or educational demonstrations.

Functioning (Working Principle) of the System

The system operates through the interaction between the ESP32 board, the push buttons, the LCD display, the servo motor, and the mechanical coin dispensing mechanism.

1. System Initialization

When the ESP32 is powered on, it initializes the LCD I2C screen and displays a message such as “Coin Dispenser Ready”.

2. Selecting the Amount

The first push button is used to increase the amount of money to be dispensed.

Each press adds a predefined value (for example 100 millimes or one coin).

The selected amount is displayed on the LCD screen in real time.

3. Confirming the Dispensing

The second push button is used to confirm the dispensing operation.

The ESP32 calculates the number of coins required according to the selected amount.

4. Coin Dispensing Process

The ESP32 sends control signals to the servo motor.

The servo rotates to push or release one coin from the mechanical dispensing mechanism.

This movement is repeated until the required number of coins has been dispensed.

5. Display Update

During the process, the LCD screen may display messages such as “Dispensing Coins”.

After the operation, the amount is reset to zero, and the system becomes ready for a new transaction.

The system provides a simple automated coin dispensing solution, combining electronic control with a mechanical dispensing mechanism, making it suitable for educational electronics projects and smart vending systems.

 

Required Components

1. ESP32 board

The ESP32 board is the main microcontroller of the system. It controls all the components of the project. The ESP32 reads the signals from the push buttons, processes the user’s input, sends information to the LCD screen, and controls the servo motor to activate the coin dispensing mechanism.

2. Push Buttons

bouton-poussoir

The push buttons are used for user interaction with the system.

- The first button increases the amount of money to be dispensed.

- The second button confirms the dispensing operation.

When a button is pressed, it sends a signal to the ESP32, which then performs the corresponding action.

3. SG90 Servo Motor

The servo motor is an actuator that converts electrical signals into mechanical movement. In this project, the ESP32 controls the servo motor to rotate at a specific angle. This movement activates the mechanical coin dispensing mechanism, allowing one coin to be released each time the servo moves.

4. Mechanical coin dispensing mechanism

The mechanical coin dispensing mechanism is responsible for storing and releasing the coins one by one. It is usually composed of a coin holder, a guiding channel, and a moving part that pushes or releases the coin. The servo motor drives this mechanism to dispense the coins accurately.

5. LCD Display with I2C Module

The LCD I2C display is used to allow the system to show information to the user. It can display the selected amount.

6. Breadboard 

Breadboard

A breadboard is used to assemble the circuit without soldering. It makes it easy to connect and modify the components during testing and development.

7. Jumper Wires

Jumper wires

Jumper wires are used to connect the ESP32 board, servo motor, and LCD display together. They ensure proper electrical connections between all components.

8. Power Supply Module 

Module d'alimentation

The 5V/3.3V power supply module provides the necessary electrical power to the electronic components used in the coin dispensing system. It converts the input voltage (for example from a 9V battery, USB supply, or external adapter) into stable 5V and 3.3V outputs required by different components.

9. 9V Battery 

The 9V battery serves as the main energy source for the electronic system. It provides the electrical power needed to operate the components of the coin dispensing machine.

 

Circuit Connections of system

 

1- Connection of servo motor to ESP32

Serv motor  ESP32 board
Red wire 5V of supply power
Brown wire GND
Yellow wire GPIO 5

 

2- Connection of LCD I2C display to ESP32

LCD I2C display ESP32  board
VCC 5V
GND GND
SDA GPIO 21
SCL GPIO 22

 

3- Connecting button 1 to the ESP32 board

Button 1 ESP32 board
Leg GPIO 23
Another leg GND

 

4- Connecting button 1 to the ESP32 board

Button 2 ESP32 board
Leg GPIO 19
Another leg GND

 

Micropython program of ESP32

The program serves as the control software for a DIY coin dispensing machine using an ESP32 board, an LCD I2C screen, two push buttons, a servo motor, and a mechanical coin dispensing mechanism. Its main role is to coordinate the interaction between the user, the electronic components, and the mechanical system to automatically dispense coins based on user input.

You need to install this libraries :

i2c_lcd et lcd_api for I2C LCD screen

Servo → to control the servomotor

 

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

Pictures of the articles

Robotic site created by Mohamed Ali Haj Salah - Teacher info