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

Arduino Mega 2560-Based Automated Grinding System with IR Sensor and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino Mega 2560-Based Automated Grinding System with IR Sensor and LCD Display

Circuit Documentation

Summary

This circuit is designed to control a grinding process using an Arduino Mega 2560 microcontroller. The system includes various components such as DC motors, IR sensors, relays, an LCD screen, and a servo motor. The Arduino Mega 2560 reads the state of an IR sensor to determine whether to start or stop the grinding process. It also controls the position of a servo motor and displays the status of the grinding process on an LCD screen.

Component List

  1. DC Motor

    • Description: A motor that converts electrical energy into mechanical energy.
    • Pins: pin 1, pin 2
  2. IR Sensor

    • Description: An infrared sensor used to detect objects.
    • Pins: out, gnd, vcc
  3. Arduino Mega 2560

    • Description: A microcontroller board based on the ATmega2560.
    • Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D21/SCL, D20/SDA, D19/RX1, D18/TX1, D17 PWM/RX2, D16 PWM/TX2, D15/RX3, D14/TX3, D0 RX0, D1 TX0, D2-D13 PWM, AREF, SDA, SCL, D22-D53
  4. 5V 2-Relay JD-VCC

    • Description: A relay module used to control high voltage devices.
    • Pins: JD-VCC, VCC, GND, IN1, IN2, NO, COM, NC
  5. LCD Screen 16x2 I2C

    • Description: A 16x2 character LCD display with I2C interface.
    • Pins: SCL, SDA, VCC, GND
  6. Servo

    • Description: A motor that can be positioned to specific angles.
    • Pins: GND, VCC, PWM
  7. 2.1mm Barrel Jack with Terminal Block

    • Description: A power connector for supplying voltage to the circuit.
    • Pins: POS, NEG

Wiring Details

DC Motor

IR Sensor

Arduino Mega 2560

5V 2-Relay JD-VCC

LCD Screen 16x2 I2C

Servo

2.1mm Barrel Jack with Terminal Block

Code Documentation

#include <Wire.h>
#include <Servo.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
Servo myServo;

void setup() 
{
  lcd.begin();
  lcd.backlight();
  lcd.setCursor(0, 0);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, INPUT);
  myServo.attach(9);
}

void loop() 
{
  int irSensorState = digitalRead(4);
  if (irSensorState == HIGH) 
  {
    digitalWrite(2, HIGH);
    digitalWrite(3, HIGH); 
    lcd.print("Grinding Process is going on!!");
    delay(120000);
  } 
  else 
  {
    digitalWrite(2, LOW);
    digitalWrite(3, LOW); 
    lcd.print("Grinding Process completed");
  }
  myServo.write(0);  
  delay(1000);  

  myServo.write(180);  
  delay(1000);
}

Code Explanation