Home
About Us
Achievement
Home
Raspberry-Pi Projects
_Raspberry Pi 4 Complete Guide
Arduino Project
_All Projects
Esp8266 Project
_All Projects
Esp32 Project
_Automation-with-feedback
Arduino DC Motor Control Tutorial
Just Do Electronics
August 09, 2022
Block Diagram :-
Circuit Diagram :
-
Code :-
//Prateek //www.prateeks.in #include
LiquidCrystal_I2C lcd(0x27, 16, 2); #define potentiometer A2 #define bt_F A3 #define bt_S A6 #define bt_B A7 #define M1_Ena 11 #define M1_in1 10 #define M1_in2 9 int read_ADC = 0; int duty_cycle; int duty_cycle_lcd; int set = 0; void setup() { Serial.begin(9600); pinMode(potentiometer, INPUT); pinMode(bt_F, INPUT_PULLUP); pinMode(bt_S, INPUT_PULLUP); pinMode(bt_B, INPUT_PULLUP); pinMode(M1_Ena, OUTPUT); pinMode(M1_in1, OUTPUT); pinMode(M1_in2, OUTPUT); lcd.init(); lcd.backlight(); } void loop() { read_ADC = analogRead(potentiometer); duty_cycle = map(read_ADC, 0, 1023, 0, 255); duty_cycle_lcd = map(read_ADC, 0, 1023, 0, 100); analogWrite(M1_Ena, duty_cycle); lcd.setCursor(0, 0); lcd.print("Duty Cycle: "); lcd.print(duty_cycle_lcd); lcd.print("% "); if (digitalRead (bt_F) == 0) { set = 1; } if (digitalRead (bt_S) == 0) { set = 0; } if (digitalRead (bt_B) == 0) { set = 2; } lcd.setCursor(0, 1); if (set == 0) { lcd.print(" Stop "); digitalWrite(M1_in1, LOW); digitalWrite(M1_in2, LOW); } if (set == 1) { lcd.print(" Clockwise "); digitalWrite(M1_in1, HIGH); digitalWrite(M1_in2, LOW); } if (set == 2) { lcd.print(" Anticlockwise "); digitalWrite(M1_in1, LOW); digitalWrite(M1_in2, HIGH); } delay(50); }
Result :-
Working Video :-
0 Comments
Newer
Older
Build Your Own Gps Tracking System using Arduino
How To Make RFID & Keypad Based Door Lock
IoT Based Fingerprint Biometric Attendance System Using NodeMCU (Esp8266)
ESP32 Interfacing With LDR Sensor
Ultrasonic Sensor as a Counter with Arduino
IoT Based Patient Health Monitoring System Using Blynk App
Nodemcu Interfacing With Em-18
OTP Based Door Lock Using Arduino And SIM800L
MLX90614 Non-Contact Infrared Thermometer With Arduino
Esp32 Cam Based Face Unlock
YouTube
Like on Facebook
Follow on Twitter
Follow on Google+
Follow on Instagram
Subscribe on Youtube
Hi WelCome To My Website If you have a creative mind and want to learn Electronics even without studying it then FRIENDS this Website And Youtube Channel is for you, I am crazy creators who love making Electronics things. I have a bunch of more than 130 Tutorial Videos on My YouTube Channel and I upload a new Tutorial every Sunday.
Tags
Arduino Project
Esp32 Project
Esp8266 Project
0 Comments