Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino Mega ADK Controlled Vending Machine with I2C LCD Interface and Multiple DC Motors

Image of Arduino Mega ADK Controlled Vending Machine with I2C LCD Interface and Multiple DC Motors

Circuit Documentation

Summary

This circuit is designed to interface an Arduino Mega ADK (Rev3) with a variety of components including a 16x2 I2C LCD, multiple L298N DC motor drivers, a multi-coin acceptor, a 4x4 membrane matrix keypad, and several DC motors. The Arduino Mega ADK serves as the central controller, managing inputs from the keypad and coin acceptor, driving the motors through the motor drivers, and displaying information on the LCD. The circuit is powered by separate 12V and 5V power supplies, ensuring adequate power distribution for all components.

Component List

  • Arduino Mega ADK (Rev3): A microcontroller board based on the ATmega2560, with numerous digital and analog I/O pins, communication interfaces, and a USB host interface for connecting compatible peripherals.
  • 16x2 I2C LCD: A liquid crystal display with 16 characters by 2 lines, interfaced via the I2C protocol for displaying text or numbers.
  • Multi Coin Acceptor: A device that can recognize multiple coin types for applications such as vending machines or arcade systems.
  • 4X4 Membrane Matrix Keypad: A 16-button keypad arranged in a 4x4 matrix for user input.
  • L298N DC Motor Driver: A high-power motor driver capable of driving DC motors with a supply voltage up to 46V and continuous current up to 2A per channel.
  • POWER SUPPLY 12V 5AMP: A power supply unit that provides a 12V DC output with a maximum current of 5A.
  • 12v Power Supply: A power supply unit that provides a 12V DC output.
  • POWER SUPPLY 5V 5AMP: A power supply unit that provides a 5V DC output with a maximum current of 5A.
  • DC Motor: A standard DC motor used for various mechanical movements in the circuit.

Wiring Details

Arduino Mega ADK (Rev3)

  • I2C Communication:
    • D21/SCL connected to 16x2 I2C LCD SCL
    • D20/SDA connected to 16x2 I2C LCD SDA
  • Motor Driver Control:
    • D13 PWM to L298N (ENB)
    • D12 PWM to L298N (ENA)
    • D11 PWM to L298N (ENB)
    • D10 PWM to L298N (ENA)
    • D9 PWM to L298N (ENB)
    • D8 PWM to L298N (ENA)
    • D6 PWM to L298N (ENA)
    • D7 PWM to L298N (ENB)
    • D2 PWM to Multi Coin Acceptor COIN
  • Keypad Interface:
    • D22 to R1
    • D23 to R2
    • D24 to R3
    • D25 to R4
    • D26 to C1
    • D27 to C2
    • D28 to C3
    • D29 to C4
  • Motor Driver Inputs:
    • D30 to IN1
    • D31 to IN2
    • D32 to IN3
    • D33 to IN4
    • D34 to IN1
    • D35 to IN2
    • D36 to IN3
    • D37 to IN4
    • D38 to IN1
    • D39 to IN2
    • D40 to IN3
    • D41 to IN4
    • D42 to IN1
    • D43 to IN2
    • D44 to IN3
    • D45 to IN4
  • Power Connections:
    • 5V to 16x2 I2C LCD VCC
    • GND to 16x2 I2C LCD GND, Multi Coin Acceptor GND, and 12v power supply -

16x2 I2C LCD

  • SCL connected to Arduino Mega ADK D21/SCL
  • SDA connected to Arduino Mega ADK D20/SDA
  • VCC connected to Arduino Mega ADK 5V
  • GND connected to Arduino Mega ADK GND

Multi Coin Acceptor

  • COIN connected to Arduino Mega ADK D2 PWM
  • GND connected to Arduino Mega ADK GND
  • DC12V connected to 12v power supply +

4X4 Membrane Matrix Keypad

  • R1 connected to Arduino Mega ADK D22
  • R2 connected to Arduino Mega ADK D23
  • R3 connected to Arduino Mega ADK D24
  • R4 connected to Arduino Mega ADK D25
  • C1 connected to Arduino Mega ADK D26
  • C2 connected to Arduino Mega ADK D27
  • C3 connected to Arduino Mega ADK D28
  • C4 connected to Arduino Mega ADK D29

L298N DC Motor Driver

  • Multiple instances, each connected to Arduino Mega ADK for control signals (ENA, ENB, IN1, IN2, IN3, IN4)
  • GND connected to Arduino Mega ADK GND, POWER SUPPLY 5V 5AMP GND (DC), and POWER SUPPLY 12V 5AMP GND (DC)
  • 12V connected to POWER SUPPLY 12V 5AMP 12V-24V Output (DC)
  • 5V connected to POWER SUPPLY 5V 5AMP 12V-24V Output (DC)
  • OUT1, OUT2, OUT3, OUT4 connected to respective DC Motor pins

POWER SUPPLY 12V 5AMP

  • 12V-24V Output (DC) connected to L298N DC motor drivers 12V
  • GND (DC) connected to L298N DC motor drivers GND

12v Power Supply

  • + connected to Multi Coin Acceptor DC12V
  • - connected to Arduino Mega ADK GND

POWER SUPPLY 5V 5AMP

  • 12V-24V Output (DC) connected to L298N DC motor drivers 5V
  • GND (DC) connected to L298N DC motor drivers GND

DC Motor

  • Multiple instances, each connected to respective L298N DC motor driver outputs (OUT1, OUT2, OUT3, OUT4)

Documented Code

No code was provided for the microcontrollers in the circuit. The documentation of the code would typically include descriptions of the functions, algorithms, and logic used to control the components in the circuit. It would also detail how the microcontroller interacts with the other components, such as reading inputs from the keypad, controlling the motor drivers, and updating the display on the LCD.