Академический Документы
Профессиональный Документы
Культура Документы
technique
Muhammad Abdul Hadi Muhammad Ahmad Muhammad Ahsan Ali Muhammad Huzefa
UG-Student Saleem UG-Student UG-Student
SMME, NUST UG-Student SMME, NUST SMME, NUST
Islamabad, Pakistan SMME, NUST Islamabad, Pakistan Islamabad, Pakistan
muhammadabdulhadi.20@ Islamabad, Pakistan ahsan.a12374@gmail.com
gmail.com ichauhdryahmad@gmail.c Huzefasalfi1032@gmail.co
om m
void setup(){
pinMode (enA ,OUTPUT);
pinMode (in1, INPUT);
Fig. L298N Module pinMode (in2, INPUT);
pinMode (button, INPUT);
B. Arduino // Set initial rotation direction
Arduino consists of two parts. One is a physical digitalWrite (in1, LOW);
programmable circuit board often referred to as a digitalWrite (in2, HIGH);
microcontroller and the other is a piece of software. Software }
runs on computer, used to write and upload computer code to void loop(){
the physical board. int potValue = analogRead(A0); //Read Potentiometer
value
C. Potentiometer int pwmOutput = map (potValue , 0 ,1023, 0, 255); //Map
A potentiometer is an electronic device that is act as the potentiometer
variable resistor. It consists of a three-terminal resistor with a analogWrite(enA, pwmOutput); //Send PWM signal to
sliding or rotating contact that forms an adjustable voltage L298N Enable pin
divider. If only two terminals are used, one end and the wiper,
it acts as a variable resistor or rheostat. // Read button - Debounce
if (digitalRead(button) ==true){
D. Resistor pressed = !pressed;
A resistor is used with potentiometer to limit the current }
flowing through the DC geared motors so that motor does while (digitalRead(button)==true);
not burn up. delay(20);
ACKNOWLEDGMENT
We are grateful to Engr. Faisal Mehmood for providing us
this opportunity to make our knowledge that he gave us
applicable in real life and we sure did learn a lot new things
from it.
REFERENCES
[1] https://en.wikipedia.org/wiki/Arduino
Fig. A complete schematic circuit of this project [2] https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000
19OkFSAU
[3] https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-
control-tutorial-l298n-pwm-h-bridge/