32
of 76
TEP , The Engineering Projects , Image

syedzainnasir

TEP , The Engineering Projects , Rating 7.5 7.5 / 10
TEP , The Engineering Projects , Icon Level: Moderator
TEP , The Engineering Projects , Icon Joined: 20 Mar 2022
TEP , The Engineering Projects , Icon Last Active: 2:21 PM
TEP , The Engineering Projects , Icon Location: TEP , The Engineering Projects , Flag
TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon
help on DC motor simulation in proteus by using L293D chip
TEP , The Engineering Projects , Calender Question: 01-Mar-2017
TEP , The Engineering Projects , Category In: Arduino Projects
hi, i am working on a project which has the output of DC motor. This dc motor is control by L293D chip in proteus. My input is two LDR sensor which is connected to arduino uno. Arduino is used to compare the voltage differences between both of the sensor. if there is a difference of voltage between both sensor, it will send HIGH signal to L293D input to rotate the motor. but now im facing a problem where my dc motor could not rotate in either direction. i have try many ways, but nothing happen to the motor. for the coding, the simulation in proteus show it follows the coding flow. but still the dc motor could not rotate. I hope you guys can help me. thanks.... [code] int sensorPinA0 = A0; // pin that the Bottom/Left sensor is attached to int sensorPinA1 = A1; // pin that the Right sensor is attached to const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) const int enablePin = 9; // H-bridge enable pin const int switchPin = 2; // variables: int sensorValueA0 = 0; // Bottom/Left photoresistor int sensorValueA1 = 0; // Right photoresistor void setup() { // Send debugging information via the Serial monitor Serial.begin(9600); analogReference(INTERNAL); //Assign and set motor driver pins to low pinMode(motor1Pin, OUTPUT); //digitalWrite(motor1Pin, LOW); pinMode(motor2Pin, OUTPUT); //digitalWrite(motor2Pin, LOW); pinMode(enablePin, OUTPUT); //digitalWrite(enablePin, HIGH); //pinMode(9, OUTPUT); pinMode(sensorValueA0, INPUT); pinMode(sensorValueA1, INPUT); pinMode(switchPin, INPUT); //digitalWrite(9, LOW); //pinMode(8, OUTPUT); //digitalWrite(8, LOW); } void loop() { // read the sensor: sensorValueA0 = analogRead(sensorPinA0); sensorValueA1 = analogRead(sensorPinA1); // if the switch is high, motor will turn on one direction: if (sensorValueA0 > sensorValueA1) { digitalWrite(switchPin, HIGH); // set the switch pin high digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high //digitalWrite(enablePin, HIGH); delay(100); } else { digitalWrite(switchPin, LOW); // set the switch pin high digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge high } if (sensorValueA0 < sensorValueA1) { digitalWrite(switchPin, HIGH); digitalWrite(motor1Pin, HIGH); digitalWrite(motor2Pin, LOW); //digitalWrite(enablePin, HIGH); } else { digitalWrite(switchPin, LOW); // set the switch pin high digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge high } //Print debugging information Serial.print("left reading = "); Serial.println(sensorValueA0); // the left/bottom sensor analog reading Serial.print("right reading = "); Serial.println(sensorValueA1); // the right sensor analog reading //Serial.print("Top reading = "); //Serial.println(sensorValueA2); // the top sensor analog reading delay(1000); } [/code]
TEP , The Engineering Projects , Icon Answer: 1 TEP , The Engineering Projects , Icon Views: 150 TEP , The Engineering Projects , Icon Followers: 85
Small Bio
TEP , The Engineering Projects , Image

adiono

TEP , The Engineering Projects , Rating 7.5 7.5 / 10
TEP , The Engineering Projects , Icon Level: Moderator
TEP , The Engineering Projects , Icon Joined: 20 Mar 2022
TEP , The Engineering Projects , Icon Last Active: 2:21 PM
TEP , The Engineering Projects , Icon Location: TEP , The Engineering Projects , Flag
TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon TEP , The ENgineering Projects , Icon

RE:

help on DC motor simulation in proteus by using L293D chip
TEP , The Engineering Projects , Calender Comment: 01-Mar-2017
TEP , The Engineering Projects , Category In: Arduino Projects
[quote=William post_id=211 time=1488371176 user_id=64] hi, i am working on a project which has the output of DC motor. This dc motor is control by L293D chip in proteus. My input is two LDR sensor which is connected to arduino uno. Arduino is used to compare the voltage differences between both of the sensor. if there is a difference of voltage between both sensor, it will send HIGH signal to L293D input to rotate the motor. but now im facing a problem where my dc motor could not rotate in either direction. i have try many ways, but nothing happen to the motor. for the coding, the simulation in proteus show it follows the coding flow. but still the dc motor could not rotate. I hope you guys can help me. thanks.... [code] int sensorPinA0 = A0; // pin that the Bottom/Left sensor is attached to int sensorPinA1 = A1; // pin that the Right sensor is attached to const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A) const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A) const int enablePin = 9; // H-bridge enable pin const int switchPin = 2; // variables: int sensorValueA0 = 0; // Bottom/Left photoresistor int sensorValueA1 = 0; // Right photoresistor void setup() { // Send debugging information via the Serial monitor Serial.begin(9600); analogReference(INTERNAL); //Assign and set motor driver pins to low pinMode(motor1Pin, OUTPUT); //digitalWrite(motor1Pin, LOW); pinMode(motor2Pin, OUTPUT); //digitalWrite(motor2Pin, LOW); pinMode(enablePin, OUTPUT); //digitalWrite(enablePin, HIGH); //pinMode(9, OUTPUT); pinMode(sensorValueA0, INPUT); pinMode(sensorValueA1, INPUT); pinMode(switchPin, INPUT); //digitalWrite(9, LOW); //pinMode(8, OUTPUT); //digitalWrite(8, LOW); } void loop() { // read the sensor: sensorValueA0 = analogRead(sensorPinA0); sensorValueA1 = analogRead(sensorPinA1); // if the switch is high, motor will turn on one direction: if (sensorValueA0 > sensorValueA1) { digitalWrite(switchPin, HIGH); // set the switch pin high digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high //digitalWrite(enablePin, HIGH); delay(100); } else { digitalWrite(switchPin, LOW); // set the switch pin high digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge high } if (sensorValueA0 < sensorValueA1) { digitalWrite(switchPin, HIGH); digitalWrite(motor1Pin, HIGH); digitalWrite(motor2Pin, LOW); //digitalWrite(enablePin, HIGH); } else { digitalWrite(switchPin, LOW); // set the switch pin high digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge high } //Print debugging information Serial.print("left reading = "); Serial.println(sensorValueA0); // the left/bottom sensor analog reading Serial.print("right reading = "); Serial.println(sensorValueA1); // the right sensor analog reading //Serial.print("Top reading = "); //Serial.println(sensorValueA2); // the top sensor analog reading delay(1000); } [/code] [/quote] Please check the code at:
[url=http://www.theengineeringprojects.com/2016/03/motor-direction-control-arduino-proteus.html]DC MOTOR DIRECTION CONTROL WITH ARDUINO IN PROTEUS[/url]
TEP , The Engineering Projects , Tick Correct Answer
Comment Bio
TEP , The Engineering Projects , Tags
PLC
Robot
STM32
Arduino
AI
ESP32
Ladder Logic
PLC Projects
Programming
Communicates STM32
PLC Projects
Communicates PLC
Font Style
Alignment
Indenting and Lists
Insert Media
Insert Items

Want to leave an answer!

Word Count :0 Draft Saved at 12:42 am.