Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Mega 2560 Paper Shredding Machine with Bluetooth Control

View and Edit Project In Cirkit DesignerImage of Arduino Mega 2560 Paper Shredding Machine with Bluetooth Control

Paper Shredding Machine Circuit Documentation

Summary

This document details the design and implementation of a paper shredding machine circuit. The circuit uses an Arduino Mega 2560 microcontroller to control various components, including DC motors, an ultrasonic sensor, a Bluetooth module, and an LCD display. The motors are driven by an L298N motor driver. The ultrasonic sensor detects the presence of paper, and when paper is detected, the motors driving the conveyor belt and blades are activated.

Component List

  1. Arduino Mega 2560

    • Description: Microcontroller board based on the ATmega2560.
    • Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
  2. DC Motor

    • Description: Standard DC motor.
    • Pins: pin 1, pin 2
  3. L298N DC Motor Driver

    • Description: Dual H-Bridge motor driver.
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  4. HC-SR04 Ultrasonic Sensor

    • Description: Ultrasonic distance sensor.
    • Pins: VCC, TRIG, ECHO, GND
  5. Bluetooth HC-06

    • Description: Bluetooth module for wireless communication.
    • Pins: VCC, GND, TXD, RXD
  6. LCD Display (16 pin)

    • Description: 16x2 character LCD display.
    • Pins: VSS, VDD, VO, RS, R_W, E, DB0-DB7, A, K
  7. LCM1602 IIC

    • Description: I2C interface for LCD display.
    • Pins: GND, VCC, SDA, SCL, D0-D7, RS, RW, E, VSS, VDD, V0, A, K

Wiring Details

Arduino Mega 2560

DC Motor 1

DC Motor 2

L298N DC Motor Driver

HC-SR04 Ultrasonic Sensor

Bluetooth HC-06

LCD Display (16 pin)

LCM1602 IIC

Code Documentation

/*
 * Paper Shredding Machine
 * This code controls a paper shredding machine. An ultrasonic sensor detects
 * the presence of paper. When paper is detected, the conveyor belt and the
 * blades, both driven by DC motors through an L298N motor driver, are activated.
 */

// Pin definitions
const int trigPin = 9;
const int echoPin = 8;
const int motorEnableA = 2;
const int motorInput1A = 4;
const int motorInput2A = 5;
const int motorEnableB = 3;
const int motorInput3B = 6;
const int motorInput4B = 7;

// Motor speed
const int motorSpeed = 255;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);

  // Initialize ultrasonic sensor pins
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  // Initialize motor driver pins
  pinMode(motorEnableA, OUTPUT);
  pinMode(motorInput1A, OUTPUT);
  pinMode(motorInput2A, OUTPUT);
  pinMode(motorEnableB, OUTPUT);
  pinMode(motorInput3B, OUTPUT);
  pinMode(motorInput4B, OUTPUT);

  // Set initial motor states to off
  digitalWrite