Project 1 - Controlling a DC motor using PWM and monitoring its Running status
Here's an example implementation of the project using Arduino and the Proteus simulator:
Hardware Components:
- Arduino Uno
- L293D Motor Driver IC
- DC Motor
- LCD Display (16x2)
- Breadboard
- Jumper Wires
Software Components:
- Arduino IDE
- Proteus Simulator
Circuit Diagram:
The circuit diagram is as follows:
- Connect the Arduino Uno to the breadboard.
- Connect the L293D Motor Driver IC to the breadboard.
- Connect the DC Motor to the L293D Motor Driver IC.
- Connect the LCD Display to the breadboard.
- Connect the jumper wires to connect the components.
Arduino Code:
```
#include <LiquidCrystal.h>
// Define the pins for the motor driver
const int motorPin1 = 2;
const int motorPin2 = 3;
// Define the pins for the LCD display
const int lcdRS = 12;
const int lcdE = 11;
const int lcdD4 = 5;
const int lcdD5 = 4;
const int lcdD6 = 3;
const int lcdD7 = 2;
LiquidCrystal lcd(lcdRS, lcdE, lcdD4, lcdD5, lcdD6, lcdD7);
void setup() {
// Initialize the motor pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
// Initialize the LCD display
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Motor Status:");
}
void loop() {
// Set the motor to forward direction
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
// Display the motor status on the LCD display
lcd.setCursor(0, 1);
lcd.print("Forward");
// Wait for 2 seconds
delay(2000);
// Set the motor to reverse direction
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
// Display the motor status on the LCD display
lcd.setCursor(0, 1);
lcd.print("Reverse");
// Wait for 2 seconds
delay(2000);
}
```
Proteus Simulation:
1. Open Proteus and create a new project.
2. Add the Arduino Uno, L293D Motor Driver IC, DC Motor, and LCD Display components to the workspace.
3. Connect the components according to the circuit diagram.
4. Compile and run the simulation.
Expected Outcomes:
1. The DC motor will rotate in forward and reverse directions.
2. The motor status will be displayed on the LCD display.
3. The motor will rotate at a speed controlled by the PWM signal.
Deliverables:
1. A working simulation of the DC motor control system.
2. A report detailing the implementation and testing of the system.